Skip to content

Commit

Permalink
fix(ui): prevent sending removeFailed to sleeping nodes in broadcast
Browse files Browse the repository at this point in the history
Fixes #983
  • Loading branch information
robertsLando committed Apr 1, 2021
1 parent f30b98c commit b217d37
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export default {
action: 'removeFailedNode',
args: {
broadcast: true,
confirm: 'This action will remove all failed nodes'
confirm:
'This action will remove all failed nodes. ATTENTION: this will skip sleeping nodes to prevent unwanted behaviours'
}
}
],
Expand Down Expand Up @@ -304,8 +305,15 @@ export default {
}
if (broadcast) {
for (let i = 0; i < this.nodes.length; i++) {
const nodeid = this.nodes[i].id
let nodes = this.nodes
// ignore sleeping nodes in broadcast request. Fixes #983
if (action === 'removeFailedNode') {
nodes = nodes.filter(n => n.status !== 'Asleep')
}
for (let i = 0; i < nodes.length; i++) {
const nodeid = nodes[i].id
this.apiRequest(action, [nodeid])
}
} else {
Expand Down

0 comments on commit b217d37

Please sign in to comment.