47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
class ICMPNodeActionConfirmDialog extends EICDialogContent {
|
|
actions = [
|
|
{
|
|
label: 'cancel',
|
|
onclick: this.cancel.bind(this),
|
|
severity: 'secondary',
|
|
role: 'cancel'
|
|
},
|
|
{
|
|
label: 'proceed',
|
|
onclick: this.process.bind(this),
|
|
severity: 'primary',
|
|
role: 'process'
|
|
}
|
|
]
|
|
|
|
async DOMContentLoaded(options) {
|
|
this.node = options.models.node;
|
|
this.action = options.action
|
|
this.number = options.number
|
|
this.type = options.type
|
|
this.nodeId = options.nodeId
|
|
this.report = options.report
|
|
console.log(options)
|
|
console.log(this)
|
|
}
|
|
|
|
DOMContentFocused() {
|
|
ui.eicfy(this.el);
|
|
this.form = new Form(this.el);
|
|
}
|
|
|
|
process() {
|
|
let payload = {
|
|
status: this.action,
|
|
form: this.report
|
|
};
|
|
|
|
payload = {...payload, ...this.form.value}
|
|
|
|
this.node.process(this.action, this.number, this.type, this.nodeId, payload)
|
|
.then( this.commit );
|
|
|
|
}
|
|
}
|
|
|
|
app.registerClass('ICMPNodeActionConfirmDialog', ICMPNodeActionConfirmDialog); |