Skip to content

Commit

Permalink
feat(ui): add shortcut to replace a failed node from node advanced ac…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
robertsLando committed Dec 19, 2024
1 parent 655fc92 commit bbd87d2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,9 @@ export default {
}
}
},
showNodesManager(step) {
showNodesManager(step, stepValues) {
// used in ControlPanel.vue
this.$refs.nodesManager.show(step)
this.$refs.nodesManager.show(step, stepValues)
},
onGrantSecurityClasses(requested) {
if (this.nodesManagerDialog) {
Expand Down
14 changes: 12 additions & 2 deletions src/components/dialogs/DialogNodesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,20 @@ export default {
this.pushStep('replaceInclusionMode')
}
},
show(step) {
show(step, stepValues) {
this.isOpen = true
this.$emit('open')
this.init(true, step)
if (stepValues) {
this.init(true)
this.steps = []
for (const s in stepValues) {
this.pushStep(s)
const step = this.steps[this.steps.length - 1]
Object.assign(step.values, stepValues[s])
}
} else {
this.init(true, step)
}
},
close() {
this.isOpen = false
Expand Down
4 changes: 4 additions & 0 deletions src/components/nodes-table/ExpandedNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ export default {
text: 'Failed Nodes',
options: [
{ name: 'Remove', action: 'removeFailedNode' },
{
name: 'Replace',
action: 'replaceFailedNode',
},
],
icon: 'dangerous',
desc: 'Manage nodes that are dead and/or marked as failed with the controller',
Expand Down
8 changes: 8 additions & 0 deletions src/mixins/InstancesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,14 @@ export default {
}

args.push(options)
} else if (action === 'replaceFailedNode') {
// open nodes manager dialog
this.app.showNodesManager('replaceFailed', {
action: { action: 1 },
replaceFailed: { replaceId: nodeId },
replaceInclusionMode: { inclusionMode: 0 },
})
return
}

if (broadcast) {
Expand Down

0 comments on commit bbd87d2

Please sign in to comment.