diff --git a/app/components/ng-justgage/ng-justgage.js b/app/components/ng-justgage/ng-justgage.js new file mode 100644 index 0000000..b6f6e3c --- /dev/null +++ b/app/components/ng-justgage/ng-justgage.js @@ -0,0 +1,45 @@ +angular.module("ngJustGage", []) + .directive('justGage', ['$timeout', function ($timeout) { + return { + restrict: 'EA', + scope: { + id: '@', + class: '@', + min: '=', + max: '=', + title: '@', + value: '=', + options: '=' + }, + template: '
', + link: function (scope,element,attrs) { + $timeout(function () { + var options = { + id: scope.id + '-justgage', + min: scope.min, + max: scope.max, + title: scope.title, + value: scope.value + } + if ( scope.options ) { + for (var key in scope.options) { + options[key]=scope.options[key]; + } + } + var graph = new JustGage(options); + + scope.$watch('max', function (updatedMax) { + if (updatedMax !== undefined) { + graph.refresh(scope.value, updatedMax); + } + }, true); + + scope.$watch('value', function (updatedValue) { + if (updatedValue !== undefined) { + graph.refresh(updatedValue); + } + }, true); + }); + } + }; + }]); diff --git a/app/index.html b/app/index.html index 2c73a4d..ea51d8d 100644 --- a/app/index.html +++ b/app/index.html @@ -21,17 +21,29 @@ - + + + - > - - - - - - + > + + + + + + + + + + + + + + + + diff --git a/app/tactical/current_health/current_health.html b/app/tactical/current_health/current_health.html new file mode 100644 index 0000000..433dfcb --- /dev/null +++ b/app/tactical/current_health/current_health.html @@ -0,0 +1,17 @@ +
+ + + + + + +
+ Current Health +
+
+ +
+
+ +
+
diff --git a/app/tactical/current_health/current_health.js b/app/tactical/current_health/current_health.js new file mode 100644 index 0000000..515bd1c --- /dev/null +++ b/app/tactical/current_health/current_health.js @@ -0,0 +1,18 @@ + +angular.module('adagios.tactical.current_health', ['ngRoute', + 'ngJustGage' + ]) +.controller('TacticalCurrentHealth', ['$scope', '$http', + function($scope, $http) { + $scope.hosts = 75.2; + $scope.services = 94.4; + }]) + +.directive('currenthealth', function() { + return { + restrict: 'E', + templateUrl: "tactical/current_health/current_health.html" + }; +}); + + diff --git a/app/tactical/status_overview/status_overview.html b/app/tactical/status_overview/status_overview.html new file mode 100644 index 0000000..11a7f2a --- /dev/null +++ b/app/tactical/status_overview/status_overview.html @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + +
+ Status overview + + # + + +
+ HOSTS + + {{ hosts.count }} + + {{ hosts.problems }} +
+ SERVICES + + {{ services.count }} + + {{ services.problems }} +
diff --git a/app/tactical/status_overview/status_overview.js b/app/tactical/status_overview/status_overview.js new file mode 100644 index 0000000..454836b --- /dev/null +++ b/app/tactical/status_overview/status_overview.js @@ -0,0 +1,19 @@ + +angular.module('adagios.tactical.status_overview', ['ngRoute' + ]) +.controller('TacticalStatusOverViewCtrl', ['$scope', '$http', + function($scope, $http) { + $scope.hosts = {"count": 104, + "problems": 14}; + $scope.services = {"count": 1126, + "problems": 42}; + }]) + +.directive('statusoverview', function() { + return { + restrict: 'E', + templateUrl: "tactical/status_overview/status_overview.html" + }; +}); + + diff --git a/app/tactical/tactical-controller.js b/app/tactical/tactical-controller.js deleted file mode 100644 index 2cb5624..0000000 --- a/app/tactical/tactical-controller.js +++ /dev/null @@ -1,17 +0,0 @@ - -tactical_app.controller('TacticalCtrl', ['$scope', '$http', - function($scope, $http) { - $scope.toto = "pl"; - -/* $http.get('/core/config').success(function(data) { - $scope.config = data; - }); - - - $scope.save = function(config) { - $http.post('/core/config', config).success(function(data) { - messageCenterService.add(data.state, data.message); - }); - } -*/ - }]); diff --git a/app/tactical/tactical.html b/app/tactical/tactical.html index 59fdb0c..1911f63 100644 --- a/app/tactical/tactical.html +++ b/app/tactical/tactical.html @@ -1,25 +1,19 @@ - - - - -

Tactical Overview

- {{ toto }}
- div ng-include src="'partials/pages/tactical/summary/status_overview.html'"/div +
- div ng-include src="'partials/pages/tactical/summary/current_health.html'"/div +
- div ng-include src="'partials/pages/tactical/summary/top_alert_producers.html'"/div +
diff --git a/app/tactical/tactical.js b/app/tactical/tactical.js index 12e84c5..337b600 100644 --- a/app/tactical/tactical.js +++ b/app/tactical/tactical.js @@ -1,29 +1,17 @@ -var tactical_app = angular.module('adagios.tactical', ['ngRoute' - ]); +angular.module('adagios.tactical', ['ngRoute', + 'adagios.tactical.status_overview', + 'adagios.tactical.current_health', + 'adagios.tactical.top_alert_producers' + ]) -tactical_app.config(['$routeProvider', function($routeProvider) { - }]); - - -tactical_app.config(['$routeProvider', function($routeProvider) { +.config(['$routeProvider', function($routeProvider) { $routeProvider.when('/tactical', {templateUrl: 'tactical/tactical.html', controller: 'TacticalCtrl'}); -}]); +}]) -tactical_app.controller('TacticalCtrl', ['$scope', '$http', + + +.controller('TacticalCtrl', ['$scope', '$http', function($scope, $http) { - $scope.toto = "pl"; - -/* $http.get('/core/config').success(function(data) { - $scope.config = data; - }); - - - $scope.save = function(config) { - $http.post('/core/config', config).success(function(data) { - messageCenterService.add(data.state, data.message); - }); - } -*/ - }]); + }]) diff --git a/app/tactical/top_alert_producers/top_alert_producers.html b/app/tactical/top_alert_producers/top_alert_producers.html new file mode 100644 index 0000000..ba7125a --- /dev/null +++ b/app/tactical/top_alert_producers/top_alert_producers.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + +
+ Top Alert Producers + + +
+ {{ host.host_name }} + + {{ host.problems }} +
diff --git a/app/tactical/top_alert_producers/top_alert_producers.js b/app/tactical/top_alert_producers/top_alert_producers.js new file mode 100644 index 0000000..f4205f5 --- /dev/null +++ b/app/tactical/top_alert_producers/top_alert_producers.js @@ -0,0 +1,17 @@ + +angular.module('adagios.tactical.top_alert_producers', ['ngRoute' + ]) +.controller('TacticalTopAlertProducers', ['$scope', '$http', + function($scope, $http) { + $scope.hosts = [{"host_name": "server-01", "problems": 10}, + {"host_name": "server-02", "problems": 5},] + }]) + +.directive('topalertproducers', function() { + return { + restrict: 'E', + templateUrl: "tactical/top_alert_producers/top_alert_producers.html" + }; +}); + + diff --git a/app/view1/view1.html b/app/view1/view1.html deleted file mode 100644 index 89459a6..0000000 --- a/app/view1/view1.html +++ /dev/null @@ -1 +0,0 @@ -

This is the partial for view 1.

diff --git a/app/view1/view1.js b/app/view1/view1.js deleted file mode 100644 index 4ce0b4f..0000000 --- a/app/view1/view1.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -angular.module('myApp.view1', ['ngRoute']) - -.config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/view1', { - templateUrl: 'view1/view1.html', - controller: 'View1Ctrl' - }); -}]) - -.controller('View1Ctrl', [function() { - -}]); \ No newline at end of file diff --git a/app/view1/view1_test.js b/app/view1/view1_test.js deleted file mode 100644 index 14ba79b..0000000 --- a/app/view1/view1_test.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -describe('myApp.view1 module', function() { - - beforeEach(module('myApp.view1')); - - describe('view1 controller', function(){ - - it('should ....', inject(function($controller) { - //spec body - var view1Ctrl = $controller('View1Ctrl'); - expect(view1Ctrl).toBeDefined(); - })); - - }); -}); \ No newline at end of file diff --git a/app/view2/view2.html b/app/view2/view2.html deleted file mode 100644 index b6503ee..0000000 --- a/app/view2/view2.html +++ /dev/null @@ -1,5 +0,0 @@ -

This is the partial for view 2.

-

- Showing of 'interpolate' filter: - {{ 'Current version is v%VERSION%.' | interpolate }} -

diff --git a/app/view2/view2.js b/app/view2/view2.js deleted file mode 100644 index a0ff97d..0000000 --- a/app/view2/view2.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -angular.module('myApp.view2', ['ngRoute']) - -.config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/view2', { - templateUrl: 'view2/view2.html', - controller: 'View2Ctrl' - }); -}]) - -.controller('View2Ctrl', [function() { - -}]); \ No newline at end of file diff --git a/app/view2/view2_test.js b/app/view2/view2_test.js deleted file mode 100644 index 07b34d6..0000000 --- a/app/view2/view2_test.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -describe('myApp.view2 module', function() { - - beforeEach(module('myApp.view2')); - - describe('view2 controller', function(){ - - it('should ....', inject(function($controller) { - //spec body - var view2Ctrl = $controller('View2Ctrl'); - expect(view2Ctrl).toBeDefined(); - })); - - }); -}); \ No newline at end of file diff --git a/bower.json b/bower.json index ba32dac..c0ca983 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,7 @@ "angular-mocks": "~1.2.x", "html5-boilerplate": "~4.3.0", "bootstrap-sass-official": "3.3.1", - "fontawesome": "4.2.0" + "fontawesome": "4.2.0", + "justgage-toorshia" : "master" } }