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 (#4068)
  • Loading branch information
robertsLando authored Dec 20, 2024
1 parent 655fc92 commit 24b9082
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 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(stepOrStepsValues) {
// used in ControlPanel.vue
this.$refs.nodesManager.show(step)
this.$refs.nodesManager.show(stepOrStepsValues)
},
onGrantSecurityClasses(requested) {
if (this.nodesManagerDialog) {
Expand Down
20 changes: 16 additions & 4 deletions src/components/dialogs/DialogNodesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1176,10 +1176,19 @@ export default {
this.pushStep('replaceInclusionMode')
}
},
show(step) {
async show(stepOrStepsValues) {
this.isOpen = true
this.$emit('open')
this.init(true, step)
if (typeof stepOrStepsValues === 'object') {
this.init(true)
this.steps = []
for (const s in stepOrStepsValues) {
const step = await this.pushStep(s)
Object.assign(step.values, stepOrStepsValues[s])
}
} else {
this.init(true, stepOrStepsValues)
}
},
close() {
this.isOpen = false
Expand Down Expand Up @@ -1233,9 +1242,12 @@ export default {
typeof step === 'string' ? this.availableSteps[step] : step
s.index = this.steps.length + 1
this.alert = null
this.steps.push(copy(s))
const newStep = copy(s)
this.steps.push(newStep)
await this.$nextTick()
this.currentStep = s.index
this.currentStep = newStep.index
return newStep
},
stopAction() {
this.stopped = true
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({
action: { action: 1 },
replaceFailed: { replaceId: nodeId },
replaceInclusionMode: { inclusionMode: 0 },
})
return
}

if (broadcast) {
Expand Down

0 comments on commit 24b9082

Please sign in to comment.