Grouping samples by resource id
diff --git a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js
index c2daf7f..ab302e0 100644
--- a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js
+++ b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js
@@ -42,13 +42,19 @@
})
})
.service('Ceilometer', function($http, $q){
+
+ this.sliceDetails = {};
+
+ this.formatSliceDetails = (meters) => {
+
+ };
+
this.getMeters = () => {
let deferred = $q.defer();
// $http.get('/xoslib/meters/', {cache: true})
$http.get('../meters_mock.json', {cache: true})
.then((res) => {
- console.log(res.data);
deferred.resolve(res.data)
})
.catch((e) => {
@@ -145,6 +151,16 @@
templateUrl: 'templates/ceilometer-samples.tpl.html',
controller: function(Ceilometer) {
+ Chart.defaults.global.colours = [
+ '#286090',
+ '#F7464A',
+ '#46BFBD',
+ '#FDB45C',
+ '#97BBCD',
+ '#4D5360',
+ '#8c4f9f'
+ ];
+
this.chartType = 'line';
if($stateParams.name && $stateParams.tenant){
@@ -197,7 +213,9 @@
// Ceilometer.getSamples(this.name, this.tenant) //fetch one
Ceilometer.getSamples(this.name) //fetch all
.then(res => {
- this.samplesList = lodash.groupBy(res, 'project_id');
+ console.log(res);
+ this.samplesList = lodash.groupBy(res, 'resource_id');
+ console.log(this.samplesList);
res = lodash.sortBy(this.samplesList[this.tenant], 'timestamp');
this.chart = {
series: [this.tenant],
diff --git a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
index 5f8fb1a..2227659 100644
--- a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
+++ b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
@@ -55,7 +55,7 @@
{{meter.unit}}
</div>
<div class="col-xs-4">
- <a ui-sref="samples({name: meter.name, tenant: meter.project_id})" class="btn btn-primary">
+ <a ui-sref="samples({name: meter.name, tenant: meter.resource_id})" class="btn btn-primary">
<i class="glyphicon glyphicon-search"></i>
</a>
</div>
diff --git a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html
index b8c5f39..8f1578d 100644
--- a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html
+++ b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/templates/ceilometer-samples.tpl.html
@@ -11,7 +11,7 @@
</div>
</div>
-<div class="row">
+<div class="row" ng-if="!vm.loader">
<form class="form-inline col-xs-8" ng-submit="vm.addMeterToChart(vm.addMeterValue)">
<select ng-model="vm.addMeterValue" class="form-control" ng-options="project as project for (project, meter) in vm.samplesList"></select>
<button class="btn btn-success">
@@ -30,7 +30,7 @@
</div>
<div class="col-xs-12" ng-if="!vm.loader">
- <canvas ng-if="vm.chartType === 'line'" id="line" class="chart chart-line" chart-data="vm.chart.data"
+ <canvas ng-if="vm.chartType === 'line'" id="line" class="chart chart-line" chart-data="vm.chart.data" chart-options="{datasetFill: false}"
chart-labels="vm.chart.labels" chart-legend="true" chart-series="vm.chart.series">
</canvas>
<canvas ng-if="vm.chartType === 'bar'" id="bar" class="chart chart-bar" chart-data="vm.chart.data"