metrics: add view metrics button across resources

resouces: zones, clusters, hosts, primary storage, vms and volumes

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-09-15 14:35:07 +05:30
parent b8b28568ae
commit 5a1662500f
5 changed files with 114 additions and 3 deletions

View File

@ -12420,6 +12420,14 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
background-position: 0px -707px;
}
.viewMetrics .icon {
background-position: -40px -32px;
}
.viewMetrics:hover .icon {
background-position: -40px -32px;
}
.attach .icon,
.attachISO .icon,
.attachDisk .icon,

View File

@ -288,7 +288,20 @@
poll: pollAsyncJobResult
}
},
snapshot: vmSnapshotAction({ listView: true })
snapshot: vmSnapshotAction({ listView: true }),
viewMetrics: {
label: 'label.view.metrics',
isHeader: true,
addRow: false,
action: {
custom: cloudStack.uiCustom.metricsView({resource: 'vms'})
},
messages: {
notification: function (args) {
return 'label.view.metrics';
}
}
},
},
dataProvider: function(args) {

View File

@ -253,6 +253,20 @@
}
},
viewMetrics: {
label: 'label.view.metrics',
isHeader: true,
addRow: false,
action: {
custom: cloudStack.uiCustom.metricsView({resource: 'volumes'})
},
messages: {
notification: function (args) {
return 'label.view.metrics';
}
}
},
uploadVolume: {
isHeader: true,
label: 'label.upload.volume',

View File

@ -7711,8 +7711,7 @@
isHeader: true,
addRow: false,
action: {
custom: cloudStack.uiCustom.zoneWizard(
cloudStack.zoneWizard)
custom: cloudStack.uiCustom.metricsView({resource: 'zones'})
},
messages: {
notification: function (args) {
@ -14385,6 +14384,19 @@
}
});
}
},
viewMetrics: {
label: 'label.view.metrics',
isHeader: true,
addRow: false,
action: {
custom: cloudStack.uiCustom.metricsView({resource: 'clusters'})
},
messages: {
notification: function (args) {
return 'label.view.metrics';
}
}
}
},
@ -15622,6 +15634,19 @@
return 'label.add.host';
}
}
},
viewMetrics: {
label: 'label.view.metrics',
isHeader: true,
addRow: false,
action: {
custom: cloudStack.uiCustom.metricsView({resource: 'hosts'})
},
messages: {
notification: function (args) {
return 'label.view.metrics';
}
}
}
},
detailView: {
@ -17428,6 +17453,19 @@
return 'label.add.primary.storage';
}
}
},
viewMetrics: {
label: 'label.view.metrics',
isHeader: true,
addRow: false,
action: {
custom: cloudStack.uiCustom.metricsView({resource: 'primarystorage'})
},
messages: {
notification: function (args) {
return 'label.view.metrics';
}
}
}
},

View File

@ -0,0 +1,38 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
(function($, cloudStack) {
cloudStack.uiCustom.metricsView = function(args) {
return function() {
// TODO: implement switch/case to select metrics view: zone, cluster, host etc.
var metricsListView = cloudStack.sections.metrics.listView;
var $browser = $('#browser .container');
return $browser.cloudBrowser('addPanel', {
title: 'Metrics',
maximizeIfSelected: true,
complete: function($newPanel) {
$newPanel.listView({
$browser: $browser,
context: cloudStack.context,
listView: metricsListView
});
}
});
};
};
})(jQuery, cloudStack);