From dd0db2a0dcadbe0bd8f58b3b66178f6ba1ecc219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Vachon?= Date: Mon, 23 Mar 2015 17:00:42 -0400 Subject: [PATCH] Implemented Open problems and All problems of dashboard view --- app/components/config/config.json | 65 +++++++++++++++++++ .../cell_host_status/cell_host_status.js | 4 +- .../table/cell_hosts_host/cell_hosts_host.js | 4 +- app/components/table/table.js | 5 +- app/dashboard/dashboard.html | 33 ++++++++-- 5 files changed, 98 insertions(+), 13 deletions(-) diff --git a/app/components/config/config.json b/app/components/config/config.json index f3247ae..ffeab98 100644 --- a/app/components/config/config.json +++ b/app/components/config/config.json @@ -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": { diff --git a/app/components/table/cell_host_status/cell_host_status.js b/app/components/table/cell_host_status/cell_host_status.js index 0e40186..0560306 100644 --- a/app/components/table/cell_host_status/cell_host_status.js +++ b/app/components/table/cell_host_status/cell_host_status.js @@ -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"; } } }]) diff --git a/app/components/table/cell_hosts_host/cell_hosts_host.js b/app/components/table/cell_hosts_host/cell_hosts_host.js index 0be8a79..1f82021 100644 --- a/app/components/table/cell_hosts_host/cell_hosts_host.js +++ b/app/components/table/cell_hosts_host/cell_hosts_host.js @@ -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'; } }]) diff --git a/app/components/table/table.js b/app/components/table/table.js index d30a402..335fb6d 100644 --- a/app/components/table/table.js +++ b/app/components/table/table.js @@ -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(' "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) { diff --git a/app/dashboard/dashboard.html b/app/dashboard/dashboard.html index 974d048..6ad534d 100644 --- a/app/dashboard/dashboard.html +++ b/app/dashboard/dashboard.html @@ -42,7 +42,7 @@

{{dashboardTables[0].title}}

There are {{nbHostProblems}} host problems.

- + - -

{{dashboardTables[1].title}}

There are {{nbHostProblems}} host problems.

-
-

{{dashboardTables[1].title}}

+

{{dashboardTables[2].title}}

There are {{nbHostProblems}} host problems.

- + + + +
+

{{dashboardTables[3].title}}

+

There are {{nbHostProblems}} host problems.

+
+ +

Pas de tableaux encore pour All problems.