diff --git a/Gruntfile.js b/Gruntfile.js index 4cc3f93..11382e8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -109,9 +109,9 @@ module.exports = function (grunt) { '<%= project.app %>/components/table/cell_hosts_host/cell_hosts_host.js', '<%= project.app %>/components/table/cell_host_address/cell_host_address.js', '<%= project.app %>/components/table/cell_host_status/cell_host_status.js', - '<%= project.app %>/dashboard/dashboard.js', '<%= project.app %>/routing_view/routing_view.js', - '<%= project.app %>/single_table/single_table.js' + '<%= project.app %>/templates/dashboard/dashboard.js', + '<%= project.app %>/templates/single_table/single_table.js' ] }], options: { @@ -143,9 +143,9 @@ module.exports = function (grunt) { '<%= project.build %>/components/table/cell_hosts_host/cell_hosts_host.js': '<%= project.app %>/components/table/cell_hosts_host/cell_hosts_host.js', '<%= project.build %>/components/table/cell_host_address/cell_host_address.js': '<%= project.app %>/components/table/cell_host_address/cell_host_address.js', '<%= project.build %>/components/table/cell_host_status/cell_host_status.js': '<%= project.app %>/components/table/cell_host_status/cell_host_status.js', - '<%= project.build %>/dashboard/dashboard.js': '<%= project.app %>/dashboard/dashboard.js', '<%= project.build %>/routing_view/routing_view.js': '<%= project.app %>/routing_view/routing_view.js', - '<%= project.build %>/single_table/single_table.js' : '<%= project.app %>/single_table/single_table.js' + '<%= project.build %>/templates/dashboard/dashboard.js': '<%= project.app %>/templates/dashboard/dashboard.js', + '<%= project.build %>/templates/single_table/single_table.js' : '<%= project.app %>/templates/single_table/single_table.js' }, { '<%= project.build %>/js/adagios.min.js' : [ @@ -171,9 +171,9 @@ module.exports = function (grunt) { '<%= project.build %>/components/table/cell_hosts_host/cell_hosts_host.js', '<%= project.build %>/components/table/cell_host_address/cell_host_address.js', '<%= project.build %>/components/table/cell_host_status/cell_host_status.js', - '<%= project.build %>/dashboard/dashboard.js', '<%= project.build %>/routing_view/routing_view.js', - '<%= project.build %>/single_table/single_table.js' + '<%= project.build %>/templates/dashboard/dashboard.js', + '<%= project.build %>/templates/single_table/single_table.js' ] } ], diff --git a/app/app.js b/app/app.js index f759bf5..588167d 100644 --- a/app/app.js +++ b/app/app.js @@ -28,8 +28,8 @@ angular.module('adagios', [ }]) // Reinitialise objects on url change - .run(['$rootScope', 'reinitTables', function($rootScope, reinitTables) { - $rootScope.$on('$locationChangeStart', function() { + .run(['$rootScope', 'reinitTables', function ($rootScope, reinitTables) { + $rootScope.$on('$locationChangeStart', function () { reinitTables(); }); }]); diff --git a/app/components/config/config.json b/app/components/config/config.json index ffeab98..51e8c01 100644 --- a/app/components/config/config.json +++ b/app/components/config/config.json @@ -147,7 +147,7 @@ "hostsConfig": { "title": "Hosts", "refreshInterval": 0, - "template": "singleTable", + "template": "single_table", "components": [ { "type": "table", @@ -180,7 +180,7 @@ "servicesConfig": { "title": "Services", "refreshInterval": 0, - "template": "singleTable", + "template": "single_table", "components": [{ "type": "table", "config": { diff --git a/app/components/sidebar/sidebar.html b/app/components/sidebar/sidebar.html index 0ba87cb..b92ca14 100644 --- a/app/components/sidebar/sidebar.html +++ b/app/components/sidebar/sidebar.html @@ -22,9 +22,9 @@
diff --git a/app/routing_view/routing_view.js b/app/routing_view/routing_view.js index 8c27ef4..bfd3003 100644 --- a/app/routing_view/routing_view.js +++ b/app/routing_view/routing_view.js @@ -16,7 +16,13 @@ angular.module('adagios.view', ['ngRoute', .controller('ViewCtrl', ['$scope', '$routeParams', 'viewsTemplate', function ($scope, $routeParams, viewsTemplate) { var templateName = viewsTemplate[$routeParams.view], - templateUrl = templateName + '/' + templateName + '.html'; + templateUrl = 'templates/' + templateName + '/' + templateName + '.html'; + + if (!!$routeParams.view) { + $scope.viewName = $routeParams.view; + } else { + throw new Error("ERROR : 'view' GET parameter must be the custom view name"); + } $scope.templateUrl = templateUrl; }]) diff --git a/app/dashboard/dashboard.html b/app/templates/dashboard/dashboard.html similarity index 98% rename from app/dashboard/dashboard.html rename to app/templates/dashboard/dashboard.html index 6e81202..4db0a83 100644 --- a/app/dashboard/dashboard.html +++ b/app/templates/dashboard/dashboard.html @@ -1,4 +1,4 @@ -