Module: check_mk
Branch: master
Commit: faeae7a7e7f2da215fa73f25a1fcacba7f52f8e8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=faeae7a7e7f2da…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 18 09:41:56 2015 +0200
Allow option for visual levels in availability in reports
---
web/htdocs/availability.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index d0c0fc8..fb0d34e 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -32,10 +32,19 @@
#### Reporting abbilden.
import bi, views
-# TODO: Get rid of views
+# TODO: Get rid of import of views
# from lib import *
from valuespec import *
+# .--Declarations--------------------------------------------------------.
+# | ____ _ _ _ |
+# | | _ \ ___ ___| | __ _ _ __ __ _| |_(_) ___ _ __ ___ |
+# | | | | |/ _ \/ __| |/ _` | '__/ _` | __| |/ _ \| '_ \/ __| |
+# | | |_| | __/ (__| | (_| | | | (_| | |_| | (_) | | | \__ \ |
+# | |____/ \___|\___|_|\__,_|_| \__,_|\__|_|\___/|_| |_|___/ |
+# | |
+# '----------------------------------------------------------------------'
+
host_availability_columns = [
( "up", "state0",
_("UP"), None ),
( "down", "state2",
_("DOWN"), None ),
@@ -237,7 +246,7 @@ avoption_entries = [
# Visual levels for the availability
( "av_levels",
"double",
- False,
+ True,
Optional(
Tuple(
elements = [
@@ -934,7 +943,7 @@ def layout_availability_table(what, group_title, availability_table,
avoptions):
# Summary line. It has the same format as each entry in cells
- if show_summary:
+ if show_summary and len(availability_table) > 0:
summary_cells = []
for sid, css, sname, help in availability_columns[what]: