mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
bug #3912: Use commonActions in Acls tab
This commit is contained in:
parent
83c5feb304
commit
43f801abf0
@ -4,68 +4,22 @@ define(function(require) {
|
||||
var Locale = require('utils/locale');
|
||||
var DataTable = require('./datatable');
|
||||
var OpenNebulaResource = require('opennebula/acl');
|
||||
var CommonActions = require('utils/common-actions');
|
||||
|
||||
var RESOURCE = "Acl";
|
||||
var TAB_ID = require('./tabId');
|
||||
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
|
||||
|
||||
var XML_ROOT = "ACL"
|
||||
var RESOURCE = "Acl"
|
||||
|
||||
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID);
|
||||
|
||||
var _actions = {
|
||||
"Acl.create" : {
|
||||
type: "create",
|
||||
call: OpenNebulaResource.create,
|
||||
callback : function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
Sunstone.getDataTable(TAB_ID).addElement(request, response);
|
||||
},
|
||||
error: function(request, response) {
|
||||
Sunstone.hideFormPanelLoading(TAB_ID);
|
||||
Notifier.onError(request, response);
|
||||
},
|
||||
notify: true
|
||||
},
|
||||
|
||||
"Acl.create_dialog" : {
|
||||
type: "custom",
|
||||
call: function() {
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "create");
|
||||
}
|
||||
},
|
||||
|
||||
"Acl.list" : {
|
||||
type: "list",
|
||||
call: OpenNebulaResource.list,
|
||||
callback: function(request, response) {
|
||||
Sunstone.getDataTable(TAB_ID).updateView(request, response);
|
||||
},
|
||||
error: Notifier.onError
|
||||
},
|
||||
|
||||
"Acl.refresh" : {
|
||||
type: "custom",
|
||||
call: function() {
|
||||
var tab = $('#' + TAB_ID);
|
||||
if (Sunstone.rightInfoVisible(tab)) {
|
||||
Sunstone.runAction(RESOURCE+".show", Sunstone.rightInfoResourceId(tab));
|
||||
} else {
|
||||
Sunstone.getDataTable(TAB_ID).waitingNodes();
|
||||
Sunstone.runAction(RESOURCE+".list", {force: true});
|
||||
}
|
||||
},
|
||||
error: Notifier.onError
|
||||
},
|
||||
|
||||
"Acl.delete" : {
|
||||
type: "multiple",
|
||||
call : OpenNebulaResource.del,
|
||||
callback : function(request, response) {
|
||||
Sunstone.getDataTable(TAB_ID).deleteElement(request, response);
|
||||
},
|
||||
elements: function() {
|
||||
return Sunstone.getDataTable(TAB_ID).elements();
|
||||
},
|
||||
error: Notifier.onError,
|
||||
},
|
||||
"Acl.list" : _commonActions.list(),
|
||||
"Acl.refresh" : _commonActions.refresh(),
|
||||
"Acl.delete" : _commonActions.del(),
|
||||
"Acl.create" : _commonActions.create(CREATE_DIALOG_ID),
|
||||
"Acl.create_dialog" : _commonActions.showCreate(CREATE_DIALOG_ID)
|
||||
};
|
||||
|
||||
return _actions;
|
||||
|
Loading…
x
Reference in New Issue
Block a user