Feature #3204: Add the SG commit action to sunstone

This commit is contained in:
Carlos Martín committed 2016-03-31 12:00:37 +02:00
1 parent 76694ca85e
commit 0b413e7687
9 files changed
+61 -2

No files matched your search

@@ -633,6 +633,7 @@ tabs:
SecurityGroup.chgrp: true
SecurityGroup.chmod: true
SecurityGroup.clone_dialog: true
SecurityGroup.commit_dialog: true
SecurityGroup.delete: true
support-tab:
panel_tabs:
@@ -632,6 +632,7 @@ tabs:
SecurityGroup.chgrp: true
SecurityGroup.chmod: true
SecurityGroup.clone_dialog: true
SecurityGroup.commit_dialog: true
SecurityGroup.delete: true
support-tab:
panel_tabs:
@@ -632,6 +632,7 @@ tabs:
SecurityGroup.chgrp: false
SecurityGroup.chmod: false
SecurityGroup.clone_dialog: false
SecurityGroup.commit_dialog: false
SecurityGroup.delete: false
support-tab:
panel_tabs:
@@ -632,6 +632,7 @@ tabs:
SecurityGroup.chgrp: false
SecurityGroup.chmod: false
SecurityGroup.clone_dialog: false
SecurityGroup.commit_dialog: false
SecurityGroup.delete: false
support-tab:
panel_tabs:
@@ -636,6 +636,7 @@ tabs:
SecurityGroup.chgrp: true
SecurityGroup.chmod: true
SecurityGroup.clone_dialog: true
SecurityGroup.commit_dialog: true
SecurityGroup.delete: true
oneflow-dashboard-tab:
panel_tabs:
@@ -49,6 +49,7 @@ module OpenNebulaJSON
when "chmod" then self.chmod_json(action_hash['params'])
when "clone" then self.clone(action_hash['params'])
when "rename" then self.rename(action_hash['params'])
when "commit" then self.commit(action_hash['params'])
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@@ -91,5 +92,9 @@ module OpenNebulaJSON
def clone(params=Hash.new)
super(params['name'])
end
def commit(params=Hash.new)
super(params['recover'] == true)
end
end
end
@@ -63,7 +63,11 @@ define(function(require) {
},
"getName": function(id){
return OpenNebulaAction.getName(id, RESOURCE);
}
},
"commit" : function(params) {
var action_obj = {"recover": params.data.extra_param};
OpenNebulaAction.simple_action(params, RESOURCE, "commit", action_obj);
},
}
return SecurityGroup;
@@ -27,6 +27,7 @@ define(function(require) {
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var CLONE_DIALOG_ID = require('./dialogs/clone/dialogId');
var CONFIRM_DIALOG_ID = require('utils/dialogs/generic-confirm/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
@@ -46,6 +47,7 @@ define(function(require) {
"SecurityGroup.append_template" : _commonActions.appendTemplate(),
"SecurityGroup.update_dialog" : _commonActions.checkAndShowUpdate(),
"SecurityGroup.show_to_update" : _commonActions.showUpdate(CREATE_DIALOG_ID),
"SecurityGroup.commit": _commonActions.multipleAction('commit'),
"SecurityGroup.clone_dialog" : {
type: "custom",
@@ -64,7 +66,45 @@ define(function(require) {
},
error: Notifier.onError,
notify: true
}
},
"SecurityGroup.commit_dialog":
{
type: "custom",
call: function() {
Sunstone.getDialog(CONFIRM_DIALOG_ID).setParams({
//header :
body : Locale.tr(
"Please note: each time the rules are edited, the commit operation is done automatically. "+
"<br/><br/>"+
"This action will force the propagation of security group changes to VMs. "+
"The operation takes time to iterate over all VMs in the security group, "+
"the progress can be checked in the \"VMs\" panel."+
"<br/><br/>"+
"With the recover option set, the commit operation will only operate on "+
"outdated and error VMs. This is intended to reinitialize the updating "+
"process if a previous one was interrupted."),
//question :
buttons : [
Locale.tr("Commit --recover"),
Locale.tr("Commit"),
],
submit : [
function(){
Sunstone.runAction('SecurityGroup.commit', Sunstone.getDataTable(TAB_ID).elements(), true);
return false;
},
function(){
Sunstone.runAction('SecurityGroup.commit', Sunstone.getDataTable(TAB_ID).elements(), false);
return false;
}
]
});
Sunstone.getDialog(CONFIRM_DIALOG_ID).reset();
Sunstone.getDialog(CONFIRM_DIALOG_ID).show();
}
},
};
return _actions;
@@ -51,6 +51,11 @@ define(function(require) {
layout: "main",
text: Locale.tr("Clone")
},
"SecurityGroup.commit_dialog" : {
type: "action",
layout: "main",
text: Locale.tr("Commit")
},
"SecurityGroup.delete" : {
type: "confirm",
layout: "del",