Module: check_mk
Branch: master
Commit: eb726e2bbeda3ebabe82d950e2f16394a8fe342a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eb726e2bbeda3e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 10 12:48:35 2014 +0200
Fix links to views in group headers
this comment removes some code that seems to
be useless.
---
web/htdocs/views.py | 24 ++++++++++++++++++++----
web/htdocs/visuals.py | 20 +++++++++++---------
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index e0b6b0e..d81eb5b 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1971,10 +1971,26 @@ def link_to_view(content, row, view_name):
for info_key in datasource['infos']:
if info_key in view['single_infos']:
for key in visuals.info_params(info_key):
- vars += visuals.get_filter(key).variable_settings(row)
-
- else:
- vars +=
visuals.VisualFilterList([info_key]).filter_variable_settings(view['context'],
row)
+ filter_object = visuals.get_filter(key)
+ new_vars = filter_object.variable_settings(row)
+ vars += new_vars
+
+ # FIXME: WDTCD (What Does This Contraption Do)?
+ # Brauchen wir das hier? Aktuell macht das ein Problem: Wenn man in der View
"allservices"
+ # auf einen Gruppenkopf klickt - den Hostnamen, dann steckt in der Row der
komplette Datensatz
+ # zum ersten Service der Gruppe. Die new_vars erzeugen daraufhin einen Filter
mit service_regex
+ # mit dem ersten Service. In der Zielview bekommt man dann nur noch einen
Service zu sehen,
+ # und nicht alle von dem Host. Außerdem: VisualFilterList ist ein ValueSpec -
zum Editieren
+ # von Daten durch den Benutzer. Sollte das hier mißbraucht werden für ganz
andere Zwecke?
+ ## else:
+ ## new_vars =
visuals.VisualFilterList([info_key]).filter_variable_settings(view['context'],
row)
+ ## if "service_regex" in dict(new_vars):
+ ## html.debug("VIEW-Titel", view["title"])
+ ## html.debug('CONTEXT', view["context"])
+ ## html.debug("NEW", new_vars)
+ ## html.debug("row", row)
+ ## raise 9
+ ## vars += new_vars
do = html.var("display_options")
if do:
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 1a2b118..1f76acd 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -1009,15 +1009,17 @@ class VisualFilterList(ListOfMultiple):
# get the filters to be used from the value and the data from the filter
# objects using the row data
- def filter_variable_settings(self, value, row):
- vars = []
- for fname in value.keys():
- try:
- vars += self._filters[fname].variable_settings(row)
- except KeyError:
- # When the row misses at least one var for a filter ignore this filter
completely
- pass
- return vars
+ ## FIXME: This function does not deal with user input. It is just being
+ ## used for creating links to views. Why is it here?
+ ## def filter_variable_settings(self, value, row):
+ ## vars = []
+ ## for fname in value.keys():
+ ## try:
+ ## vars += self._filters[fname].variable_settings(row)
+ ## except KeyError:
+ ## # When the row misses at least one var for a filter ignore this filter
completely
+ ## pass
+ ## return vars
# Realizes a Multisite/visual filter in a valuespec. It can render the filter form, get
# the filled in values and provide the filled in information for persistance.