diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index 8144502542..bc9c7a983b 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -112,6 +112,7 @@ tabs: Vdc.refresh: true Vdc.create_dialog: true Vdc.update_dialog: true + Vdc.rename: true Vdc.delete: true acls-tab: @@ -160,6 +161,7 @@ tabs: actions: VM.refresh: true VM.create_dialog: true + VM.rename: true VM.chown: true VM.chgrp: true VM.chmod: true @@ -213,6 +215,7 @@ tabs: Template.import_dialog: false Template.update_dialog: true Template.instantiate_vms: true + Template.rename: true Template.chown: true Template.chgrp: true Template.chmod: true @@ -251,6 +254,7 @@ tabs: actions: Image.refresh: true Image.create_dialog: true + Image.rename: true Image.chown: true Image.chgrp: true Image.chmod: true @@ -283,6 +287,7 @@ tabs: actions: File.refresh: true File.create_dialog: true + File.rename: true File.chown: true File.chgrp: true File.chmod: true @@ -310,6 +315,7 @@ tabs: Cluster.create_dialog: true Cluster.update_dialog: true Cluster.delete: true + Cluster.rename: true hosts-tab: panel_tabs: host_info_tab: true @@ -336,6 +342,7 @@ tabs: Host.refresh: true Host.create_dialog: true Host.addtocluster: true + Host.rename: true Host.enable: true Host.disable: true Host.delete: true @@ -360,6 +367,7 @@ tabs: Datastore.refresh: true Datastore.create_dialog: true Datastore.addtocluster: true + Datastore.rename: true Datastore.chown: true Datastore.chgrp: true Datastore.chmod: true @@ -389,6 +397,7 @@ tabs: Network.import_dialog: false Network.update_dialog: true Network.addtocluster: true + Network.rename: true Network.chown: true Network.chgrp: true Network.chmod: true @@ -411,6 +420,7 @@ tabs: SecurityGroup.refresh: true SecurityGroup.create_dialog: true SecurityGroup.update_dialog: true + SecurityGroup.rename: true SecurityGroup.chown: true SecurityGroup.chgrp: true SecurityGroup.chmod: true @@ -518,6 +528,7 @@ tabs: actions: Zone.refresh: true Zone.create_dialog: true + Zone.rename: true Zone.delete: true support-tab: panel_tabs: diff --git a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml index b4f9876072..83610c5f8d 100644 --- a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml @@ -112,6 +112,7 @@ tabs: Vdc.refresh: true Vdc.create_dialog: true Vdc.update_dialog: true + Vdc.rename: true Vdc.delete: true acls-tab: @@ -160,6 +161,7 @@ tabs: actions: VM.refresh: true VM.create_dialog: true + VM.rename: true VM.chown: true VM.chgrp: true VM.chmod: true @@ -213,6 +215,7 @@ tabs: Template.import_dialog: true Template.update_dialog: true Template.instantiate_vms: true + Template.rename: true Template.chown: true Template.chgrp: true Template.chmod: true @@ -251,6 +254,7 @@ tabs: actions: Image.refresh: true Image.create_dialog: true + Image.rename: true Image.chown: true Image.chgrp: true Image.chmod: true @@ -283,6 +287,7 @@ tabs: actions: File.refresh: true File.create_dialog: true + File.rename: true File.chown: true File.chgrp: true File.chmod: true @@ -310,6 +315,7 @@ tabs: Cluster.create_dialog: true Cluster.update_dialog: true Cluster.delete: true + Cluster.rename: true hosts-tab: panel_tabs: host_info_tab: true @@ -336,6 +342,7 @@ tabs: Host.refresh: true Host.create_dialog: true Host.addtocluster: true + Host.rename: true Host.enable: true Host.disable: true Host.delete: true @@ -360,6 +367,7 @@ tabs: Datastore.refresh: true Datastore.create_dialog: true Datastore.addtocluster: true + Datastore.rename: true Datastore.chown: true Datastore.chgrp: true Datastore.chmod: true @@ -389,6 +397,7 @@ tabs: Network.import_dialog: true Network.update_dialog: true Network.addtocluster: true + Network.rename: true Network.chown: true Network.chgrp: true Network.chmod: true @@ -411,6 +420,7 @@ tabs: SecurityGroup.refresh: true SecurityGroup.create_dialog: true SecurityGroup.update_dialog: true + SecurityGroup.rename: true SecurityGroup.chown: true SecurityGroup.chgrp: true SecurityGroup.chmod: true @@ -518,6 +528,7 @@ tabs: actions: Zone.refresh: true Zone.create_dialog: true + Zone.rename: true Zone.delete: true support-tab: panel_tabs: diff --git a/src/sunstone/etc/sunstone-views/cloud.yaml b/src/sunstone/etc/sunstone-views/cloud.yaml index 85fb5b4e8c..3698e34fc2 100644 --- a/src/sunstone/etc/sunstone-views/cloud.yaml +++ b/src/sunstone/etc/sunstone-views/cloud.yaml @@ -24,6 +24,7 @@ tabs: actions: &provisionactions Template.chmod: false Template.delete: true + VM.rename: true VM.resume: true VM.reboot: true VM.reboot_hard: true diff --git a/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml b/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml index 9495e19cef..280d93973f 100644 --- a/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/cloud_vcenter.yaml @@ -24,6 +24,7 @@ tabs: actions: &provisionactions Template.chmod: false Template.delete: true + VM.rename: true VM.resume: true VM.reboot: true VM.reboot_hard: true diff --git a/src/sunstone/etc/sunstone-views/groupadmin.yaml b/src/sunstone/etc/sunstone-views/groupadmin.yaml index fc82168c55..e70fdbddc6 100644 --- a/src/sunstone/etc/sunstone-views/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/groupadmin.yaml @@ -24,6 +24,7 @@ tabs: actions: &provisionactions Template.chmod: true Template.delete: true + VM.rename: true VM.resume: true VM.reboot: true VM.reboot_hard: true diff --git a/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml b/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml index 2f2b78d2d9..ab552844fb 100644 --- a/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml @@ -24,6 +24,7 @@ tabs: actions: &provisionactions Template.chmod: false Template.delete: true + VM.rename: true VM.resume: true VM.reboot: true VM.reboot_hard: true diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index bdef26b368..437b5c21e4 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -113,6 +113,7 @@ tabs: Vdc.refresh: true Vdc.create_dialog: true Vdc.update_dialog: true + Vdc.rename: true Vdc.delete: true acls-tab: @@ -161,6 +162,7 @@ tabs: actions: VM.refresh: true VM.create_dialog: true + VM.rename: true VM.chown: false VM.chgrp: false VM.chmod: true @@ -214,6 +216,7 @@ tabs: Template.import_dialog: false Template.update_dialog: true Template.instantiate_vms: true + Template.rename: true Template.chown: false Template.chgrp: false Template.chmod: true @@ -252,6 +255,7 @@ tabs: actions: Image.refresh: true Image.create_dialog: true + Image.rename: true Image.chown: false Image.chgrp: false Image.chmod: true @@ -284,6 +288,7 @@ tabs: actions: File.refresh: true File.create_dialog: true + File.rename: true File.chown: false File.chgrp: false File.chmod: true @@ -311,6 +316,7 @@ tabs: Cluster.create_dialog: true Cluster.update_dialog: true Cluster.delete: true + Cluster.rename: true hosts-tab: panel_tabs: host_info_tab: true @@ -337,6 +343,7 @@ tabs: Host.refresh: true Host.create_dialog: true Host.addtocluster: true + Host.rename: true Host.enable: true Host.disable: true Host.delete: true @@ -361,6 +368,7 @@ tabs: Datastore.refresh: true Datastore.create_dialog: false Datastore.addtocluster: false + Datastore.rename: true Datastore.chown: false Datastore.chgrp: false Datastore.chmod: true @@ -390,6 +398,7 @@ tabs: Network.import_dialog: false Network.update_dialog: true Network.addtocluster: false + Network.rename: true Network.chown: false Network.chgrp: false Network.chmod: true @@ -412,6 +421,7 @@ tabs: SecurityGroup.refresh: true SecurityGroup.create_dialog: true SecurityGroup.update_dialog: true + SecurityGroup.rename: true SecurityGroup.chown: true SecurityGroup.chgrp: true SecurityGroup.chmod: true @@ -519,6 +529,7 @@ tabs: actions: Zone.refresh: true Zone.create_dialog: true + Zone.rename: true Zone.delete: true support-tab: panel_tabs: diff --git a/src/sunstone/public/app/tabs/clusters-tab/panels/info.js b/src/sunstone/public/app/tabs/clusters-tab/panels/info.js index ef2f94c39f..f7b493501c 100644 --- a/src/sunstone/public/app/tabs/clusters-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/clusters-tab/panels/info.js @@ -57,7 +57,7 @@ define(function(require) { */ function _html() { - var renameTrHTML = RenameTr.html(RESOURCE, this.element.NAME); + var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME); var templateTableHTML = TemplateTable.html(this.element.TEMPLATE, RESOURCE, Locale.tr("Attributes")); @@ -69,7 +69,7 @@ define(function(require) { } function _setup(context) { - RenameTr.setup(RESOURCE, this.element.ID, context); + RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context); TemplateTable.setup(this.element.TEMPLATE, RESOURCE, this.element.ID, context); } diff --git a/src/sunstone/public/app/tabs/datastores-tab/panels/info.js b/src/sunstone/public/app/tabs/datastores-tab/panels/info.js index d87e05a3b0..f8128c6848 100644 --- a/src/sunstone/public/app/tabs/datastores-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/datastores-tab/panels/info.js @@ -67,7 +67,7 @@ define(function(require) { function _html() { - var renameTrHTML = RenameTr.html(RESOURCE, this.element.NAME); + var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME); var clusterTrHTML = ClusterTr.html(this.element.CLUSTER); var templateTableHTML = TemplateTable.html( this.element.TEMPLATE, RESOURCE, @@ -96,7 +96,7 @@ define(function(require) { } function _setup(context) { - RenameTr.setup(RESOURCE, this.element.ID, context); + RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context); ClusterTr.setup(RESOURCE, this.element.ID, this.element.CLUSTER_ID, context); TemplateTable.setup(this.element.TEMPLATE, RESOURCE, this.element.ID, context); PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context); diff --git a/src/sunstone/public/app/tabs/files-tab/panels/info.js b/src/sunstone/public/app/tabs/files-tab/panels/info.js index ae601a2b28..8cdc9860fa 100644 --- a/src/sunstone/public/app/tabs/files-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/files-tab/panels/info.js @@ -67,7 +67,7 @@ define(function(require) { */ function _html() { - var renameTrHTML = RenameTr.html(RESOURCE, this.element.NAME); + var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME); var templateTableHTML = TemplateTable.html(this.element.TEMPLATE, RESOURCE, Locale.tr("Attributes")); var permissionsTableHTML = PermissionsTable.html(TAB_ID, RESOURCE, this.element); var stateStr = Locale.tr(OpenNebulaImage.stateStr(this.element.STATE)); @@ -89,7 +89,7 @@ define(function(require) { } function _setup(context) { - RenameTr.setup(RESOURCE, this.element.ID, context); + RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context); TemplateTable.setup(this.element.TEMPLATE, RESOURCE, this.element.ID, context); PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context); diff --git a/src/sunstone/public/app/tabs/hosts-tab/panels/info.js b/src/sunstone/public/app/tabs/hosts-tab/panels/info.js index fdfbceb5c4..7d3300d6d4 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/hosts-tab/panels/info.js @@ -92,7 +92,7 @@ define(function(require) { RESOURCE, Locale.tr("Attributes")); - var renameTrHTML = RenameTr.html(RESOURCE, this.element.NAME); + var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME); var clusterTrHTML = ClusterTr.html(this.element.CLUSTER); var permissionsTableHTML = PermissionsTable.html(TAB_ID, RESOURCE, this.element); var cpuBars = CPUBars.html(this.element); @@ -113,7 +113,7 @@ define(function(require) { } function _setup(context) { - RenameTr.setup(RESOURCE, this.element.ID, context); + RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context); ClusterTr.setup(RESOURCE, this.element.ID, this.element.CLUSTER_ID, context); TemplateTable.setup(this.strippedTemplate, RESOURCE, this.element.ID, context, this.unshownTemplate); PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context); diff --git a/src/sunstone/public/app/tabs/images-tab/panels/info.js b/src/sunstone/public/app/tabs/images-tab/panels/info.js index d59b80c7b8..610343022d 100644 --- a/src/sunstone/public/app/tabs/images-tab/panels/info.js +++ b/src/sunstone/public/app/tabs/images-tab/panels/info.js @@ -66,7 +66,7 @@ define(function(require) { */ function _html() { - var renameTrHTML = RenameTr.html(RESOURCE, this.element.NAME); + var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME); var templateTableHTML = TemplateTable.html(this.element.TEMPLATE, RESOURCE, Locale.tr("Attributes")); var permissionsTableHTML = PermissionsTable.html(TAB_ID, RESOURCE, this.element); var prettyRegTime = Humanize.prettyTime(this.element.REGTIME); @@ -90,7 +90,7 @@ define(function(require) { } function _setup(context) { - RenameTr.setup(RESOURCE, this.element.ID, context); + RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context); TemplateTable.setup(this.element.TEMPLATE, RESOURCE, this.element.ID, context); PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context); diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/list.hbs b/src/sunstone/public/app/tabs/provision-tab/vms/list.hbs index 8df2d3bc7d..c3eb0d4b74 100644 --- a/src/sunstone/public/app/tabs/provision-tab/vms/list.hbs +++ b/src/sunstone/public/app/tabs/provision-tab/vms/list.hbs @@ -25,10 +25,12 @@ {{!opts.title}} + {{#isTabActionEnabled "provision-tab" "VM.rename"}} + {{/isTabActionEnabled}} diff --git a/src/sunstone/public/app/tabs/provision-tab/vms/list.js b/src/sunstone/public/app/tabs/provision-tab/vms/list.js index 3872cfde11..d6387e8cf3 100644 --- a/src/sunstone/public/app/tabs/provision-tab/vms/list.js +++ b/src/sunstone/public/app/tabs/provision-tab/vms/list.js @@ -341,32 +341,34 @@ define(function(require) { $(".provision_info_vm_name", context).text(data.NAME); - context.off("click", ".provision_info_vm_rename a"); - context.on("click", ".provision_info_vm_rename a", function() { - var valueStr = $(".provision_info_vm_name", context).text(); - $(".provision_info_vm_name", context).html(''); - }); + if (Config.isTabActionEnabled("provision-tab", 'VM.rename')) { + context.off("click", ".provision_info_vm_rename a"); + context.on("click", ".provision_info_vm_rename a", function() { + var valueStr = $(".provision_info_vm_name", context).text(); + $(".provision_info_vm_name", context).html(''); + }); - context.off("change", ".input_edit_value_rename"); - context.on("change", ".input_edit_value_rename", function() { - var valueStr = $(".input_edit_value_rename", context).val(); - if (valueStr != "") { - OpenNebula.VM.rename({ - data : { - id: vm_id, - extra_param: { - "name" : valueStr + context.off("change", ".input_edit_value_rename"); + context.on("change", ".input_edit_value_rename", function() { + var valueStr = $(".input_edit_value_rename", context).val(); + if (valueStr != "") { + OpenNebula.VM.rename({ + data : { + id: vm_id, + extra_param: { + "name" : valueStr + } + }, + success: function(request, response){ + update_provision_vm_info(vm_id, context); + }, + error: function(request, response){ + Notifier.onError(request, response); } - }, - success: function(request, response){ - update_provision_vm_info(vm_id, context); - }, - error: function(request, response){ - Notifier.onError(request, response); - } - }); - } - }); + }); + } + }); + } $(".provision-pricing-table_vm_info", context).html( '