mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
* B #3217: Create or update a VN in Sunstone Signed-off-by: Jorge Lobo <jlobo@opennebula.systems> * B #3217: Create or update a VN in Sunstone Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
1 parent
b4aedb465a
commit
d087ed32b1
5 files changed
+19
-11
No files matched your search
@@ -1247,11 +1247,10 @@ define(function(require) {
|
||||
var dialogInstance = SunstoneCfg["dialogInstances"][dialogId];
|
||||
if (dialogInstance == undefined) {
|
||||
var Dialog = SunstoneCfg["dialogs"][dialogId];
|
||||
var dialogInstance = new Dialog();
|
||||
dialogInstance = new Dialog();
|
||||
dialogInstance.insert();
|
||||
SunstoneCfg["dialogInstances"][dialogId] = dialogInstance;
|
||||
}
|
||||
|
||||
return dialogInstance;
|
||||
};
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ define(function(require) {
|
||||
Sunstone.getDialog(DIALOG_ID).hide();
|
||||
Sunstone.getDialog(DIALOG_ID).reset();
|
||||
setTimeout(function() {
|
||||
console.log("d");
|
||||
Sunstone.runAction("Image.refresh");
|
||||
}, 1500);
|
||||
return false;
|
||||
|
||||
@@ -152,7 +152,8 @@ define(function(require) {
|
||||
Sunstone.getDialog(CLUSTERS_DIALOG_ID).setParams({
|
||||
element: response[XML_ROOT],
|
||||
resource:"vnet",
|
||||
resource_name: RESOURCE
|
||||
resource_name: RESOURCE,
|
||||
only_update_template: false
|
||||
});
|
||||
|
||||
Sunstone.getDialog(CLUSTERS_DIALOG_ID).reset();
|
||||
|
||||
@@ -82,9 +82,7 @@ define(function(require) {
|
||||
|
||||
$("#" + DIALOG_ID + "Form", dialog).submit(function() {
|
||||
var selectedClustersList = that.clustersTable.retrieveResourceTableSelect();
|
||||
|
||||
if ( that.only_update_template != undefined && that.only_update_template != true) {
|
||||
|
||||
$.each(selectedClustersList, function(index, clusterId) {
|
||||
if ($.inArray(clusterId, that.originalClusterIds) === -1) {
|
||||
if(that.resource == "datastore"){
|
||||
@@ -94,7 +92,6 @@ define(function(require) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.each(that.originalClusterIds, function(index, clusterId) {
|
||||
if ($.inArray(clusterId, selectedClustersList) === -1) {
|
||||
if(that.resource == "datastore"){
|
||||
@@ -111,9 +108,7 @@ define(function(require) {
|
||||
|
||||
Sunstone.getDialog(DIALOG_ID).hide();
|
||||
Sunstone.getDialog(DIALOG_ID).reset();
|
||||
|
||||
setTimeout(function() {
|
||||
console.log("n");
|
||||
Sunstone.runAction(that.resource_name+".refresh");
|
||||
}, 1500);
|
||||
|
||||
|
||||
@@ -41,8 +41,22 @@ define(function(require) {
|
||||
//Notification on error
|
||||
var _notifyError = function(msg, target=undefined, context=undefined) {
|
||||
if(target && context){
|
||||
var tab = $(target).find($(".is-invalid-input",context)).closest(".tabs-panel",context);
|
||||
tab.parent().siblings($(".tabs",context)).find($("a[href$=\"#"+tab.attr("id")+"\"]",context)).click();
|
||||
var tab = $(target).find($(".is-invalid-input",context));
|
||||
tab.parents().each(
|
||||
function(id,element){
|
||||
var parent = $(element);
|
||||
if(parent.hasClass("tabs-panel")){
|
||||
var tabs = parent.parent().siblings($(".tabs",context));
|
||||
if(tabs && tabs.length){
|
||||
var find = tabs.find($("a[href$=\"#"+parent.attr("id")+"\"]",context))
|
||||
if(find && find.length){
|
||||
find.click();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
$.jGrowl(msg, {theme: "jGrowl-notify-error", position: "bottom-right", sticky: true});
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user