diff --git a/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb b/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb index eae06612ff..a5e7576902 100644 --- a/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/GroupJSON.rb @@ -37,6 +37,7 @@ module OpenNebulaJSON rc = case action_hash['perform'] when "chown" then self.chown(action_hash['params']) + when "update" then self.update(action_hash['params']) when "set_quota" then self.set_quota(action_hash['params']) when "add_provider" then self.add_provider(action_hash['params']) when "del_provider" then self.del_provider(action_hash['params']) @@ -51,6 +52,10 @@ module OpenNebulaJSON super(params['owner_id'].to_i) end + def update(params=Hash.new) + super(params['template_raw']) + end + def set_quota(params=Hash.new) quota_json = params['quotas'] quota_template = template_to_str(quota_json) diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index e5497c875c..1f70137a08 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -932,6 +932,13 @@ var OpenNebula = { } }); }, + "update": function(params){ + var action_obj = {"template_raw" : params.data.extra_param }; + OpenNebula.Action.simple_action(params, + OpenNebula.Group.resource, + "update", + action_obj); + }, "set_quota" : function(params){ var action_obj = { quotas : params.data.extra_param }; OpenNebula.Action.simple_action(params,OpenNebula.Group.resource,"set_quota",action_obj); diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index e8482dc7f6..2286957d92 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -445,6 +445,16 @@ var group_actions = { error: onError }, + "Group.update_template" : { + type: "single", + call: OpenNebula.Group.update, + callback: function(request) { + notifyMessage("Template updated correctly"); + Sunstone.runAction('Group.showinfo',request.request.data[0][0]); + }, + error: onError + }, + "Group.delete" : { type: "multiple", call : OpenNebula.Group.del, @@ -587,6 +597,7 @@ var group_buttons = { }; var group_info_panel = { + }; var groups_tab = { @@ -773,6 +784,36 @@ function fromJSONtoProvidersTable(group_info){ function updateGroupInfo(request,group){ var info = group.GROUP; + var info_tab = { + title: tr("Information"), + content: + '
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("Group")+' - '+info.NAME+'
'+tr("ID")+''+info.ID+'
'+tr("Name")+''+info.NAME+'
\ +
\ +
' + + insert_extended_template_table(info.TEMPLATE, + "Group", + info.ID, + "Configuration & Tags") + + '
\ +
' + } + var default_group_quotas = Quotas.default_quotas(info.DEFAULT_GROUP_QUOTAS); var quotas_tab_html = '
' + Quotas.vms(info, default_group_quotas) + '
'; quotas_tab_html += '
' + Quotas.cpu(info, default_group_quotas) + '
'; @@ -813,7 +854,7 @@ function updateGroupInfo(request,group){ ' }; - + Sunstone.updateInfoPanelTab("group_info_panel","group_info_tab",info_tab); Sunstone.updateInfoPanelTab("group_info_panel","group_quotas_tab",quotas_tab); Sunstone.updateInfoPanelTab("group_info_panel","group_providers_tab",providers_tab); Sunstone.popUpInfoPanel("group_info_panel", 'groups-tab'); diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 36dc3a9726..716722f2a5 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -593,11 +593,6 @@ var image_buttons = { layout: "del", text: tr("Delete") }, - //"Image.help" : { - // type: "action", - // text: '?', - // alwaysActive: true - //} } var image_info_panel = {