diff --git a/app/app.js b/app/app.js index 18385ef..7b1754e 100644 --- a/app/app.js +++ b/app/app.js @@ -18,8 +18,6 @@ angular.module('bansho', [ 'bansho.drupal.info', 'bansho.view', 'bansho.view.page', - 'bansho.view.host', - 'bansho.view.service', 'bansho.view.config', 'bansho.view.drupalDashboard', 'bansho.view.drupal', diff --git a/app/components/config/defaultLayoutConfig.json b/app/components/config/defaultLayoutConfig.json index 8bd9b2a..5456b6c 100644 --- a/app/components/config/defaultLayoutConfig.json +++ b/app/components/config/defaultLayoutConfig.json @@ -614,7 +614,7 @@ ] }, "host": { - "template": "host", + "template": "page", "components": [ { "type": "panel", @@ -657,7 +657,7 @@ ] }, "service": { - "template": "service", + "template": "page", "components": [ { "type": "panel", diff --git a/app/components/directive/host/host.js b/app/components/directive/host/host.js index 48ed30f..04a2c66 100644 --- a/app/components/directive/host/host.js +++ b/app/components/directive/host/host.js @@ -11,7 +11,7 @@ angular.module('bansho.host', ['bansho.datasource']) templateUrl: 'components/directive/host/host.html', controller: ['$scope', 'templateManager', 'surveilStatus', 'surveilConfig', 'iframeUrl', function ($scope, templateManager, surveilStatus, surveilConfig, iframeUrl) { - var hostname = templateManager.getPageParam('hostname'); + var hostname = templateManager.getPageParam('host_name'); $scope.param = { host: {}, diff --git a/app/components/directive/host/host_services_list/host_services_list.html b/app/components/directive/host/host_services_list/host_services_list.html index a6a8079..204670f 100644 --- a/app/components/directive/host/host_services_list/host_services_list.html +++ b/app/components/directive/host/host_services_list/host_services_list.html @@ -10,7 +10,7 @@ - {{service.service_service_description}} + {{service.service_service_description}} {{service.service_acknowledged ? "Yes" : "No"}} {{service.service_state}} diff --git a/app/components/directive/hostTree/hostTree.html b/app/components/directive/hostTree/hostTree.html index 08d920d..671cc77 100644 --- a/app/components/directive/hostTree/hostTree.html +++ b/app/components/directive/hostTree/hostTree.html @@ -8,7 +8,7 @@
- + {{service.service_service_description}} 2 days, 8 hours diff --git a/app/components/directive/table/cell_status_service_check/cell_status_service_check.html b/app/components/directive/table/cell_status_service_check/cell_status_service_check.html index 75a3abf..9b2c225 100644 --- a/app/components/directive/table/cell_status_service_check/cell_status_service_check.html +++ b/app/components/directive/table/cell_status_service_check/cell_status_service_check.html @@ -1,7 +1,7 @@
- {{entry.service_service_description}} + {{entry.service_service_description}}
{{entry.service_plugin_output}}
diff --git a/app/index.html b/app/index.html index 7f0d384..2cdd393 100644 --- a/app/index.html +++ b/app/index.html @@ -124,9 +124,7 @@ - - diff --git a/app/templates/host/host.html b/app/templates/host/host.html deleted file mode 100644 index 6bbe203..0000000 --- a/app/templates/host/host.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/app/templates/host/host.js b/app/templates/host/host.js deleted file mode 100644 index 69b3305..0000000 --- a/app/templates/host/host.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -angular.module('bansho.view.host', ['bansho.datasource']) - - .controller('HostViewCtrl', ['$scope', '$routeParams', 'configManager', 'templateManager', - function ($scope, $routeParams, configManager, templateManager) { - var hostname = $routeParams.host_name; - - $scope.components = configManager.getConfigData($scope.viewName).components; - if (!hostname) { - throw new Error("ERROR :'host_name' GET parameter must be set"); - } else { - templateManager.setPageParam('hostname', hostname); - } - }]); diff --git a/app/templates/page/page.js b/app/templates/page/page.js index a7db2b2..4c20211 100644 --- a/app/templates/page/page.js +++ b/app/templates/page/page.js @@ -1,9 +1,14 @@ 'use strict'; angular.module('bansho.view.page', ['bansho.table', 'bansho.tactical']) - .controller('PageCtrl', ['$scope', 'configManager', 'templateManager', - function ($scope, configManager, templateManager) { + .controller('PageCtrl', ['$scope', '$routeParams', 'configManager', 'templateManager', + function ($scope, $routeParams, configManager, templateManager) { templateManager.setLayout($scope.viewName); + + angular.forEach($routeParams, function (value, key) { + templateManager.setPageParam(key, value); + }); + $scope.components = templateManager.getLayoutComponents(); }]) diff --git a/app/templates/service/service.html b/app/templates/service/service.html deleted file mode 100644 index dc683ab..0000000 --- a/app/templates/service/service.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/app/templates/service/service.js b/app/templates/service/service.js deleted file mode 100644 index 869d5a7..0000000 --- a/app/templates/service/service.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -angular.module("bansho.view.service", [ "bansho.surveil" ]) - - .controller("ServiceViewCtrl", ['$scope', '$routeParams', 'configManager', 'templateManager', - function ($scope, $routeParams, configManager, templateManager) { - var host_name = $routeParams.host_name, - service_description = $routeParams.description; - - $scope.components = configManager.getConfigData($scope.viewName).components; - - if (!host_name || !service_description) { - throw new Error("ERROR :'host_name' and 'description' GET parameters must be set"); - } else { - templateManager.setPageParam('host_name', host_name); - templateManager.setPageParam('service_description', service_description); - } - }]); diff --git a/app/templates/template.js b/app/templates/template.js index 30042e6..68f8fd7 100644 --- a/app/templates/template.js +++ b/app/templates/template.js @@ -32,6 +32,10 @@ angular.module('bansho.view') pageParam[key] = value; }, getPageParam: function (key) { + if (pageParam[key] === undefined) { + throw new Error("ERROR :'" + key + "' GET parameter must be set in url"); + } + return pageParam[key]; } };