Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): add shortcut to replace a failed node from node advanced actions #4068

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading