Renamed getServices provider to getObjects
This commit is contained in:
parent
a1ed18d4d6
commit
82388a9c81
@ -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',
|
||||
|
@ -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');
|
||||
});
|
||||
};
|
||||
}])
|
@ -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();
|
||||
}));
|
@ -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;
|
||||
};
|
||||
}]);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user