diff --git a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb index c2d8a09c12..8713d15574 100644 --- a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb @@ -43,6 +43,7 @@ module OpenNebulaJSON when "addvnet" then self.addvnet(action_hash['params']) when "delvnet" then self.delvnet(action_hash['params']) when "update" then self.update(action_hash['params']) + when "rename" then self.rename(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << @@ -78,5 +79,9 @@ module OpenNebulaJSON def update(params=Hash.new) super(params['template_raw']) end + + def rename(params=Hash.new) + super(params['name']) + end end end diff --git a/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb b/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb index e7ff02b4ea..a17ad80f7e 100644 --- a/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/DatastoreJSON.rb @@ -50,6 +50,7 @@ module OpenNebulaJSON when "update" then self.update(action_hash['params']) when "chown" then self.chown(action_hash['params']) when "chmod" then self.chmod_octet(action_hash['params']) + when "rename" then self.rename(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << " available for this resource" @@ -68,5 +69,9 @@ module OpenNebulaJSON def chmod_octet(params=Hash.new) super(params['octet']) end + + def rename(params=Hash.new) + super(params['name']) + end end end diff --git a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb index 196010d609..57adb5df10 100644 --- a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb @@ -51,6 +51,7 @@ module OpenNebulaJSON when "enable" then self.enable when "disable" then self.disable when "update" then self.update(action_hash['params']) + when "rename" then self.rename(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << " available for this resource" @@ -62,5 +63,8 @@ module OpenNebulaJSON super(params['template_raw']) end + def rename(params=Hash.new) + super(params['name']) + end end end diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 878e005170..4fcf8542a1 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -531,6 +531,13 @@ var OpenNebula = { }, "pool_monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.Host.resource,true); + }, + "rename" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params, + OpenNebula.Host.resource, + "rename", + action_obj); } }, @@ -1152,6 +1159,13 @@ var OpenNebula = { OpenNebula.Cluster.resource, "update", action_obj); + }, + "rename" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params, + OpenNebula.Cluster.resource, + "rename", + action_obj); } }, "Datastore" : { @@ -1191,6 +1205,13 @@ var OpenNebula = { }, "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.Datastore.resource,"template"); + }, + "rename" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params, + OpenNebula.Datastore.resource, + "rename", + action_obj); } }, diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index 53f372bf6b..b296532e8a 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -1070,6 +1070,18 @@ var cluster_actions = { type: "single", call: popUpUpdateClusterDialog }, + + "Cluster.rename" : { + type: "single", + call: OpenNebula.Cluster.rename, + callback: function(request) { + notifyMessage("Cluster renamed correctly"); + Sunstone.runAction('Cluster.showinfo',request.request.data[0]); + Sunstone.runAction('Cluster.list'); + }, + error: onError, + notify: true + } }; var cluster_buttons = { @@ -1233,18 +1245,22 @@ function updateClusterInfo(request,cluster){
' + + | ||||
---|---|---|---|---|
' + tr("Cluster") + ' - '+cluster_info.NAME+' | ||||
' + tr("id") + ' | \ -'+cluster_info.ID+' | \ +'+cluster_info.ID+' | \||
' + tr("Name") + ' | \ -'+cluster_info.NAME+' | \ +'+tr("Name")+' | \ +'+cluster_info.NAME+' | \ +\ + | \