Module: check_mk
Branch: master
Commit: bb868d2739579764042abfa50349af1ced4e9483
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bb868d27395797…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed May 13 12:59:00 2015 +0200
Again, and now hopefully final fix for availability on host/service group views
---
web/htdocs/views.py | 8 ++++++++
web/htdocs/visuals.py | 12 ------------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 300ff4d..6971260 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -948,6 +948,14 @@ def show_view(view, show_heading = False, show_buttons = True,
# have a hardcoded value are not changeable by the user
show_filters = visuals.visible_filters_of_visual(view, use_filters)
+ # FIXME TODO HACK to make grouping single contextes possible on host/service infos
+ # Is hopefully cleaned up soon.
+ if view['datasource'] in ['hosts', 'services']:
+ if 'hostgroup' in view['single_infos']:
+ html.set_var('opthost_group', html.var('hostgroup'))
+ if 'servicegroup' in view['single_infos']:
+ html.set_var('optservice_group', html.var('servicegroup'))
+
# Now populate the HTML vars with context vars from the view definition. Hard
# coded default values are treated differently:
#
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index fc64769..3b4cda3 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -967,10 +967,6 @@ def visible_filters_of_visual(visual, use_filters):
return show_filters
-def apply_link_filter_vars_to_uri_vars(visual, info_keys, link_filters):
- for src_key, dst_key in get_link_filter_names(visual, info_keys, link_filters):
- html.set_var(dst_key, html.var(src_key))
-
def add_context_to_uri_vars(visual, only_infos=None, only_count=False):
if only_infos == None:
only_infos = infos.keys() # all datasources!
@@ -1322,14 +1318,6 @@ def collect_context_links_of(visual_type_name, this_visual,
active_filter_vars,
break
vars_values.append((var, val))
- # See get_link_filter_names() comment for details. TODO Hack for host/service
- # views with single hostgroup context. Will be cleaned up soon. hopefully
- if visual.get('datasource') in ['hosts', 'services']:
- if 'hostgroup' in visual['single_infos']:
- vars_values.append(('opthost_group',
html.var('hostgroup')))
- if 'servicegroup' in visual['single_infos']:
- vars_values.append(('optservice_group',
html.var('servicegroup')))
-
if not skip:
# add context link to this visual. For reports we put in
# the *complete* context, even the non-single one.