diff --git a/Gruntfile.js b/Gruntfile.js
index 0d411f4..db446fb 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -18,13 +18,13 @@ module.exports = function (grunt) {
clean: {
dist: [
- '<%= project.dist %>/assets/',
- '<%= project.dist %>/bower_components/',
- '<%= project.dist %>/components/',
- '<%= project.dist %>/js/',
- '<%= project.dist %>/templates/',
- '<%= project.dist %>/index.html'
- ],
+ '<%= project.dist %>/assets/',
+ '<%= project.dist %>/bower_components/',
+ '<%= project.dist %>/components/',
+ '<%= project.dist %>/js/',
+ '<%= project.dist %>/templates/',
+ '<%= project.dist %>/index.html'
+ ],
tmp: ['<%= project.tmp %>/']
},
@@ -84,31 +84,31 @@ module.exports = function (grunt) {
},
jshint: { // configure the task
- options: {
- node: true,
- loopfunc: true,
- globals: {
- document: true,
- angular: true,
- jQuery: true,
- $: true,
- describe: true,
- it: true,
- expect: true,
- beforeEach: true,
- inject: true
- },
- force: true
- },
- all: [
- 'karma.conf.js',
- 'Gruntfile.js',
- '<%= project.app %>/app.js',
- '<%= project.app %>/**/*.js',
- '!<%= project.app %>/bower_components/**',
- '!<%= project.app %>/**/live.js',
- '!<%= project.app %>/**/adagios.js'
- ]
+ options: {
+ node: true,
+ loopfunc: true,
+ globals: {
+ document: true,
+ angular: true,
+ jQuery: true,
+ $: true,
+ describe: true,
+ it: true,
+ expect: true,
+ beforeEach: true,
+ inject: true
+ },
+ force: true
+ },
+ all: [
+ 'karma.conf.js',
+ 'Gruntfile.js',
+ '<%= project.app %>/app.js',
+ '<%= project.app %>/**/*.js',
+ '!<%= project.app %>/bower_components/**',
+ '!<%= project.app %>/**/live.js',
+ '!<%= project.app %>/**/adagios.js'
+ ]
},
useminPrepare: {
@@ -166,8 +166,8 @@ module.exports = function (grunt) {
'<%= project.app %>/components/live/surveil.js',
'<%= project.assets %>/sass/{,*/}*.{scss,sass}'
],
- tasks: ['production:surveil']
- },
+ tasks: ['production:surveil']
+ },
options: {
livereload: true
}
diff --git a/app/app.js b/app/app.js
index 1fb4a0b..8ec0950 100644
--- a/app/app.js
+++ b/app/app.js
@@ -2,7 +2,8 @@
angular.module('bansho', [
'ngRoute',
- 'angular.filter',
+ 'ngCookies',
+ 'angular.filter',
'bansho.config',
'bansho.authentication',
'bansho.utils.promiseManager',
diff --git a/app/assets/js/scripts.js b/app/assets/js/scripts.js
index e00113b..b88172a 100644
--- a/app/assets/js/scripts.js
+++ b/app/assets/js/scripts.js
@@ -1,22 +1,22 @@
var AdagiosUI = (function() {
"use strict";
- // States for UI modifications
- var state = {
- visible: 'state--visible',
- hidden: 'state--hidden',
- current: 'state--current',
- open: 'state--open',
- fadeIn: 'state--fadein',
- fadeOut: 'state--fadeout',
- hasChild: 'state--haschild'
- };
+ // States for UI modifications
+ var state = {
+ visible: 'state--visible',
+ hidden: 'state--hidden',
+ current: 'state--current',
+ open: 'state--open',
+ fadeIn: 'state--fadein',
+ fadeOut: 'state--fadeout',
+ hasChild: 'state--haschild'
+ };
- // Breakpoints for the responsive web design
- var mquery = {
- phone: 480,
- tablet: 959
- };
+ // Breakpoints for the responsive web design
+ var mquery = {
+ phone: 480,
+ tablet: 959
+ };
var test = function() {
console.log();
@@ -37,12 +37,12 @@ var AdagiosUI = (function() {
});
};
- return {
- state: state,
- test: test,
- mquery: mquery,
+ return {
+ state: state,
+ test: test,
+ mquery: mquery,
syncBkgCheckbox : syncBkgCheckbox,
closeSidebar : closeSidebar
- };
+ };
})();
diff --git a/app/assets/sass/app.scss b/app/assets/sass/app.scss
index 5f0022c..73ba480 100644
--- a/app/assets/sass/app.scss
+++ b/app/assets/sass/app.scss
@@ -55,3 +55,8 @@
@import '../../components/topbar/topbar';
@import '../../components/sidebar/sidebar';
@import '../../components/tactical/tactical';
+
+//----------------------------------*\
+// TEMPORARY MODULES
+//----------------------------------*/
+@import 'temporary';
diff --git a/app/assets/sass/global/_default.scss b/app/assets/sass/global/_default.scss
index c74d4ff..88a119f 100644
--- a/app/assets/sass/global/_default.scss
+++ b/app/assets/sass/global/_default.scss
@@ -207,7 +207,7 @@ table {
//overflow-x:auto;
//@include medium-and-up-screen {
- // display:table;
+ // display:table;
// overflow-x:visible;
//}
}
diff --git a/app/assets/sass/global/_helpers.scss b/app/assets/sass/global/_helpers.scss
index e7d9c68..8b4e935 100644
--- a/app/assets/sass/global/_helpers.scss
+++ b/app/assets/sass/global/_helpers.scss
@@ -34,15 +34,15 @@
position: absolute;
width: 1px;
- &.focusable:active,
- &.focusable:focus {
- clip: auto;
- height: auto;
- margin: 0;
- overflow: visible;
- position: static;
- width: auto;
- }
+ &.focusable:active,
+ &.focusable:focus {
+ clip: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ position: static;
+ width: auto;
+ }
}
diff --git a/app/assets/sass/modules-objects/_panes.scss b/app/assets/sass/modules-objects/_panes.scss
index 41aa5ab..d426c9b 100644
--- a/app/assets/sass/modules-objects/_panes.scss
+++ b/app/assets/sass/modules-objects/_panes.scss
@@ -10,7 +10,7 @@
@include medium-and-up-screen {
border:0;
- display:table;
+ display:table;
min-height:0;
overflow-x:visible;
width:100%;
diff --git a/app/assets/sass/temporary.scss b/app/assets/sass/temporary.scss
new file mode 100644
index 0000000..d567286
--- /dev/null
+++ b/app/assets/sass/temporary.scss
@@ -0,0 +1,32 @@
+.centered {
+ position: fixed;
+ margin-top: 15px;
+ left: 50%;
+ transform: translate(-50%);
+}
+
+.bansho-title {
+ color: #ddd;
+ font-size: 300%;
+ padding-bottom: 0px;
+ margin-bottom: 0px;
+}
+
+.form-group {
+ padding-top: 5px;
+ padding-bottom: 15px;
+}
+
+.form-control {
+ width: 500px;
+}
+
+.field {
+ float: right;
+ width: 400px;
+}
+
+.label {
+ width: 85px;
+ padding-right: 15px;
+}
diff --git a/app/components/authentication/authentication.html b/app/components/authentication/authentication.html
index b0d3df1..122f4d6 100644
--- a/app/components/authentication/authentication.html
+++ b/app/components/authentication/authentication.html
@@ -1,19 +1,31 @@
-
diff --git a/app/components/table/actionbar/actions/actions.js b/app/components/table/actionbar/actions/actions.js
index 038ab73..3fbbd1e 100644
--- a/app/components/table/actionbar/actions/actions.js
+++ b/app/components/table/actionbar/actions/actions.js
@@ -2,134 +2,134 @@
angular.module('bansho.table.actionbar')
- .directive('banshoAcknowledgeForm', function () {
- return {
- restrict: 'E',
- templateUrl: 'components/table/actionbar/actions/acknowledge_form.html',
- scope: {
- isShown: '='
- },
- controller: 'banshoAcknowledgeFormCtrl'
- };
- })
+ .directive('banshoAcknowledgeForm', function () {
+ return {
+ restrict: 'E',
+ templateUrl: 'components/table/actionbar/actions/acknowledge_form.html',
+ scope: {
+ isShown: '='
+ },
+ controller: 'banshoAcknowledgeFormCtrl'
+ };
+ })
- .controller('banshoAcknowledgeFormCtrl',
- ['$scope', '$filter', 'tablesConfig', 'actionbarFilters', 'backendClient',
- function ($scope, $filter, tablesConfig, actionbarFilters, backendClient) {
+ .controller('banshoAcknowledgeFormCtrl',
+ ['$scope', '$filter', 'tablesConfig', 'actionbarFilters', 'backendClient',
+ function ($scope, $filter, tablesConfig, actionbarFilters, backendClient) {
- $scope.acknowledgeProblems = function () {
- angular.forEach(tablesConfig, function (tableConfig) {
- var entries = $filter('filter')(tableConfig.entries,
- actionbarFilters.searchFilter);
+ $scope.acknowledgeProblems = function () {
+ angular.forEach(tablesConfig, function (tableConfig) {
+ var entries = $filter('filter')(tableConfig.entries,
+ actionbarFilters.searchFilter);
- angular.forEach(entries, function (entry) {
- var service_description;
+ angular.forEach(entries, function (entry) {
+ var service_description;
- if (entry.is_checked) {
- if ('description' in entry) {
- service_description = entry.description;
- }
+ if (entry.is_checked) {
+ if ('description' in entry) {
+ service_description = entry.description;
+ }
- backendClient.acknowledge(entry.host_name, service_description, $scope.attrs).error(function (data) {
- throw new Error('Acknowledge request failed');
- });
- }
- });
- });
- };
- }])
+ backendClient.acknowledge(entry.host_name, service_description, $scope.attrs).error(function (data) {
+ throw new Error('Acknowledge request failed');
+ });
+ }
+ });
+ });
+ };
+ }])
- .directive('banshoDowntimeForm', function () {
- return {
- restrict: 'E',
- templateUrl: 'components/table/actionbar/actions/downtime_form.html',
- scope: {
- isShown: '='
- },
- controller: 'banshoDowntimeFormCtrl'
- };
- })
+ .directive('banshoDowntimeForm', function () {
+ return {
+ restrict: 'E',
+ templateUrl: 'components/table/actionbar/actions/downtime_form.html',
+ scope: {
+ isShown: '='
+ },
+ controller: 'banshoDowntimeFormCtrl'
+ };
+ })
- .controller('banshoDowntimeFormCtrl',
- ['$scope', '$filter', 'tablesConfig', 'actionbarFilters', 'backendClient',
- function ($scope, $filter, tablesConfig, actionbarFilters, backendClient) {
+ .controller('banshoDowntimeFormCtrl',
+ ['$scope', '$filter', 'tablesConfig', 'actionbarFilters', 'backendClient',
+ function ($scope, $filter, tablesConfig, actionbarFilters, backendClient) {
- $scope.messages = [];
+ $scope.messages = [];
- $scope.sendDowntime = function () {
- angular.forEach(tablesConfig, function (table) {
- var entries = $filter('filter')(table.entries, actionbarFilters.searchFilter);
+ $scope.sendDowntime = function () {
+ angular.forEach(tablesConfig, function (table) {
+ var entries = $filter('filter')(table.entries, actionbarFilters.searchFilter);
- angular.forEach(entries, function (entry) {
- var service_description;
+ angular.forEach(entries, function (entry) {
+ var service_description;
- if (entry.is_checked) {
- if ('description' in entry) {
- service_description = entry.description;
- }
+ if (entry.is_checked) {
+ if ('description' in entry) {
+ service_description = entry.description;
+ }
- backendClient.downtime(entry.host_name, service_description, $scope.attrs).then(function (data) {
- $scope.messages.push({
- text: entry.host_name + " success ",
- type: "success"
- });
- $scope.isShown = false;
- },
- function (error) {
- $scope.messages.push({
- text: entry.host_name + " error",
- type: "error"
- });
- });
- }
- });
- });
- };
- }])
+ backendClient.downtime(entry.host_name, service_description, $scope.attrs).then(function (data) {
+ $scope.messages.push({
+ text: entry.host_name + " success ",
+ type: "success"
+ });
+ $scope.isShown = false;
+ },
+ function (error) {
+ $scope.messages.push({
+ text: entry.host_name + " error",
+ type: "error"
+ });
+ });
+ }
+ });
+ });
+ };
+ }])
- .directive('banshoRecheckButton', function () {
- return {
- restrict: 'E',
- templateUrl: 'components/table/actionbar/actions/recheck_button.html',
- scope: {
- isShown: '='
- },
- controller: 'banshoRecheckButtonCtrl'
- };
- })
+ .directive('banshoRecheckButton', function () {
+ return {
+ restrict: 'E',
+ templateUrl: 'components/table/actionbar/actions/recheck_button.html',
+ scope: {
+ isShown: '='
+ },
+ controller: 'banshoRecheckButtonCtrl'
+ };
+ })
- .controller('banshoRecheckButtonCtrl',
- ['$scope', '$filter', 'tablesConfig', 'actionbarFilters', 'backendClient',
- function ($scope, $filter, tablesConfig, actionbarFilters, backendClient) {
+ .controller('banshoRecheckButtonCtrl',
+ ['$scope', '$filter', 'tablesConfig', 'actionbarFilters', 'backendClient',
+ function ($scope, $filter, tablesConfig, actionbarFilters, backendClient) {
- $scope.messages = [];
+ $scope.messages = [];
- $scope.sendRecheck = function () {
- angular.forEach(tablesConfig, function (table) {
- var entries = $filter('filter')(table.entries, actionbarFilters.searchFilter);
+ $scope.sendRecheck = function () {
+ angular.forEach(tablesConfig, function (table) {
+ var entries = $filter('filter')(table.entries, actionbarFilters.searchFilter);
- angular.forEach(entries, function (entry) {
- var service_description;
+ angular.forEach(entries, function (entry) {
+ var service_description;
- if (entry.is_checked) {
- if ('description' in entry) {
- service_description = entry.description;
- }
+ if (entry.is_checked) {
+ if ('description' in entry) {
+ service_description = entry.description;
+ }
- backendClient.recheck(entry.host_name, service_description).then(function (data) {
- $scope.messages.push({
- text: entry.host_name + " success ",
- type: "success"
- });
- },
- function (error) {
- $scope.messages.push({
- text: entry.host_name + " error",
- type: "error"
- });
- });
- }
- });
- });
- };
- }]);
+ backendClient.recheck(entry.host_name, service_description).then(function (data) {
+ $scope.messages.push({
+ text: entry.host_name + " success ",
+ type: "success"
+ });
+ },
+ function (error) {
+ $scope.messages.push({
+ text: entry.host_name + " error",
+ type: "error"
+ });
+ });
+ }
+ });
+ });
+ };
+ }]);
diff --git a/app/components/table/actionbar/actions/downtime_form.html b/app/components/table/actionbar/actions/downtime_form.html
index 183f93d..f0ab68b 100644
--- a/app/components/table/actionbar/actions/downtime_form.html
+++ b/app/components/table/actionbar/actions/downtime_form.html
@@ -1,28 +1,28 @@
{{message.text}} + {{message.type}}
Downtime
diff --git a/app/components/table/actionbar/actions/recheck_button.html b/app/components/table/actionbar/actions/recheck_button.html
index 83cad5c..847dafb 100644
--- a/app/components/table/actionbar/actions/recheck_button.html
+++ b/app/components/table/actionbar/actions/recheck_button.html
@@ -1,4 +1,4 @@
diff --git a/app/components/topbar/topbar.html b/app/components/topbar/topbar.html
index 543f6e8..948cbb8 100644
--- a/app/components/topbar/topbar.html
+++ b/app/components/topbar/topbar.html
@@ -131,16 +131,7 @@
Missing Plugins
Object History
Configure
-
-
-
- Nagios
-
-
diff --git a/app/components/topbar/topbar.js b/app/components/topbar/topbar.js
index 3b63bb4..ee0c636 100644
--- a/app/components/topbar/topbar.js
+++ b/app/components/topbar/topbar.js
@@ -2,27 +2,31 @@
angular.module('bansho.topbar', ['bansho.live'])
- .controller('TopBarCtrl', ['$rootScope', '$scope', '$interval', 'backendClient', 'promisesManager',
- function ($rootScope, $scope, $interval, backendClient, promisesManager) {
+ .controller('TopBarCtrl', ['$rootScope', '$scope', '$interval', 'backendClient', 'promisesManager', 'authService',
+ function ($rootScope, $scope, $interval, backendClient, promisesManager, authService) {
var getData,
hostProblems,
serviceProblems;
getData = function () {
- if ($rootScope.isAuthenticated) {
- backendClient.getServiceProblems().success(function (data) {
- serviceProblems = data.length;
- backendClient.getHostProblems().success(function (data) {
- hostProblems = data.length;
- $scope.allProblems = serviceProblems + hostProblems;
- });
- });
- }
+ if ($rootScope.isAuthenticated) {
+ backendClient.getServiceProblems().success(function (data) {
+ serviceProblems = data.length;
+ backendClient.getHostProblems().success(function (data) {
+ hostProblems = data.length;
+ $scope.allProblems = serviceProblems + hostProblems;
+ });
+ });
+ }
};
// TODO: Change hardcoded interval when the topbar dashboard will be implemented
promisesManager.addAjaxPromise($interval(getData, 10000));
- getData();
+ getData();
+
+ $scope.logout = function () {
+ authService.logout();
+ };
}])
.directive('banshoTopbar', function () {
diff --git a/app/index.html b/app/index.html
index cbfd494..9c1e231 100644
--- a/app/index.html
+++ b/app/index.html
@@ -15,6 +15,7 @@
+
diff --git a/bower.json b/bower.json
index 8209b29..13ca753 100644
--- a/bower.json
+++ b/bower.json
@@ -5,15 +5,16 @@
"license": "AGPLv3",
"private": true,
"dependencies": {
- "angular": "1.2.x",
- "angular-route": "1.2.x",
- "angular-loader": "1.2.x",
- "angular-mocks": "~1.2.x",
- "html5-boilerplate": "~4.3.0",
+ "angular": "~1.3.15",
+ "angular-route": "~1.3.15",
+ "angular-loader": "~1.3.15",
+ "angular-mocks": "~1.3.15",
+ "html5-boilerplate": "~5.2.0",
"bootstrap-sass-official": "3.3.1",
- "fontawesome": "4.2.0",
+ "fontawesome": "~4.3.0",
"justgage-toorshia": "master",
"moment": "~2.9.0",
- "angular-filter": "~0.5.4"
+ "angular-filter": "~0.5.4",
+ "angular-cookies": "~1.3.15"
}
}