diff --git a/Gruntfile.js b/Gruntfile.js index 11382e8..158734d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -91,7 +91,7 @@ module.exports = function (grunt) { '<%= project.app %>/components/config/config.js', '<%= project.app %>/components/live/live.js', '<%= project.app %>/components/live/notifications.js', - '<%= project.app %>/components/live/get_services.js', + '<%= project.app %>/components/live/get_objects.js', '<%= project.app %>/components/ng-justgage/ng-justgage.js', '<%= project.app %>/components/filters/filters.js', '<%= project.app %>/components/sidebar/sidebar.js', @@ -125,7 +125,7 @@ module.exports = function (grunt) { '<%= project.build %>/components/config/config.js': '<%= project.app %>/components/config/config.js', '<%= project.build %>/components/live/live.js': '<%= project.app %>/components/live/live.js', '<%= project.build %>/components/live/notifications.js': '<%= project.app %>/components/live/notifications.js', - '<%= project.build %>/components/live/get_services.js': '<%= project.app %>/components/live/get_services.js', + '<%= project.build %>/components/live/get_objects.js': '<%= project.app %>/components/live/get_objects.js', '<%= project.build %>/components/ng-justgage/ng-justgage.js': '<%= project.app %>/components/ng-justgage/ng-justgage.js', '<%= project.build %>/components/filters/filters.js': '<%= project.app %>/components/filters/filters.js', '<%= project.build %>/components/sidebar/sidebar.js': '<%= project.app %>/components/sidebar/sidebar.js', @@ -153,7 +153,7 @@ module.exports = function (grunt) { '<%= project.build %>/components/config/config.js', '<%= project.build %>/components/live/live.js', '<%= project.build %>/components/live/notifications.js', - '<%= project.build %>/components/live/get_services.js', + '<%= project.build %>/components/live/get_objects.js', '<%= project.build %>/components/ng-justgage/ng-justgage.js', '<%= project.build %>/components/filters/filters.js', '<%= project.build %>/components/sidebar/sidebar.js', diff --git a/app/components/live/get_services.js b/app/components/live/get_objects.js similarity index 97% rename from app/components/live/get_services.js rename to app/components/live/get_objects.js index 2a1558c..421f5c5 100644 --- a/app/components/live/get_services.js +++ b/app/components/live/get_objects.js @@ -12,7 +12,7 @@ angular.module('adagios.live') regex: '__regex' }) - .service('getServices', ['$http', 'filterSuffixes', + .service('getObjects', ['$http', 'filterSuffixes', function ($http, filterSuffixes) { return function (columns, filters, apiName, additionnalFields) { var filtersQuery = '', @@ -48,7 +48,7 @@ angular.module('adagios.live') return $http.get('/rest/status/json/' + apiName + '/?fields=' + columns + filtersQuery + additionnalQuery) .error(function () { - throw new Error('getServices : GET Request failed'); + throw new Error('getObjects : GET Request failed'); }); }; }]) diff --git a/app/components/live/get_services_test.js b/app/components/live/get_objects_test.js similarity index 88% rename from app/components/live/get_services_test.js rename to app/components/live/get_objects_test.js index fefb0be..ec54e8f 100644 --- a/app/components/live/get_services_test.js +++ b/app/components/live/get_objects_test.js @@ -9,15 +9,15 @@ describe('In Adagios Live', function () { $httpBackend = _$httpBackend_; })); - describe('getServices', function () { + describe('getObjects', function () { - it('should send the proper GET request', inject(function (getServices) { + it('should send the proper GET request', inject(function (getObjects) { var fields = ['host_name', 'host_state', 'description'], filters = { contains: { host_name: ['srv', 'a'], plugin_output: ['SWAP'] }, startswith: { host_name: ['srv'] } }, apiName = 'services'; - getServices(fields, filters, apiName); + getObjects(fields, filters, apiName); $httpBackend.expectGET('/rest/status/json/services/?fields=host_name,host_state,description&host_name__contains=srv&host_name__contains=a&plugin_output__contains=SWAP&host_name__startswith=srv').respond(''); $httpBackend.flush(); })); diff --git a/app/components/table/table.js b/app/components/table/table.js index 05b3cc9..759c173 100644 --- a/app/components/table/table.js +++ b/app/components/table/table.js @@ -18,8 +18,8 @@ angular.module('adagios.table', ['adagios.live', .value('ajaxQueries', []) - .controller('TableCtrl', ['$scope', '$interval', 'getServices', 'tablesConfig', 'actionbarFilters', 'ajaxQueries', 'tableGlobalConfig', - function ($scope, $interval, getServices, tablesConfig, actionbarFilters, ajaxQueries, tableGlobalConfig) { + .controller('TableCtrl', ['$scope', '$interval', 'getObjects', 'tablesConfig', 'actionbarFilters', 'ajaxQueries', 'tableGlobalConfig', + function ($scope, $interval, getObjects, tablesConfig, actionbarFilters, ajaxQueries, tableGlobalConfig) { var requestFields = [], conf = tablesConfig[tableGlobalConfig.nextTableIndex], getData, @@ -40,7 +40,7 @@ angular.module('adagios.table', ['adagios.live', }); getData = function (requestFields, filters, apiName, additionnalFields) { - getServices(requestFields, filters, apiName, additionnalFields) + getObjects(requestFields, filters, apiName, additionnalFields) .success(function (data) { $scope.entries = data; }); @@ -117,7 +117,6 @@ angular.module('adagios.table', ['adagios.live', }]) .directive('adgCell', ['$http', '$compile', function ($http, $compile) { - return { restrict: 'A', compile: function () { @@ -188,7 +187,6 @@ angular.module('adagios.table', ['adagios.live', input[i - 1].has_child = 1; input[i - 1].child_class = class_name[0]; entry.child_class = class_name[1]; - parent_found = true; } else { entry.is_child = 1; @@ -227,4 +225,4 @@ angular.module('adagios.table', ['adagios.live', return newItems; }; - }]); + });