diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index 56fce9d983..f4f0c17ab5 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -612,6 +612,7 @@ define(function(require) { "retrieveExternalIPs": retrieveExternalIPs, "retrieveExternalNetworkAttrs": retrieveExternalNetworkAttrs, "isNICGraphsSupported": isNICGraphsSupported, + "isDiskGraphsSupported": isDiskGraphsSupported, "isNICAttachSupported": isNICAttachSupported, "isVNCSupported": isVNCSupported, "isSPICESupported": isSPICESupported, @@ -643,6 +644,15 @@ define(function(require) { } } + function isDiskGraphsSupported(element) { + var history = retrieveLastHistoryRecord(element) + if (history) { + return $.inArray(history.VM_MAD, ['ec2','az']) == -1; + } else { + return false; + } + } + function isNICAttachSupported(element) { var history = retrieveLastHistoryRecord(element) if (history) { diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/storage.js b/src/sunstone/public/app/tabs/vms-tab/panels/storage.js index b4bfdf4078..12d3c1289e 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/storage.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/storage.js @@ -29,6 +29,8 @@ define(function(require) { var TemplateHtml = require('hbs!./storage/html'); var DiskDetailsHtml = require('hbs!./storage/disk-details'); var Navigation = require('utils/navigation'); + var Notifier = require('utils/notifier'); + var Graphs = require('utils/graphs'); /* CONSTANTS @@ -62,6 +64,7 @@ define(function(require) { Panel.prototype.setup = _setup; Panel.prototype.getState = _getState; Panel.prototype.setState = _setState; + Panel.prototype.onShow = _onShow; return Panel; @@ -76,10 +79,82 @@ define(function(require) { diskCost = Config.onedConf.DEFAULT_COST.DISK_COST; } - return TemplateHtml({ + var html = TemplateHtml({ element: this.element, diskCost: diskCost }); + // Do not show statistics for not hypervisors that do not gather net data + //if (OpenNebulaVM.isNICGraphsSupported(that.element)) { + html += '\ +