Module: check_mk
Branch: master
Commit: fcd388419c819467a7898ccb3f2b21bfeb298fd9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fcd388419c8194…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 28 13:53:16 2011 +0200
FIX: filter for WATO file/folder was not always working.
---
ChangeLog | 1 +
web/plugins/views/wato.py | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d263ee1..529fb24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@
of Apache processes" problem!
* FIX: query crashed when sorting after a join columns without
an explicit title.
+ * FIX: filter for WATO file/folder was not always working.
1.1.12:
diff --git a/web/plugins/views/wato.py b/web/plugins/views/wato.py
index 4e296bb..63efdcf 100644
--- a/web/plugins/views/wato.py
+++ b/web/plugins/views/wato.py
@@ -39,10 +39,10 @@ class FilterWatoFile(Filter):
self.tree = wato.api.get_folder_tree()
self.path_to_tree = {} # will be filled by self.folder_selection
self.selection = self.folder_selection(self.tree, "", 0)
+ self.last_wato_data_update = time.time()
def check_wato_data_update(self):
- if not self.last_wato_data_update or time.time() - self.last_wato_data_update
> 30:
- self.last_wato_data_update = time.time()
+ if not self.last_wato_data_update or time.time() - self.last_wato_data_update
> 5:
self.load_wato_data()
def display(self):
@@ -57,11 +57,11 @@ class FilterWatoFile(Filter):
else:
return ""
+ # Construct pair-list of ( folder-path, title ) to be used
+ # by the HTML selection box. This also updates self._tree,
+ # a dictionary from the path to the title.
def folder_selection(self, folder, prefix, depth):
- if depth == 0:
- self.check_wato_data_update()
my_path = folder[".path"]
-
if depth:
title_prefix = " " * depth + "`
" + "- " * depth
else: