mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
Solved bug in disk_resize
This commit is contained in:
1 parent
904edd62cc
commit
e3c0041ccb
3 files changed
+17
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user