Reversing Service list
diff --git a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js
index 4de3d7c..2623ba3 100644
--- a/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js
+++ b/xos/core/xoslib/ngXosViews/ceilometerDashboard/src/js/main.js
@@ -100,6 +100,7 @@
.then(meters => {
//group project by service
this.projects = lodash.groupBy(meters, 'service');
+ console.log(this.project);
lodash.forEach(Object.keys(this.projects), (project) => {
// inside each service group by slice
this.projects[project] = lodash.groupBy(this.projects[project], 'slice');
@@ -332,4 +333,19 @@
$scope.$watch(() => this.name, () => {this.getStats();});
}
}
-});
\ No newline at end of file
+})
+.filter('orderObjectByKey', function(lodash) {
+ return function(items, reverse) {
+
+ if(!items){
+ return;
+ }
+
+ return lodash.reduce(Object.keys(items).reverse(), (list, key) => {
+ list[key] = items[key];
+ return list;
+ }, {});
+
+ };
+});
+;
\ No newline at end of file
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 73fed91..fec157f 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
@@ -34,7 +34,7 @@
<h3>XOS Service: </h3>
<uib-accordion close-others="true" template-url="templates/accordion.html">
<uib-accordion-group
- ng-repeat="(service, slices) in vm.projects"
+ ng-repeat="(service, slices) in vm.projects | orderObjectByKey:true"
template-url="templates/accordion-group.html"
heading="{{service}}">
<h4>Slices:</h4>