1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

F #5744: Display scheduler error message in info tab (#1813)

Signed-off-by: Frederick Ernesto Borges Noronha <fborges@opennebula.io>
This commit is contained in:
Frederick Borges 2022-02-24 14:34:37 +01:00 committed by GitHub
parent 6a65b9bff0
commit b4a78b27ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,20 @@ define(function(require) {
error_msg: this.element.USER_TEMPLATE.ERROR,
error_title: Locale.tr("Driver Error"),
canDismiss: true,
dismisId: "close_vm_async_error"
dismissId: "close_vm_async_error"
}
);
}
if (this.element &&
this.element.USER_TEMPLATE &&
this.element.USER_TEMPLATE.SCHED_MESSAGE){
errorMessageHTML += TemplateInfoError(
{
error_msg: this.element.USER_TEMPLATE.SCHED_MESSAGE,
error_title: Locale.tr("Scheduler Error"),
canDismiss: true,
dismissId: "close_vm_scheduler_async_error"
}
);
}
@ -142,7 +155,7 @@ define(function(require) {
error_msg: lastErrorAndId.error,
error_title: Locale.tr("Scheduled Action Error") + " (ID: #" + lastErrorAndId.id + ")",
canDismiss: false,
dismisId: ""
dismissId: ""
}
);
}
@ -219,6 +232,16 @@ define(function(require) {
Sunstone.runAction(RESOURCE + ".update_template", resourceId, template_str);
});
context.off("click", "#close_vm_scheduler_async_error");
context.on("click", "#close_vm_scheduler_async_error", function() {
var resourceId = that.element.ID;
var templateJSON = $.extend({}, that.element.USER_TEMPLATE);
delete templateJSON.SCHED_MESSAGE;
template_str = TemplateUtils.templateToString(templateJSON);
Sunstone.runAction(RESOURCE + ".update_template", resourceId, template_str);
});
if (OpenNebula.VM.isvCenterVM(this.element)) {
$("button[href=\"VM.upload_marketplace_dialog\"]").attr("disabled","disabled");
} else {