Module: check_mk
Branch: master
Commit: 3a8b06976fb2bd26d66d6491dedc1a5bfdf79fd8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a8b06976fb2bd…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed May 31 15:59:38 2017 +0200
4703 FIX Business intelligence: fixed various display and navigation bugs in timelines
page
<ul>
<li>Fixed from/until computation error</li>
<li>No longer hiding timewarped aggregations (BI aggregations at selected
timestamps)</li>
<li>Fixed missing/redundant navigation arrows in the timeline selection</li>
<li>Disabled support for multiple BI aggregations in timeline page. This feature
will be redesigned later on</li>
</ul>
Change-Id: I249221c1900eaf8b16c9b87f914c401ebb4a7e40
---
.werks/4703 | 18 ++++++++++++++++++
web/htdocs/availability.py | 8 ++++----
web/plugins/views/availability.py | 25 ++++++++++++++-----------
3 files changed, 36 insertions(+), 15 deletions(-)
diff --git a/.werks/4703 b/.werks/4703
new file mode 100644
index 0000000..e1bf8bf
--- /dev/null
+++ b/.werks/4703
@@ -0,0 +1,18 @@
+Title: Business intelligence: fixed various display and navigation bugs in timelines
page
+Level: 2
+Component: bi
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1496238693
+Class: fix
+
+
+<ul>
+<li>Fixed from/until computation error</li>
+<li>No longer hiding timewarped aggregations (BI aggregations at selected
timestamps)</li>
+<li>Fixed missing/redundant navigation arrows in the timeline selection</li>
+<li>Disabled support for multiple BI aggregations in timeline page. This feature
will be redesigned later on</li>
+</ul>
+
+
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index a7696ac..0e02842 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -1277,7 +1277,7 @@ def layout_availability_table(what, group_title, availability_table,
avoptions):
("av_host", host),
("av_service", service)])
else:
- timeline_url = html.makeuri([("av_mode", "timeline"),
("av_aggr_group", host), ("av_aggr_name", service)])
+ timeline_url = html.makeuri([("av_mode", "timeline"),
("av_aggr_group", host), ("aggr_name", service),
("view_name", "aggr_single")])
urls.append(( "timeline", _("Timeline"), timeline_url ))
if what != "bi":
urls.append(("history", _("Event History"),
history_url_of((site, host, service), time_range)))
@@ -1805,9 +1805,9 @@ def compute_bi_timelines(timeline_containers, time_range, timewarp,
phases_list)
timeline_container.tree_state))
timeline_container.tree_state = next_tree_state
- timeline_container.tree_time = tree_time
- if timewarp == tree_time:
- timeline_container.timewarp_state = tree_state
+ timeline_container.tree_time = from_time
+ if timewarp == timeline_container.tree_time:
+ timeline_container.timewarp_state = timeline_container.tree_state
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index f89d1ef..b7e3cb5 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -273,7 +273,6 @@ def do_render_availability(what, av_rawdata, av_data, av_mode,
av_object, avopti
def render_availability_tables(availability_tables, what, avoptions):
-
if not availability_tables:
html.message(_("No matching hosts/services."))
return
@@ -384,7 +383,6 @@ def render_timeline_legend(what):
def render_availability_table(group_title, availability_table, what, avoptions):
-
av_table = availability.layout_availability_table(what, group_title,
availability_table, avoptions)
# TODO: If summary line is activated, then sorting should now move that line to the
@@ -547,8 +545,8 @@ def render_bi_availability(title, aggr_rows):
has_reached_logrow_limit = False
timeline_containers, fetched_rows =
availability.get_timeline_containers(aggr_rows,
avoptions,
-
livestatus_limit,
-
timewarp)
+
timewarp,
+
livestatus_limit)
if livestatus_limit and fetched_rows > livestatus_limit:
has_reached_logrow_limit = True
@@ -558,7 +556,6 @@ def render_bi_availability(title, aggr_rows):
these_spans = timeline_container.timeline
timewarp_tree_state = timeline_container.timewarp_state
-
spans += these_spans
# render selected time warp for the corresponding aggregation row (should be
matched by only one)
@@ -588,18 +585,24 @@ def render_bi_availability(title, aggr_rows):
html.open_h3()
# render icons for back and forth
+ button_back_shown = False
+ button_forth_shown = False
if int(these_spans[0]["from"]) == timewarp:
html.disabled_icon_button("back_off")
- have_forth = False
+ button_back_shown = True
+
previous_span = None
for span in these_spans:
- if int(span["from"]) == timewarp and previous_span !=
None:
+ if not button_back_shown and int(span["from"]) ==
timewarp and previous_span != None:
html.icon_button(html.makeuri([("timewarp",
str(int(previous_span["from"])))]), _("Jump one phase back"),
"back")
- elif previous_span and int(previous_span["from"]) ==
timewarp and span != these_spans[-1]:
+ button_back_shown = True
+ # Multiple followup spans can have the same "from"
time
+ # We only show one forth-arrow with an actual time difference
+ elif not button_forth_shown and previous_span and
int(previous_span["from"]) == timewarp and int(span["from"]) !=
timewarp:
html.icon_button(html.makeuri([("timewarp",
str(int(span["from"])))]), _("Jump one phase forth"),
"forth")
- have_forth = True
+ button_forth_shown = True
previous_span = span
- if not have_forth:
+ if not button_forth_shown:
html.disabled_icon_button("forth_off")
html.write_text(" ")
@@ -615,7 +618,7 @@ def render_bi_availability(title, aggr_rows):
html.close_tr()
html.close_table()
- timewarpcode = html.drain()
+ timewarpcode += html.drain()
# Note: 'spans_by_object' returns two arguments which are used by
# all availability views but not by BI. There we have to take