Fixed ceilometer bug and added busnag for angular
diff --git a/views/ngXosViews/ceilometerDashboard/src/js/main.js b/views/ngXosViews/ceilometerDashboard/src/js/main.js
index aeb8243..7d97a9a 100644
--- a/views/ngXosViews/ceilometerDashboard/src/js/main.js
+++ b/views/ngXosViews/ceilometerDashboard/src/js/main.js
@@ -31,7 +31,7 @@
$rootScope.stateName = toState.name;
})
})
-.service('Ceilometer', function($http, $q, lodash){
+.service('Ceilometer', function($http, $q){
this.getMappings = () => {
let deferred = $q.defer();
@@ -161,15 +161,17 @@
// visualization info
this.loader = true;
- this.selectedSlice = slice.slice;
- this.selectedTenant = slice.project_id;
-
- // store the status
- Ceilometer.selectedSlice = slice;
- Ceilometer.selectedService = service_name;
+ this.error = null;
+ this.ceilometerError = null;
Ceilometer.getMeters({tenant: slice.project_id})
.then((sliceMeters) => {
+ this.selectedSlice = slice.slice;
+ this.selectedTenant = slice.project_id;
+
+ // store the status
+ Ceilometer.selectedSlice = slice;
+ Ceilometer.selectedService = service_name;
this.selectedResources = lodash.groupBy(sliceMeters, 'resource_name');
// hacky
@@ -178,6 +180,12 @@
}
})
.catch(err => {
+
+ // this means that ceilometer is not yet ready
+ if(err.status === 503){
+ return this.ceilometerError = err.data.detail.specific_error;
+ }
+
this.error = (err.data && err.data.detail) ? err.data.detail : 'An Error occurred. Please try again later.';
})
.finally(() => {
diff --git a/views/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html b/views/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
index 23afc1a..fe7720c 100644
--- a/views/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
+++ b/views/ngXosViews/ceilometerDashboard/src/templates/ceilometer-dashboard.tpl.html
@@ -59,6 +59,9 @@
</article>
<!-- METERS -->
<article ng-hide="vm.showStats" class="meters animate-slide-left">
+ <div class="alert alert-danger" ng-show="vm.ceilometerError">
+ {{vm.ceilometerError}}
+ </div>
<div class="col-sm-4 animate-slide-left" ng-hide="!vm.selectedSlice">
<div class="list-group">
<div class="list-group-item">