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

Solved bug in disk_resize

This commit is contained in:
abelCoronado93 2017-06-27 12:07:43 +02:00 committed by Tino Vázquez
parent 904edd62cc
commit e3c0041ccb
3 changed files with 17 additions and 1 deletions

View File

@ -76,6 +76,7 @@ module OpenNebulaJSON
when "unresched" then self.unresched
when "recover" then self.recover(action_hash['params'])
when "save_as_template" then self.save_as_template(action_hash['params'])
when "disk_resize" then self.disk_resize(action_hash['params'])
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -112,6 +113,10 @@ module OpenNebulaJSON
params['type'], params['snapshot_id'].to_i)
end
def disk_resize(params=Hash.new)
super(params['disk_id'].to_i, params['new_size'])
end
def snapshot_create(params=Hash.new)
super(params['snapshot_name'])
end

View File

@ -47,7 +47,7 @@ class SunstoneServer < CloudServer
when "host" then HostPoolJSON.new(client)
when "image" then ImagePoolJSON.new(client, user_flag)
when "vmtemplate" then TemplatePoolJSON.new(client, user_flag)
when "vm_group" then VMGroupPoolJSON.new(client, user_flag)
when "vm_group" then VMGroupPoolJSON.new(client, user_flag)
when "vm" then VirtualMachinePoolJSON.new(client, user_flag)
when "vnet" then VirtualNetworkPoolJSON.new(client, user_flag)
when "user" then UserPoolJSON.new(client)

View File

@ -92,21 +92,32 @@ define(function(require) {
$( ".uinput-slider", context).on("input", function(){
$( ".uinput-slider-val",context).val(Humanize.size($( ".uinput-slider",context).val()));
var cost = Humanize.sizeToMB($( ".uinput-slider",context).val())*that.diskCost;
if(isNaN(cost)){
cost = 0;
}
document.getElementById("new_cost_resize").textContent = Locale.tr("Cost")+": "+ convertCostNumber(cost);
});
$( ".uinput-slider-val", context).on("change", function(){
$( ".uinput-slider",context).val(Humanize.sizeToMB($( ".uinput-slider-val",context).val()));
var cost = Humanize.sizeToMB($( ".uinput-slider",context).val())*that.diskCost;
if(isNaN(cost)){
cost = 0;
}
document.getElementById("new_cost_resize").textContent = Locale.tr("Cost")+": "+ convertCostNumber(cost);
});
var cost = Humanize.sizeToMB($( ".uinput-slider",context).val())*this.diskCost;
if(isNaN(cost)){
cost = 0;
}
document.getElementById("new_cost_resize").textContent = Locale.tr("Cost")+": "+ convertCostNumber(cost);
$('#' + DIALOG_ID + 'Form', context).submit(function() {
var new_size = $( ".uinput-slider",context).val();
new_size = Math.round(parseInt(new_size) / 1024);
new_size = new_size.toString();
var obj = {
"vm_id": that.element.ID,
"disk_id" : that.diskId,