Implemented Open problems and All problems of dashboard view

This commit is contained in:
Frédéric Vachon 2015-03-23 17:00:42 -04:00
parent b9413c3cff
commit dd0db2a0dc
5 changed files with 98 additions and 13 deletions

View File

@ -15,6 +15,71 @@
}
}
},
{
"type": "table",
"config": {
"title": "Hosts",
"cells": {
"text": [
"Host",
"Address",
"Duration",
"Last check",
"Host status"
],
"name": [
"hosts_host",
"host_address",
"duration",
"last_check",
"host_status"
]
},
"apiName": "hosts",
"additionnalQueryFields": {
"acknowledged": 0,
"state": 1
},
"isWrappable" : false,
"noRepeatCell" : ""
}
},
{
"type": "table",
"config": {
"title": "Service problems",
"cells": {
"text": [
"Host",
"Service check",
"Duration",
"Last check"
],
"name": [
"host",
"service_check",
"duration",
"last_check"
]
},
"apiName": "services",
"filters": {
"isnot": {
"state": [
"0"
],
"host_state": [
"2"
]
}
},
"additionnalQueryFields": {
"acknowledged": 0
},
"isWrappable" : true,
"noRepeatCell" : "host"
}
},
{
"type": "table",
"config": {

View File

@ -16,9 +16,9 @@ angular.module('adagios.table.cell_host_status', ['adagios.table'])
$scope.alert_level = "alert alert-danger";
if ($scope.entry.childs.length !== 0) {
$scope.entry.host_status = "Network outage";
} else {
$scope.entry.host_status = "Host down";
} else {
$scope.entry.host_status = "Network outage";
}
}
}])

View File

@ -6,11 +6,11 @@ angular.module('adagios.table.cell_hosts_host', ['adagios.table'])
if ($scope.entry.state === 0) {
$scope.state = 'state--ok';
} else if ($scope.entry.state === 1) {
$scope.state = 'state--warning';
$scope.state = 'state--error';
} else if ($scope.entry.state === "") {
$scope.state = '';
} else {
$scope.state = 'state--error';
$scope.state = 'state--unreachable';
}
}])

View File

@ -22,7 +22,6 @@ angular.module('adagios.table', ['adagios.live',
getData,
i;
$scope.cellsName = conf.cells.name;
$scope.cellsText = conf.cells.text;
$scope.cellIndexes = [];
@ -66,7 +65,8 @@ angular.module('adagios.table', ['adagios.live',
compile: function () {
return function (scope, element, attrs) {
var conf;
var template = 'components/table/table.html',
conf;
if (!attrs.cellsText || !attrs.cellsName || !attrs.apiName || !attrs.isWrappable) {
throw new Error('<adg-table> "cells-text", "cells-name", "api-name"'
@ -100,7 +100,6 @@ angular.module('adagios.table', ['adagios.live',
tableConfig.refreshInterval = attrs.refreshInterval;
}
var template = 'components/table/table.html';
$http.get(template, { cache: true })
.success(function (data) {

View File

@ -42,7 +42,7 @@
<h2 class="main__content__title">{{dashboardTables[0].title}}</h2>
<p class="main__content__alert state--error">There are {{nbHostProblems}} host problems.</p>
</header>
<adg-table cells-text="{{dashboardTables[0].CellsText}}"
cells-name="{{dashboardTables[0].CellsName}}"
api-name="{{dashboardTables[0].ApiName}}"
@ -50,16 +50,14 @@
is-wrappable="{{dashboardTables[0].IsWrappable}}"
no-repeat-cell="{{dashboardTables[0].NoRepeatCell}}"
refresh-interval="{{dashboardRefreshInterval}}"
additionnal-query-fields="{{dashboardTables[0].additionnalQueryFields}}"
table-id="0"></adg-table>
</div>
<div role="tabpanel" class="problems tab-pane active" id="openProblems">
<header class="main__content__header clearfix">
<h2 class="main__content__title">{{dashboardTables[1].title}}</h2>
<p class="main__content__alert state--error">There are {{nbHostProblems}} host problems.</p>
</header>
<adg-table cells-text="{{dashboardTables[1].CellsText}}"
cells-name="{{dashboardTables[1].CellsName}}"
api-name="{{dashboardTables[1].ApiName}}"
@ -67,16 +65,39 @@
is-wrappable="{{dashboardTables[1].IsWrappable}}"
no-repeat-cell="{{dashboardTables[1].NoRepeatCell}}"
refresh-interval="{{dashboardRefreshInterval}}"
additionnal-query-fields="{{dashboardTables[1].additionnalQueryFields}}"
table-id="1"></adg-table>
</div>
<div role="tabpanel" class="problems tab-pane" id="allProblems">
<header class="main__content__header clearfix">
<h2 class="main__content__title">{{dashboardTables[1].title}}</h2>
<h2 class="main__content__title">{{dashboardTables[2].title}}</h2>
<p class="main__content__alert state--error">There are {{nbHostProblems}} host problems.</p>
</header>
<adg-table cells-text="{{dashboardTables[2].CellsText}}"
cells-name="{{dashboardTables[2].CellsName}}"
api-name="{{dashboardTables[2].ApiName}}"
filters="{{dashboardTables[2].Filters}}"
is-wrappable="{{dashboardTables[2].IsWrappable}}"
no-repeat-cell="{{dashboardTables[2].NoRepeatCell}}"
refresh-interval="{{dashboardRefreshInterval}}"
table-id="2"></adg-table>
<header class="main__content__header clearfix">
<h2 class="main__content__title">{{dashboardTables[3].title}}</h2>
<p class="main__content__alert state--error">There are {{nbHostProblems}} host problems.</p>
</header>
<adg-table cells-text="{{dashboardTables[3].CellsText}}"
cells-name="{{dashboardTables[3].CellsName}}"
api-name="{{dashboardTables[3].ApiName}}"
filters="{{dashboardTables[3].Filters}}"
is-wrappable="{{dashboardTables[3].IsWrappable}}"
no-repeat-cell="{{dashboardTables[3].NoRepeatCell}}"
refresh-interval="{{dashboardRefreshInterval}}"
table-id="3"></adg-table>
<p>Pas de tableaux encore pour All problems.</p>
</div>
</div>