| angular.module('xos.serviceGrid', [ |
| .config(($stateProvider) => { |
| template: '<service-grid></service-grid>' |
| template: '<service-graph></service-graph>' |
| .config(function($httpProvider){ |
| $httpProvider.interceptors.push('NoHyperlinks'); |
| .directive('serviceGrid', function(){ |
| templateUrl: 'templates/service-grid.tpl.html', |
| controller: function(Services, _){ |
| let status = parseInt(item.backend_status.match(/^[0-9]/)[0]); |
| link: item => `${item.view_url.replace(/\$[a-z]+\$/, item.id)}` |
| Services.query().$promise |
| this.services = _.map(services, s => { |
| // parse backend_status string in a boolean for display |
| // NOTE they are not boolean: |
| // - start with 0 = provisioning |
| // - start with 2 = error |
| s.status = parseInt(s.backend_status.match(/^[0-9]/)[0]) === 0 ? false : true; |