diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 7a8b6428d6..8d88d28684 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -193,6 +193,16 @@ var vm_actions = { error: onError }, + "VM.showdisks" : { + type: "single", + call: OpenNebula.VM.show, + callback: function(request, vm){ + updateVMachineElement(request, vm); + updateVMDisksInfo(request, vm); + }, + error: onError + }, + "VM.refresh" : { type: "custom", call : function (){ @@ -328,7 +338,9 @@ var vm_actions = { "VM.saveas" : { type: "single", call: OpenNebula.VM.saveas, - callback: vmShow, + callback: function(request) { + Sunstone.runAction("VM.showdisks", request.request.data[0]); + }, error:onError, notify: true }, @@ -523,17 +535,18 @@ var vm_actions = { "VM.attachdisk" : { type: "single", call: OpenNebula.VM.attachdisk, - callback: vmShow, + callback: function(request) { + Sunstone.runAction("VM.showdisks", request.request.data[0]); + }, error: onError, notify: true }, "VM.detachdisk" : { type: "single", call: OpenNebula.VM.detachdisk, - //callback: function(req,res){ - // setTimeout(vmShow,1000,req); - //}, - callback: vmShow, + callback: function(request) { + Sunstone.runAction("VM.showdisks", request.request.data[0]); + }, error: onError, notify: true }, @@ -1351,38 +1364,43 @@ function updateVMInfo(request,vm){ setPermissionsTable(vm_info,''); } +function updateVMDisksInfo(request,vm){ + $("li#vm_hotplugging_tabTab").html(printDisks(vm.VM)); +} + // Generates the HTML for the hotplugging tab // This is a list of disks with the save_as, detach options. // And a form to attach a new disk to the VM, if it is running. function printDisks(vm_info){ - //var im_sel = makeSelectOptions(dataTable_images, - // 1, //id col - trick -> reference by name! - // 4, //name col - // [10,10,10], - // [tr("DISABLED"),tr("LOCKED"),tr("ERROR")] - // ); var html ='\ -