Module: check_mk
Branch: master
Commit: e4f470891fd33da08cc0a22ba6f86f40e6fe8778
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e4f470891fd33d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 25 11:03:52 2011 +0200
FIX: Some reload changes where lost in merge - somehow
---
web/htdocs/views.py | 45 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 3bf420a..56efde2 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1070,12 +1070,31 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
# If all display_options are upper case assume all not given values default
# to lower-case. Vice versa when all display_options are lower case.
# When the display_options are mixed case assume all unset options to be enabled
- do_defaults = display_options.isupper() and all_display_options.lower() or all_display_options
- for c in do_defaults:
- if c.lower() not in display_options.lower():
- display_options += c
+ def apply_display_option_defaults(opts):
+ do_defaults = opts.isupper() and all_display_options.lower() or all_display_options
+ for c in do_defaults:
+ if c.lower() not in opts.lower():
+ opts += c
+ return opts
+
+ display_options = apply_display_option_defaults(display_options)
+ # Add the display_options to the html object for later linking etc.
html.display_options = display_options
+ # This is needed for letting only the data table reload. The problem is that
+ # the data table is re-fetched via javascript call using special display_options
+ # but these special display_options must not be used in links etc. So we use
+ # a special var _display_options for defining the display_options for rendering
+ # the data table to be reloaded. The contents of "display_options" are used for
+ # linking to other views.
+ if html.has_var('_display_options'):
+ display_options = html.var("_display_options", "")
+ display_options = apply_display_option_defaults(display_options)
+
+ # Below we have the following display_options vars:
+ # htmk.display_options - Use this when rendering the current view
+ # html.var("display_options") - Use this for linking to other views
+
# If display option 'M' is set, then all links are targetet to the 'main'
# frame. Also the display options are removed since the view in the main
# frame should be displayed in standard mode.
@@ -1216,7 +1235,7 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
# Show heading (change between "preview" mode and full page mode)
if show_heading:
# Show/Hide the header with page title, MK logo, etc.
- if 'H' in display_options:
+ if 'H' in display_options:
html.body_start(view_title(view))
if 'T' in display_options:
html.top_heading(view_title(view))
@@ -1227,10 +1246,10 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
show_context_links(view, hide_filters)
need_navi = show_buttons and (
- 'D' in display_options or
- 'F' in display_options or
- 'C' in display_options or
- 'O' in display_options or
+ 'D' in display_options or
+ 'F' in display_options or
+ 'C' in display_options or
+ 'O' in display_options or
'E' in display_options)
if need_navi:
html.write("<table class=navi><tr>\n")
@@ -1326,6 +1345,9 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
# Ende des Bereichs mit den Tabs
html.write("</table>\n") # class=navi
+ # The refreshing content container
+ if 'R' in display_options:
+ html.write("<div id=data_container>\n")
if not has_done_actions:
# Limit exceeded? Show warning
@@ -1343,6 +1365,10 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
for sitename, info in html.live.deadsites.items():
html.show_error("<b>%s - Livestatus error</b><br>%s" % (info["site"]["alias"], info["exception"]))
+ # FIXME: Sauberer wäre noch die Status Icons hier mit aufzunehmen
+ if 'R' in display_options:
+ html.write("</div>\n")
+
if show_footer:
pid = os.getpid()
if html.live.successfully_persisted():
@@ -1353,6 +1379,7 @@ def show_view(view, show_heading = False, show_buttons = True, show_footer = Tru
html.bottom_focuscode()
if 'Z' in display_options:
html.bottom_footer()
+
if 'H' in display_options:
html.body_end()
Module: check_mk
Branch: master
Commit: b2de150d80321a3edc8c0c5261ff66490149eb38
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2de150d80321a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 25 09:28:39 2011 +0200
Added temporary workaround for not updated WATO titles in status GUIs
---
web/plugins/views/wato.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/web/plugins/views/wato.py b/web/plugins/views/wato.py
index 4d9bba6..827c13b 100644
--- a/web/plugins/views/wato.py
+++ b/web/plugins/views/wato.py
@@ -30,6 +30,9 @@ import wato
class FilterWatoFile(Filter):
def __init__(self):
Filter.__init__(self, "filename", "WATO Folder/File", "host", ["filename"], [])
+ self.load_wato_data()
+
+ def load_wato_data(self):
self.tree = wato.api.get_folder_tree()
self.path_to_tree = {} # keep mapping from string-paths to folders/files
self.selection = self.folder_selection(self.tree, "", 0)
@@ -68,6 +71,14 @@ class FilterWatoFile(Filter):
return sel
def heading_info(self, info):
+ # FIXME: There is a problem with caching data and changing titles of WATO files
+ # Everything is changed correctly but the filter object is stored in the
+ # global multisite_filters var and self.path_to_tree is not refreshed when
+ # rendering this title. Thus the threads might have old information about the
+ # file titles and so on.
+ # The call below needs to use some sort of indicator wether the cache needs
+ # to be renewed or not.
+ self.load_wato_data()
current = html.var(self.name)
if current and current != "/":
return self.path_to_tree.get(current)
Module: check_mk
Branch: master
Commit: ce069bdf287f6ca8f1bbee8d7ccd82086e28c791
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce069bdf287f6c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Aug 25 10:24:29 2011 +0200
Fixed ChangeLog
---
ChangeLog | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4d18dd4..214340e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
* FIX: WATO filtered status GUIs did not update the title after changing
the title of the file/folder in WATO
* FIX: Removed new python syntax which is incompatible with old python versions
+ * Views are not reloaded completely anymore. The data tables are reloaded
+ on their own.
1.1.11i3:
Core, Setup, etc.:
@@ -68,8 +70,6 @@
* Added several missing i18n strings in view editor
* Views can now be sorted by the users by clicking on the table headers.
The user sort options are not persisted.
- * Views are not reloaded completely anymore. The data tables are reloaded
- on their own.
* Perf-O-Meters are now aware if there really is a PNP graph
WATO: