mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-17 18:33:32 +09:00
feature #1664: Add template handling to VM resources
This commit is contained in:
1 parent
4b4254a5cd
commit
2a8ce18e5f
3 files changed
+30
-18
No files matched your search
@@ -64,6 +64,7 @@ module OpenNebulaJSON
|
||||
when "chmod" then self.chmod_octet(action_hash['params'])
|
||||
when "attachdisk" then self.attachdisk(action_hash['params'])
|
||||
when "detachdisk" then self.detachdisk(action_hash['params'])
|
||||
when "update" then self.update(action_hash['params'])
|
||||
else
|
||||
error_msg = "#{action_hash['perform']} action not " <<
|
||||
" available for this resource"
|
||||
@@ -108,5 +109,9 @@ module OpenNebulaJSON
|
||||
def detachdisk(params=Hash.new)
|
||||
super(params['disk_id'].to_i)
|
||||
end
|
||||
|
||||
def update(params=Hash.new)
|
||||
super(params['template_raw'])
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -713,6 +713,13 @@ var OpenNebula = {
|
||||
"startvnc" : function(params){
|
||||
OpenNebula.VM.vnc(params,"startvnc");
|
||||
},
|
||||
"update": function(params){
|
||||
var action_obj = {"template_raw" : params.data.extra_param };
|
||||
OpenNebula.Action.simple_action(params,
|
||||
OpenNebula.VM.resource,
|
||||
"update",
|
||||
action_obj);
|
||||
},
|
||||
"monitor" : function(params){
|
||||
OpenNebula.Action.monitor(params,OpenNebula.VM.resource,false);
|
||||
},
|
||||
|
||||
@@ -488,7 +488,17 @@ var vm_actions = {
|
||||
hideDialog();
|
||||
$('div#vms_tab div.legend_div').slideToggle();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"VM.update_template" : { // Update template
|
||||
type: "single",
|
||||
call: OpenNebula.VM.update,
|
||||
callback: function(request,response){
|
||||
notifyMessage(tr("Template updated correctly"));
|
||||
Sunstone.runAction('VM.showinfo',request.request.data[0]);
|
||||
},
|
||||
error: onError
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -964,7 +974,7 @@ function updateVMInfo(request,vm){
|
||||
};
|
||||
|
||||
var info_tab = {
|
||||
title : tr("VM information"),
|
||||
title : tr("Information"),
|
||||
content:
|
||||
'<table id="info_vm_table" class="info_table">\
|
||||
<thead>\
|
||||
@@ -1007,22 +1017,12 @@ function updateVMInfo(request,vm){
|
||||
<td class="key_td">'+tr("Deploy ID")+'</td>\
|
||||
<td class="value_td">'+(typeof(vm_info.DEPLOY_ID) == "object" ? "-" : vm_info.DEPLOY_ID)+'</td>\
|
||||
</tr>\
|
||||
<tr><td class="key_td">Permissions</td><td></td></tr>\
|
||||
<tr>\
|
||||
<td class="key_td"> '+tr("Owner")+'</td>\
|
||||
<td class="value_td" style="font-family:monospace;">'+ownerPermStr(vm_info)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td"> '+tr("Group")+'</td>\
|
||||
<td class="value_td" style="font-family:monospace;">'+groupPermStr(vm_info)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td"> '+tr("Other")+'</td>\
|
||||
<td class="value_td" style="font-family:monospace;">'+otherPermStr(vm_info)+'</td>\
|
||||
</tr>\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<table id="vm_monitoring_table" class="info_table">\
|
||||
</tbody>\
|
||||
</table>' + insert_extended_template_table(vm_info.USER_TEMPLATE,
|
||||
"VM",
|
||||
vm_info.ID) +
|
||||
insert_permissions_table("VM",vm_info.ID) +
|
||||
'<table id="vm_monitoring_table" class="info_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">'+tr("Monitoring information")+'</th></tr>\
|
||||
</thead>\
|
||||
|
||||
Reference in new issue
Block a user