From 3ebb80dcb799bd3ff671641eadb3005ea7e2522b Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Wed, 6 Jun 2012 22:42:55 +0530 Subject: [PATCH] CS-14395: Instances tab need to introduce Volumes tab to see which volumes vm has --- ui/scripts/instances.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index edb732eaa55..c51f88977a3 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -803,6 +803,7 @@ detailView: { name: 'Instance details', + isMaximized: true, viewAll: { path: 'storage.volumes', label: 'label.volumes' }, tabFilter: function(args) { var hiddenTabs = []; @@ -1735,8 +1736,46 @@ } }); } + }, + + volume: { + title: 'label.volumes', + multiple: true, + fields:{ + id: { label: 'ID' }, + state: { label: 'label.state' }, + type: { label: 'label.type' }, + storagetype: { label: 'label.storage.type' }, + size: { + label: 'label.size', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + deviceid: { label: 'label.device.id' }, + storage: { label: 'label.storage' }, + created: { label: 'label.created' } + }, + dataProvider: function(args) { + $.ajax({ + url: createURL("listVolumes&listAll=true"), + data: { virtualmachineid: args.context.instances[0].id }, + dataType: "json", + async: true, + success: function(json) { + var jsonObj = json.listvolumesresponse.volume; + args.response.success({ + data: jsonObj + }); + } + }); } } + + } } } };