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

Feature #2722: Show created resource IDs

This commit is contained in:
Carlos Martín 2016-05-17 17:24:31 +02:00
parent 749cfe1c5c
commit 2d1140df4f
22 changed files with 57 additions and 36 deletions

View File

@ -28,7 +28,8 @@ define(function(require) {
var XML_ROOT = "ACL"
var RESOURCE = "Acl"
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("ACL Rule created"));
var _actions = {
"Acl.list" : _commonActions.list(),

View File

@ -28,7 +28,8 @@ define(function(require) {
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Cluster created"));
var _actions = {
"Cluster.create_dialog" : _commonActions.showCreate(CREATE_DIALOG_ID),

View File

@ -30,7 +30,8 @@ define(function(require) {
var IMPORT_DIALOG_ID = require('./form-panels/import/formPanelId');
var CLUSTERS_DIALOG_ID = require('utils/dialogs/clusters/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Datastore created"));
var _actions = {
"Datastore.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -26,7 +26,8 @@ define(function(require) {
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("File created"));
var _actions = {
"File.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -29,7 +29,8 @@ define(function(require) {
var RESOURCE = "Group";
var XML_ROOT = "GROUP";
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Group created"));
var _actions = {
"Group.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -29,7 +29,8 @@ define(function(require) {
var RESOURCE = "Host"
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Host created"));
var _actions = {
"Host.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -33,7 +33,8 @@ define(function(require) {
var IMPORT_DIALOG_ID = require('./form-panels/import/formPanelId');
var CONFIRM_DIALOG_ID = require('utils/dialogs/generic-confirm/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Image created"));
var _actions = {
"Image.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -30,7 +30,8 @@ define(function(require) {
var EXPORT_DIALOG_ID = require('./form-panels/export/formPanelId');
var CONFIRM_DIALOG_ID = require('utils/dialogs/generic-confirm/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("MarketPlace App created"));
var _actions = {
"MarketPlaceApp.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -26,7 +26,8 @@ define(function(require) {
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("MarketPlace created"));
var _actions = {
"MarketPlace.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -30,7 +30,8 @@ define(function(require) {
var ROLES_PANEL_ID = require('./panels/roles/panelId');
var SCALE_DIALOG_ID = require('./dialogs/scale/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Service created"));
function roleElements() {
var selected_nodes = [];

View File

@ -29,7 +29,8 @@ define(function(require) {
var XML_ROOT = "DOCUMENT";
var RESOURCE = "ServiceTemplate";
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Service Template created"));
var _actions = {
"ServiceTemplate.create" : _commonActions.create(CREATE_DIALOG_ID),
@ -64,6 +65,8 @@ define(function(require) {
callback: function(request, response){
Sunstone.hideFormPanel(TAB_ID);
OpenNebulaAction.clear_cache("SERVICE");
Notifier.notifyCustom(Locale.tr("Service created"), " ID: " + response.DOCUMENT.ID, false);
},
elements: function() {
return Sunstone.getDataTable(TAB_ID).elements();
@ -72,7 +75,7 @@ define(function(require) {
Sunstone.hideFormPanelLoading(TAB_ID);
Notifier.onError(request, response);
},
notify: true
notify: false
},
"ServiceTemplate.instantiate_dialog" : {

View File

@ -29,7 +29,8 @@ define(function(require) {
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);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Security Group created"));
var _actions = {
"SecurityGroup.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -32,7 +32,8 @@ define(function(require) {
var XML_ROOT = "VMTEMPLATE"
var RESOURCE = "Template"
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("VM Template created"));
var _actions = {
"Template.list" : _commonActions.list(),
@ -146,9 +147,11 @@ define(function(require) {
"Template.instantiate" : {
type: "multiple",
call: OpenNebulaResource.instantiate,
callback: function(req) {
callback: function(request, response) {
Sunstone.hideFormPanel(TAB_ID);
OpenNebulaAction.clear_cache("VM");
Notifier.notifyCustom(Locale.tr("VM created"), " ID: " + response, false);
},
elements: function() {
return Sunstone.getDataTable(TAB_ID).elements();
@ -158,12 +161,12 @@ define(function(require) {
Sunstone.hideFormPanelLoading();
Notifier.onError(request, response);
},
notify: true
notify: false
},
"Template.instantiate_quiet" : {
type: "single",
call: OpenNebulaResource.instantiate,
callback: function(req) {
callback: function(request, response) {
Sunstone.hideFormPanel(TAB_ID);
OpenNebulaAction.clear_cache("VM");
},
@ -189,9 +192,11 @@ define(function(require) {
{
type: "single",
call: OpenNebulaResource.instantiate_persistent,
callback: function(req) {
callback: function(request, response) {
Sunstone.hideFormPanel(TAB_ID);
OpenNebulaAction.clear_cache("VM");
Notifier.notifyCustom(Locale.tr("VM created"), " ID: " + response, false);
},
error: function(request, response){
// without tab id param to work for both templates and vms tab

View File

@ -129,17 +129,10 @@ define(function(require) {
action = "instantiate_persistent";
n_times_int = 1;
}else{
action = "instantiate_quiet";
action = "instantiate";
}
$.each(this.selected_nodes, function(index, template_id) {
var extra_msg = "";
if (n_times_int > 1) {
extra_msg = n_times_int + " times";
}
Notifier.notifySubmit("Template.instantiate", template_id, extra_msg);
var extra_info = {
'hold': hold
};
@ -163,7 +156,7 @@ define(function(require) {
for (var i = 0; i < n_times_int; i++) {
extra_info['vm_name'] = vm_name.replace(/%i/gi, i); // replace wildcard
Sunstone.runAction("Template."+action, template_id, extra_info);
Sunstone.runAction("Template."+action, [template_id], extra_info);
}
});

View File

@ -33,7 +33,8 @@ define(function(require) {
var RESOURCE = "User";
var XML_ROOT = "USER";
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("User created"));
var _actions = {
"User.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -28,7 +28,8 @@ define(function(require) {
var RESOURCE = "Vdc";
var XML_ROOT = "VDC";
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("VDC created"));
var _actions = {
"Vdc.create_dialog" : _commonActions.showCreate(CREATE_DIALOG_ID),

View File

@ -36,7 +36,8 @@ define(function(require) {
var XML_ROOT = "VM";
var RESOURCE = "VM";
var _commonActions = new CommonActions(OpenNebulaVM, RESOURCE, TAB_ID);
var _commonActions = new CommonActions(OpenNebulaVM, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("VM created"));
var _actions = {
"VM.list": _commonActions.list(),

View File

@ -34,7 +34,8 @@ define(function(require) {
var IMPORT_DIALOG_ID = require('./form-panels/import/formPanelId');
var CLUSTERS_DIALOG_ID = require('utils/dialogs/clusters/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Virtual Network created"));
var _actions = {
"Network.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -27,7 +27,8 @@ define(function(require) {
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Virtual Router created"));
var _actions = {
"VirtualRouter.create" : _commonActions.create(CREATE_DIALOG_ID),

View File

@ -27,7 +27,8 @@ define(function(require) {
var TAB_ID = require('./tabId');
var CREATE_DIALOG_ID = require('./dialogs/create/dialogId');
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID, XML_ROOT);
var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID,
XML_ROOT, Locale.tr("Zone created"));
var _actions = {
"Zone.create" : {

View File

@ -23,11 +23,12 @@ define(function(require) {
CONSTRUCTOR
*/
function CommonActions(openNebulaResource, resourceStr, tabId, xmlRoot) {
function CommonActions(openNebulaResource, resourceStr, tabId, xmlRoot, createdStr) {
this.openNebulaResource = openNebulaResource;
this.tabId = tabId;
this.resourceStr = resourceStr;
this.xmlRoot = xmlRoot;
this.createdStr = createdStr;
}
CommonActions.prototype.list = _list;
@ -149,12 +150,14 @@ define(function(require) {
Sunstone.resetFormPanel(that.tabId, formPanelId);
Sunstone.hideFormPanel(that.tabId);
that.refresh();
Notifier.notifyCustom(that.createdStr, " ID: " + response[that.xmlRoot].ID, false);
},
error: function(request, response) {
Sunstone.hideFormPanelLoading(that.tabId);
Notifier.onError(request, response);
},
notify: true
notify: false
}
}

View File

@ -49,7 +49,7 @@ define(function(require) {
}
var _notifyCustom = function(title, msg, sticky) {
msg = (title ? title : "") + msg;
msg = (title ? title + "</br>" : "") + msg;
$.jGrowl(msg, {theme: "jGrowl-notify-submit", position: "bottom-right", sticky: sticky});
}