diff --git a/app/components/live/get_services.js b/app/components/live/get_services.js index 30ec8c9..5167005 100644 --- a/app/components/live/get_services.js +++ b/app/components/live/get_services.js @@ -1,16 +1,13 @@ 'use strict'; -angular.module('adagios.live.getservices', []) +angular.module('adagios.live') - .factory('GetServices', ['$http', function ($http) { - alert('Salut'); - $http.post("/rest/status/json/services/"). - success(function(data, status, headers, config) { - alert(data); - }). - error(function(data, status, headers, config) { - alert('Request error'); - }); + .factory('GetServices', ['$http', function ($http, columns) { - return data; + return function (columns) { + return $http.get('/rest/status/json/services/?fields=' + columns) + .error(function (data, status, headers, config) { + console.error('GetServices : GET Request failed'); + }); + }; }]); diff --git a/app/components/live/live.js b/app/components/live/live.js new file mode 100644 index 0000000..0d89ba8 --- /dev/null +++ b/app/components/live/live.js @@ -0,0 +1,3 @@ +'use strict'; + +angular.module('adagios.live', []); diff --git a/app/components/live/notifications.js b/app/components/live/notifications.js index 726bb2f..c309b81 100644 --- a/app/components/live/notifications.js +++ b/app/components/live/notifications.js @@ -1,19 +1,9 @@ 'use strict'; -angular.module('adagios.live', []) +angular.module('adagios.live') .factory('GetProblems', ['$http', function ($http) { var problem_number = 44; return problem_number; - }]) - - .factory('GetServices', ['$http', function ($http) { - $http.post("/rest/status/json/services", "host_name") - .success(function(data, status, headers, config) { - return data; - }) - .error(function(data, status, headers, config) { - alert('request error'); - }); }]); diff --git a/app/index.html b/app/index.html index da24778..a98f40d 100644 --- a/app/index.html +++ b/app/index.html @@ -22,7 +22,9 @@ + + > diff --git a/app/table/entry/entry.js b/app/table/entry/entry.js index 158bf65..34212c2 100644 --- a/app/table/entry/entry.js +++ b/app/table/entry/entry.js @@ -7,7 +7,7 @@ angular.module('adagios.table.entry', ['adagios.table.entry.column_duration', ]) .controller('EntryCtrl', ['$scope', '$http', function ($scope, $http) { - noop; + return; }]) .directive('entry', function () { diff --git a/app/table/table.html b/app/table/table.html index 1b3b0ac..fbe4e3a 100644 --- a/app/table/table.html +++ b/app/table/table.html @@ -1,15 +1,15 @@
- +
- {{key}} + {{key}}
- {{value}} + {{value}}
diff --git a/app/table/table.js b/app/table/table.js index a6307d8..4869994 100644 --- a/app/table/table.js +++ b/app/table/table.js @@ -3,14 +3,15 @@ angular.module('adagios.table', ['ngRoute', 'adagios.table.entry', 'adagios.live']) .controller('TableCtrl', ['$scope', '$http', 'GetServices', function ($scope, $http, GetServices) { - $scope.entries = GetServices; - + console.log(new GetServices(['host_name', 'last_check']) + .success(function (data) { + $scope.entries = data; + })); }]) - .directive('servicetable', function () { + .directive('servicesTable', function () { return { restrict: 'E', templateUrl: "table/table.html" }; }); - diff --git a/app/tactical/tactical.html b/app/tactical/tactical.html index 28ab55f..85a6890 100644 --- a/app/tactical/tactical.html +++ b/app/tactical/tactical.html @@ -19,6 +19,6 @@
- + diff --git a/karma.conf.js b/karma.conf.js index df0fac5..5a1a57f 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -9,10 +9,12 @@ module.exports = function (config) { 'app/bower_components/angular/angular.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-mocks/angular-mocks.js', + 'app/components/live/live.js', 'app/components/**/*.js', - 'app/navbar/**/*.js', + 'app/topbar/**/*.js', 'app/sidebar/**/*.js', - 'app/tactical/**/*.js' + 'app/tactical/**/*.js', + 'app/table/**/*.js' ], autoWatch : true,