Config host and config Template pages
Change-Id: I3b22147685b401f9424bf4f80334bf2b99da71d4
This commit is contained in:
parent
0931458d80
commit
93ebbc4dfd
@ -55,14 +55,14 @@ angular.module('bansho.authentication', [])
|
|||||||
|
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.factory('authService', [ '$http', '$location', '$rootScope', 'session', 'configManager', 'themeManager', 'surveilConfig',
|
.factory('authService', [ '$http', '$location', '$rootScope', 'session', 'configManager', 'themeManager', 'surveilApiConfig',
|
||||||
function ($http, $location, $rootScope, session, configManager, themeManager, surveilConfig) {
|
function ($http, $location, $rootScope, session, configManager, themeManager, surveilApiConfig) {
|
||||||
var authService = {},
|
var authService = {},
|
||||||
onLogin = [];
|
onLogin = [];
|
||||||
|
|
||||||
authService.login = function (credentials) {
|
authService.login = function (credentials) {
|
||||||
return $http
|
return $http
|
||||||
.post(surveilConfig.getAuthUrl() + '/tokens/', credentials)
|
.post(surveilApiConfig.getAuthUrl() + '/tokens/', credentials)
|
||||||
.success(function (data) {
|
.success(function (data) {
|
||||||
$rootScope.isAuthenticated = true;
|
$rootScope.isAuthenticated = true;
|
||||||
|
|
||||||
|
@ -198,6 +198,30 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"allHostConfigTemplate": {
|
||||||
|
"name": "Host config template",
|
||||||
|
"filter": {
|
||||||
|
"hosts": {
|
||||||
|
"is": {
|
||||||
|
"register": [
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allHostConfigWithoutTemplate": {
|
||||||
|
"name": "Host config without template",
|
||||||
|
"filter": {
|
||||||
|
"hosts": {
|
||||||
|
"isnot": {
|
||||||
|
"register": [
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"all": {
|
"all": {
|
||||||
"name": "All",
|
"name": "All",
|
||||||
"filter": {
|
"filter": {
|
||||||
@ -247,6 +271,16 @@
|
|||||||
"provider": "status",
|
"provider": "status",
|
||||||
"endpoint": "services",
|
"endpoint": "services",
|
||||||
"filter": "all"
|
"filter": "all"
|
||||||
|
},
|
||||||
|
"hostsConfig": {
|
||||||
|
"provider": "config",
|
||||||
|
"endpoint": "hosts",
|
||||||
|
"filter": "allHostConfigWithoutTemplate"
|
||||||
|
},
|
||||||
|
"hostsConfigTemplate": {
|
||||||
|
"provider": "config",
|
||||||
|
"endpoint": "hosts",
|
||||||
|
"filter": "allHostConfigTemplate"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,8 @@ angular.module('bansho.config', [])
|
|||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.service('configManager', ['$http', '$q', 'componentsConfig', 'surveilConfig',
|
.service('configManager', ['$http', '$q', 'componentsConfig', 'surveilApiConfig',
|
||||||
function ($http, $q, componentsConfig, surveilConfig) {
|
function ($http, $q, componentsConfig, surveilApiConfig) {
|
||||||
var layoutConfig = {},
|
var layoutConfig = {},
|
||||||
config = {};
|
config = {};
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ angular.module('bansho.config', [])
|
|||||||
$http.get('components/config/config.json')
|
$http.get('components/config/config.json')
|
||||||
.success(function (c) {
|
.success(function (c) {
|
||||||
config = c;
|
config = c;
|
||||||
surveilConfig.setSurveilApiUrl(c.surveilApiUrl);
|
surveilApiConfig.setSurveilApiUrl(c.surveilApiUrl);
|
||||||
surveilConfig.setAuthUrl(c.surveilAuthUrl);
|
surveilApiConfig.setAuthUrl(c.surveilAuthUrl);
|
||||||
promise.resolve();
|
promise.resolve();
|
||||||
})
|
})
|
||||||
.error(function() {
|
.error(function() {
|
||||||
@ -185,7 +185,7 @@ angular.module('bansho.config', [])
|
|||||||
var saveLayoutConfig = function () {
|
var saveLayoutConfig = function () {
|
||||||
var responsePromise = $q.defer();
|
var responsePromise = $q.defer();
|
||||||
|
|
||||||
$http.post(surveilConfig.endpoint('appConfig'), JSON.stringify(layoutConfig.data))
|
$http.post(surveilApiConfig.endpoint('appConfig'), JSON.stringify(layoutConfig.data))
|
||||||
.success(function () {
|
.success(function () {
|
||||||
responsePromise.resolve();
|
responsePromise.resolve();
|
||||||
})
|
})
|
||||||
@ -201,14 +201,14 @@ angular.module('bansho.config', [])
|
|||||||
|
|
||||||
componentsConfig.load();
|
componentsConfig.load();
|
||||||
|
|
||||||
$http.get(surveilConfig.endpoint('appConfig'))
|
$http.get(surveilApiConfig.endpoint('appConfig'))
|
||||||
.success(function (conf) {
|
.success(function (conf) {
|
||||||
if (!useStoredConfig || jQuery.isEmptyObject(conf)) {
|
if (!useStoredConfig || jQuery.isEmptyObject(conf)) {
|
||||||
$http.get('components/config/defaultLayoutConfig.json')
|
$http.get('components/config/defaultLayoutConfig.json')
|
||||||
.success(function (conf) {
|
.success(function (conf) {
|
||||||
layoutConfig.data = conf;
|
layoutConfig.data = conf;
|
||||||
|
|
||||||
$http.post(surveilConfig.endpoint('appConfig'), JSON.stringify(conf))
|
$http.post(surveilApiConfig.endpoint('appConfig'), JSON.stringify(conf))
|
||||||
.success(function () {
|
.success(function () {
|
||||||
responsePromise.resolve();
|
responsePromise.resolve();
|
||||||
})
|
})
|
||||||
|
@ -692,5 +692,158 @@
|
|||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"template": "config"
|
"template": "config"
|
||||||
|
},
|
||||||
|
"configHosts": {
|
||||||
|
"template": "page",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"type": "panel",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"type": "title",
|
||||||
|
"attributes": {
|
||||||
|
"title": "ConfigHosts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "actionbar",
|
||||||
|
"attributes": {
|
||||||
|
"tableId": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"type": "actionbar-filter",
|
||||||
|
"attributes": {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"location": "componentsConfig",
|
||||||
|
"content": "all"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "componentsConfig",
|
||||||
|
"content": "hostOk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "componentsConfig",
|
||||||
|
"content": "hostNotOk"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "actionbar-more",
|
||||||
|
"attributes": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "actionbar-search-filter",
|
||||||
|
"attributes": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "table",
|
||||||
|
"attributes": {
|
||||||
|
"tableId": 0,
|
||||||
|
"refreshInterval": 30,
|
||||||
|
"cells": {
|
||||||
|
"text": [
|
||||||
|
"Host",
|
||||||
|
"Address",
|
||||||
|
"Use",
|
||||||
|
"Enable"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
"config_host",
|
||||||
|
"config_host_address",
|
||||||
|
"config_host_use",
|
||||||
|
"config_host_register"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"headerFollow": false,
|
||||||
|
"inputSource": "hostsConfig",
|
||||||
|
"isWrappable": false,
|
||||||
|
"noRepeatCell": "",
|
||||||
|
"checkColumn": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"configHostsTemplate": {
|
||||||
|
"template": "page",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"type": "panel",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"type": "title",
|
||||||
|
"attributes": {
|
||||||
|
"title": "Hosts Template"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "actionbar",
|
||||||
|
"attributes": {
|
||||||
|
"tableId": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"type": "actionbar-filter",
|
||||||
|
"attributes": {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"location": "componentsConfig",
|
||||||
|
"content": "all"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "componentsConfig",
|
||||||
|
"content": "hostOk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "componentsConfig",
|
||||||
|
"content": "hostNotOk"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "actionbar-more",
|
||||||
|
"attributes": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "actionbar-search-filter",
|
||||||
|
"attributes": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "table",
|
||||||
|
"attributes": {
|
||||||
|
"tableId": 0,
|
||||||
|
"cells": {
|
||||||
|
"text": [
|
||||||
|
"Template",
|
||||||
|
"Use"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
"config_host_name",
|
||||||
|
"config_host_use"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"headerFollow": false,
|
||||||
|
"inputSource": "hostsConfigTemplate",
|
||||||
|
"isWrappable": false,
|
||||||
|
"noRepeatCell": "",
|
||||||
|
"checkColumn": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
angular.module('bansho.datasource', ['bansho.surveil'])
|
angular.module('bansho.datasource', ['bansho.surveil'])
|
||||||
.value('tableGlobalConfig', {'cellToFieldsMap': {}, 'cellWrappableField': {}})
|
.value('tableGlobalConfig', {'cellToFieldsMap': {}, 'cellWrappableField': {}})
|
||||||
|
|
||||||
.service('datasource', ['$filter', 'surveilStatus', 'surveilQuery', 'componentsConfig', 'tableGlobalConfig',
|
.service('datasource', ['$filter', 'surveilStatus', 'surveilConfig', 'surveilQuery', 'componentsConfig', 'tableGlobalConfig',
|
||||||
function ($filter, surveilStatus, surveilQuery, componentsConfig, tableGlobalConfig) {
|
function ($filter, surveilStatus, surveilConfig, surveilQuery, componentsConfig, tableGlobalConfig) {
|
||||||
var providerServices = {
|
var providerServices = {
|
||||||
status: surveilStatus
|
status: surveilStatus,
|
||||||
|
config: surveilConfig
|
||||||
},
|
},
|
||||||
config = [],
|
config = [],
|
||||||
data = [],
|
data = [],
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
<td class="data-table__host {{entry[cell_name + '_additionnalClass']}}" ng-controller="CellConfigHostCtrl">
|
||||||
|
<a class="data-table__data" href="#/view?view=host&host_name={{entry.host_name}}">{{entry.host_name}}</a>
|
||||||
|
</td>
|
@ -0,0 +1,12 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('bansho.table.cell_config_host', ['bansho.table'])
|
||||||
|
|
||||||
|
.controller('CellConfigHostCtrl', ['$scope', function ($scope) {
|
||||||
|
$scope.cell_name = 'host';
|
||||||
|
}])
|
||||||
|
|
||||||
|
.run(['tableGlobalConfig', function (tableGlobalConfig) {
|
||||||
|
tableGlobalConfig.cellToFieldsMap.config_host = ['host_name'];
|
||||||
|
tableGlobalConfig.cellWrappableField.config_host = 'host_name';
|
||||||
|
}]);
|
@ -0,0 +1,3 @@
|
|||||||
|
<td class="data-table__hostaddress">
|
||||||
|
<span class="data-table__data">{{entry.address}}</span>
|
||||||
|
</td>
|
@ -0,0 +1,11 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('bansho.table.cell_config_host_address', ['bansho.table'])
|
||||||
|
|
||||||
|
.controller('CellConfigHostAddressCtrl', [function () {
|
||||||
|
angular.noop();
|
||||||
|
}])
|
||||||
|
|
||||||
|
.run(['tableGlobalConfig', function (tableGlobalConfig) {
|
||||||
|
tableGlobalConfig.cellToFieldsMap.config_host_address = ['address'];
|
||||||
|
}]);
|
@ -0,0 +1,3 @@
|
|||||||
|
<td class="data-table__hostname">
|
||||||
|
<span class="data-table__data">{{entry.name}}</span>
|
||||||
|
</td>
|
@ -0,0 +1,11 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('bansho.table.cell_config_host_name', ['bansho.table'])
|
||||||
|
|
||||||
|
.controller('CellConfigHostNameCtrl', [function () {
|
||||||
|
angular.noop();
|
||||||
|
}])
|
||||||
|
|
||||||
|
.run(['tableGlobalConfig', function (tableGlobalConfig) {
|
||||||
|
tableGlobalConfig.cellToFieldsMap.config_host_use = ['name'];
|
||||||
|
}]);
|
@ -0,0 +1,3 @@
|
|||||||
|
<td class="data-table__hostregister" data-ng-controller="CellConfigHostRegisterCtrl">
|
||||||
|
<span class="data-table__data fa {{activityClass}}"></span>
|
||||||
|
</td>
|
@ -0,0 +1,15 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('bansho.table.cell_config_host_register', ['bansho.table'])
|
||||||
|
|
||||||
|
.controller('CellConfigHostRegisterCtrl', ['$scope', function ($scope) {
|
||||||
|
if ($scope.register === 0) {
|
||||||
|
$scope.activityClass = 'fa-times-circle-o';
|
||||||
|
} else {
|
||||||
|
$scope.activityClass = 'fa-check-circle-o';
|
||||||
|
}
|
||||||
|
}])
|
||||||
|
|
||||||
|
.run(['tableGlobalConfig', function (tableGlobalConfig) {
|
||||||
|
tableGlobalConfig.cellToFieldsMap.config_host_register = ['register'];
|
||||||
|
}]);
|
@ -0,0 +1,3 @@
|
|||||||
|
<td class="data-table__hostuse">
|
||||||
|
<span class="data-table__data">{{entry.use}}</span>
|
||||||
|
</td>
|
@ -0,0 +1,11 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('bansho.table.cell_config_host_use', ['bansho.table'])
|
||||||
|
|
||||||
|
.controller('CellConfigHostUseCtrl', [function () {
|
||||||
|
angular.noop();
|
||||||
|
}])
|
||||||
|
|
||||||
|
.run(['tableGlobalConfig', function (tableGlobalConfig) {
|
||||||
|
tableGlobalConfig.cellToFieldsMap.config_host_use = ['use'];
|
||||||
|
}]);
|
@ -1,3 +1,3 @@
|
|||||||
<td class="data-table__event_output" ng-controller="CellStatusEventOutputCtrl">
|
<td class="data-table__event_output">
|
||||||
<p class="data-table__data">{{entry.event_output}}</p>
|
<p class="data-table__data">{{entry.event_output}}</p>
|
||||||
</td>
|
</td>
|
||||||
|
@ -5,15 +5,12 @@ angular.module('bansho.table', ['bansho.datasource',
|
|||||||
'bansho.filters',
|
'bansho.filters',
|
||||||
'bansho.table.cell_status_host',
|
'bansho.table.cell_status_host',
|
||||||
'bansho.table.cell_status_event',
|
'bansho.table.cell_status_event',
|
||||||
'bansho.table.cell_status_event_event_type',
|
|
||||||
'bansho.table.cell_status_event_output',
|
|
||||||
'bansho.table.cell_status_event_host_name',
|
|
||||||
'bansho.table.cell_status_event_service',
|
|
||||||
'bansho.table.cell_status_duration',
|
|
||||||
'bansho.table.cell_status_service_check',
|
'bansho.table.cell_status_service_check',
|
||||||
'bansho.table.cell_status_last_check',
|
'bansho.table.cell_status_last_check',
|
||||||
'bansho.table.cell_status_host_address',
|
'bansho.table.cell_status_host_address',
|
||||||
'bansho.table.cell_status_host_status',
|
'bansho.table.cell_status_host_status',
|
||||||
|
'bansho.table.cell_config_host',
|
||||||
|
'bansho.table.cell_config_host_register',
|
||||||
'ngMaterial'
|
'ngMaterial'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -27,6 +27,20 @@
|
|||||||
<li class="sidebar__subitem"><a href="#">Networks parents</a></li>
|
<li class="sidebar__subitem"><a href="#">Networks parents</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="sidebar__item">
|
||||||
|
<button class="sidebar__category"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#reportsList"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="reportsList">Config Objects</button>
|
||||||
|
<button class="sidebar__customize ico-cog">
|
||||||
|
<span class="visuallyhidden">Customize the config objects category</span>
|
||||||
|
</button>
|
||||||
|
<ul class="sidebar__sublist collapse in" id="configList">
|
||||||
|
<li class="sidebar__subitem"><a href="#/view?view=configHosts">Host</a></li>
|
||||||
|
<li class="sidebar__subitem"><a href="#/view?view=configHostsTemplate">Templates</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li class="sidebar__item">
|
<li class="sidebar__item">
|
||||||
<button class="sidebar__category"
|
<button class="sidebar__category"
|
||||||
data-toggle="collapse"
|
data-toggle="collapse"
|
||||||
|
55
app/components/surveil/config.js
Normal file
55
app/components/surveil/config.js
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*global jQuery */
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('bansho.surveil')
|
||||||
|
.service('surveilConfig', ['$http', '$q','surveilQuery', 'componentsConfig', 'surveilApiConfig',
|
||||||
|
function ($http, $q, surveilQuery, componentsConfig, surveilApiConfig) {
|
||||||
|
var executeQuery = function (url, method, query) {
|
||||||
|
return $http({
|
||||||
|
url: url,
|
||||||
|
method: method,
|
||||||
|
data: query
|
||||||
|
}).error(function () {
|
||||||
|
throw new Error('executeQuery : ' + method + ' Request failed');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var getData = function (fields, filters, endpoint) {
|
||||||
|
var promise = $q.defer();
|
||||||
|
|
||||||
|
if (!queryEndpoint[endpoint]) {
|
||||||
|
throw new Error('getData in surveilConfig : Invalid endpoint ' + endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
queryEndpoint[endpoint](fields, filters, function (data) {
|
||||||
|
promise.resolve(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
return promise.promise;
|
||||||
|
};
|
||||||
|
|
||||||
|
var queryEndpoint = {
|
||||||
|
"hosts": function (fields, filters, callback) {
|
||||||
|
var hostQuery = surveilQuery(fields, filters.hosts),
|
||||||
|
method = 'POST',
|
||||||
|
hostUrl = surveilApiConfig.endpoint('config') + '/hosts/';
|
||||||
|
|
||||||
|
executeQuery(hostUrl, method, hostQuery)
|
||||||
|
.success(function (hosts) {
|
||||||
|
var response = [];
|
||||||
|
|
||||||
|
angular.forEach(hosts, function (host) {
|
||||||
|
response.push(host);
|
||||||
|
});
|
||||||
|
|
||||||
|
callback(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
getData: getData
|
||||||
|
};
|
||||||
|
}]);
|
@ -3,10 +3,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('bansho.surveil')
|
angular.module('bansho.surveil')
|
||||||
.service('surveilStatus', ['$http', '$q', 'surveilQuery', 'componentsConfig', 'surveilConfig',
|
.service('surveilStatus', ['$http', '$q', 'surveilQuery', 'componentsConfig', 'surveilApiConfig',
|
||||||
function ($http, $q, surveilQuery, componentsConfig, surveilConfig) {
|
function ($http, $q, surveilQuery, componentsConfig, surveilApiConfig) {
|
||||||
var getMetric = function (host, service, metric) {
|
var getMetric = function (host, service, metric) {
|
||||||
var url = surveilConfig.endpoint('status') + '/hosts/' + host,
|
var url = surveilApiConfig.endpoint('status') + '/hosts/' + host,
|
||||||
responsePromise = $q.defer();
|
responsePromise = $q.defer();
|
||||||
|
|
||||||
if (service !== undefined) {
|
if (service !== undefined) {
|
||||||
@ -25,7 +25,7 @@ angular.module('bansho.surveil')
|
|||||||
};
|
};
|
||||||
|
|
||||||
var getMetricNames = function (host, service) {
|
var getMetricNames = function (host, service) {
|
||||||
var url = surveilConfig.endpoint('status') + '/hosts/' + host,
|
var url = surveilApiConfig.endpoint('status') + '/hosts/' + host,
|
||||||
responsePromise = $q.defer();
|
responsePromise = $q.defer();
|
||||||
|
|
||||||
if (service !== undefined) {
|
if (service !== undefined) {
|
||||||
@ -78,9 +78,9 @@ angular.module('bansho.surveil')
|
|||||||
var hostQuery = surveilQuery(fields, filters.hosts),
|
var hostQuery = surveilQuery(fields, filters.hosts),
|
||||||
serviceQuery = surveilQuery(fields, filters.services);
|
serviceQuery = surveilQuery(fields, filters.services);
|
||||||
|
|
||||||
executeQuery(surveilConfig.endpoint('status') + '/hosts/', 'POST', hostQuery)
|
executeQuery(surveilApiConfig.endpoint('status') + '/hosts/', 'POST', hostQuery)
|
||||||
.success(function (hosts) {
|
.success(function (hosts) {
|
||||||
executeQuery(surveilConfig.endpoint('status') + '/services/', 'POST', serviceQuery)
|
executeQuery(surveilApiConfig.endpoint('status') + '/services/', 'POST', serviceQuery)
|
||||||
.success(function (services) {
|
.success(function (services) {
|
||||||
callback(hosts, services);
|
callback(hosts, services);
|
||||||
});
|
});
|
||||||
@ -129,12 +129,7 @@ angular.module('bansho.surveil')
|
|||||||
"hosts": function (fields, filters, callback) {
|
"hosts": function (fields, filters, callback) {
|
||||||
var hostQuery = surveilQuery(fields, filters.hosts),
|
var hostQuery = surveilQuery(fields, filters.hosts),
|
||||||
method = 'POST',
|
method = 'POST',
|
||||||
hostUrl = surveilConfig.endpoint('status') + '/hosts/';
|
hostUrl = surveilApiConfig.endpoint('status') + '/hosts/';
|
||||||
|
|
||||||
if (filters.hosts && filters.hosts.is && filters.hosts.is.host_name) {
|
|
||||||
hostUrl += filters.hosts.is.host_name;
|
|
||||||
method = 'GET';
|
|
||||||
}
|
|
||||||
|
|
||||||
executeQuery(hostUrl, method, hostQuery)
|
executeQuery(hostUrl, method, hostQuery)
|
||||||
.success(function (hosts) {
|
.success(function (hosts) {
|
||||||
@ -151,7 +146,7 @@ angular.module('bansho.surveil')
|
|||||||
"events": function (fields, filters, callback) {
|
"events": function (fields, filters, callback) {
|
||||||
var query = surveilQuery(fields, filters.events);
|
var query = surveilQuery(fields, filters.events);
|
||||||
|
|
||||||
executeQuery(surveilConfig.endpoint('status') + '/events/', 'POST', query)
|
executeQuery(surveilApiConfig.endpoint('status') + '/events/', 'POST', query)
|
||||||
.success(function (events) {
|
.success(function (events) {
|
||||||
angular.forEach(events, function (event) {
|
angular.forEach(events, function (event) {
|
||||||
angular.forEach(event, function (value, attr) {
|
angular.forEach(event, function (value, attr) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
angular.module('bansho.surveil', [])
|
angular.module('bansho.surveil', [])
|
||||||
.service('surveilConfig', function () {
|
.service('surveilApiConfig', function () {
|
||||||
var apiUrl,
|
var apiUrl,
|
||||||
authUrl,
|
authUrl,
|
||||||
surveilEndpoints = {};
|
surveilEndpoints = {};
|
||||||
@ -10,6 +10,7 @@ angular.module('bansho.surveil', [])
|
|||||||
surveilEndpoints = {
|
surveilEndpoints = {
|
||||||
status: apiUrl + '/status',
|
status: apiUrl + '/status',
|
||||||
actions: apiUrl + '/actions',
|
actions: apiUrl + '/actions',
|
||||||
|
config: apiUrl + '/config',
|
||||||
appConfig: apiUrl + '/bansho/config'
|
appConfig: apiUrl + '/bansho/config'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,400italic' rel='stylesheet' type='text/css'>
|
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,400italic' rel='stylesheet' type='text/css'>
|
||||||
<link rel="stylesheet" href="assets/css/app.css">
|
<link rel="stylesheet" href="assets/css/app.css">
|
||||||
<!-- build:css assets/css/app_ext_css.css -->
|
<!-- build:css assets/css/app_ext_css.css -->
|
||||||
|
<link href="bower_components/fontawesome/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css">
|
||||||
<link href="bower_components/pnotify/pnotify.core.css" media="all" rel="stylesheet" type="text/css" />
|
<link href="bower_components/pnotify/pnotify.core.css" media="all" rel="stylesheet" type="text/css" />
|
||||||
<link href="bower_components/pnotify/pnotify.buttons.css" media="all" rel="stylesheet" type="text/css" />
|
<link href="bower_components/pnotify/pnotify.buttons.css" media="all" rel="stylesheet" type="text/css" />
|
||||||
<link href="bower_components/pnotify/pnotify.history.css" media="all" rel="stylesheet" type="text/css" />
|
<link href="bower_components/pnotify/pnotify.history.css" media="all" rel="stylesheet" type="text/css" />
|
||||||
@ -49,6 +50,7 @@
|
|||||||
<script src="components/surveil/surveil.js"></script>
|
<script src="components/surveil/surveil.js"></script>
|
||||||
<script src="components/surveil/status.js"></script>
|
<script src="components/surveil/status.js"></script>
|
||||||
<script src="components/surveil/actions.js"></script>
|
<script src="components/surveil/actions.js"></script>
|
||||||
|
<script src="components/surveil/config.js"></script>
|
||||||
<script src="components/surveil/query.js"></script>
|
<script src="components/surveil/query.js"></script>
|
||||||
|
|
||||||
<script src="components/authentication/authentication.js"></script>
|
<script src="components/authentication/authentication.js"></script>
|
||||||
@ -69,6 +71,7 @@
|
|||||||
<script src="components/directive/tabpanel/tabpanel.js"></script>
|
<script src="components/directive/tabpanel/tabpanel.js"></script>
|
||||||
|
|
||||||
<!-- Table components -->
|
<!-- Table components -->
|
||||||
|
|
||||||
<script src="components/directive/actionbar/actionbar.js"></script>
|
<script src="components/directive/actionbar/actionbar.js"></script>
|
||||||
<script src="components/directive/actionbar/component_acknowledge/acknowledge.js"></script>
|
<script src="components/directive/actionbar/component_acknowledge/acknowledge.js"></script>
|
||||||
<script src="components/directive/actionbar/component_downtime/downtime.js"></script>
|
<script src="components/directive/actionbar/component_downtime/downtime.js"></script>
|
||||||
@ -79,6 +82,12 @@
|
|||||||
<script src="components/directive/table/table.js"></script>
|
<script src="components/directive/table/table.js"></script>
|
||||||
<script src="components/directive/table/cell_status_duration/cell_status_duration.js"></script>
|
<script src="components/directive/table/cell_status_duration/cell_status_duration.js"></script>
|
||||||
|
|
||||||
|
<script src="components/directive/table/cell_config_host/cell_config_host.js"></script>
|
||||||
|
<script src="components/directive/table/cell_config_host_address/cell_config_host_address.js"></script>
|
||||||
|
<script src="components/directive/table/cell_config_host_name/cell_config_host_name.js"></script>
|
||||||
|
<script src="components/directive/table/cell_config_host_register/cell_config_host_register.js"></script>
|
||||||
|
<script src="components/directive/table/cell_config_host_use/cell_config_host_use.js"></script>
|
||||||
|
|
||||||
<script src="components/directive/table/cell_status_event/cell_status_event.js"></script>
|
<script src="components/directive/table/cell_status_event/cell_status_event.js"></script>
|
||||||
<script src="components/directive/table/cell_status_event_event_type/cell_status_event_event_type.js"></script>
|
<script src="components/directive/table/cell_status_event_event_type/cell_status_event_event_type.js"></script>
|
||||||
<script src="components/directive/table/cell_status_event_output/cell_status_event_output.js"></script>
|
<script src="components/directive/table/cell_status_event_output/cell_status_event_output.js"></script>
|
||||||
@ -134,7 +143,7 @@
|
|||||||
<bansho-topbar ng-show="isAuthenticated"></bansho-topbar>
|
<bansho-topbar ng-show="isAuthenticated"></bansho-topbar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-view id="page" class="main" role="main"></div>
|
<main ng-view id="page" class="main" role="main"></main>
|
||||||
<footer class="footer" role="contentinfo"></footer>
|
<footer class="footer" role="contentinfo"></footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user