Module: check_mk
Branch: master
Commit: 016fd7c3537c87caed2246c3b87f98c26ce028a2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=016fd7c3537c87…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Jun 3 11:21:28 2012 +0200
ValueSpec ElementSelection: allow label and none-selection
---
web/htdocs/valuespec.py | 3 +++
web/htdocs/wato.py | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index a80f9ef..2b9a4c0 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1814,6 +1814,7 @@ class ElementSelection(ValueSpec):
def __init__(self, **kwargs):
ValueSpec.__init__(self, **kwargs)
self._loaded_at = None
+ self._label = kwargs.get("label")
def load_elements(self):
if self._loaded_at != id(html):
@@ -1833,6 +1834,8 @@ class ElementSelection(ValueSpec):
if len(self._elements) == 0:
html.write(_("There are not defined any elements for this selection yet."))
else:
+ if self._label:
+ html.write("%s " % self._label)
html.sorted_select(varprefix, self._elements.items(), value)
def value_to_text(self, value):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5e5be3e..b9e22dd 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5680,12 +5680,17 @@ class GroupSelection(ElementSelection):
def __init__(self, what, **kwargs):
ElementSelection.__init__(self, **kwargs)
self._what = what
+ # Allow to have "none" entry with the following title
+ self._no_selection = kwargs.get("no_selection")
def get_elements(self):
all_groups = load_group_information()
this_group = all_groups.get(self._what, {})
# replace the title with the key if the title is empty
- return dict([ (k, t and t or k) for (k, t) in this_group.items() ])
+ elements = [ (k, t and t or k) for (k, t) in this_group.items() ]
+ if self._no_selection:
+ elements.append((None, self._no_selection))
+ return dict(elements)
class CheckTypeGroupSelection(ElementSelection):
Module: check_mk
Branch: master
Commit: 37fe20df5bb9ce812566a76c739805fbfd0fa907
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=37fe20df5bb9ce…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Jun 3 12:20:50 2012 +0200
Change empty value for ElementSelection from None to ""
---
web/htdocs/wato.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b9e22dd..d73a59d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5689,7 +5689,9 @@ class GroupSelection(ElementSelection):
# replace the title with the key if the title is empty
elements = [ (k, t and t or k) for (k, t) in this_group.items() ]
if self._no_selection:
- elements.append((None, self._no_selection))
+ # Beware: ElementSelection currently can only handle string
+ # keys, so we cannot take 'None' as a value.
+ elements.append(('', self._no_selection))
return dict(elements)
Module: check_mk
Branch: master
Commit: ebdb2f48101114605beadca4e626915bb3812540
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ebdb2f48101114…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Jun 2 16:28:17 2012 +0200
FIX: preselected "refresh" option did not reflect view settings
---
ChangeLog | 6 ++++--
web/htdocs/views.py | 8 +++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 93992a3..32192bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-1.2.0b6
+1.2.0:
Multisite:
* FIX: Fixed layout of some dropdown fields in view filters
* Make heading in each page clickable -> reload page
@@ -7,9 +7,11 @@
* FIX: Fixed "select all" button for IE
* FIX: Context links added by hooks are now hidden by the display
option "B" again
+ * FIX: preselected "refresh" option did not reflect view settings
+ but was simply the first available option - usually 30.
WATO:
- * IX: Fixed "select all" button in hosts & folders for IE
+ * FIX: Fixed "select all" button in hosts & folders for IE
Core:
* FIX: Fixed "make_utf is not defined" error when having custom
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index c14eac0..7c2000b 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1534,7 +1534,13 @@ def view_linktitle(view):
def view_optiondial(view, option, choices, help):
vo = view_options(view["name"])
- value = vo.get(option, view.get(option, choices[0][0]))
+ # Darn: The option "refresh" has the name "browser_reload" in the
+ # view definition
+ if option == "refresh":
+ von = "browser_reload"
+ else:
+ von = option
+ value = vo.get(option, view.get(von, choices[0][0]))
title = dict(choices).get(value, value)
html.begin_context_buttons() # just to be sure
# Remove unicode strings
Module: check_mk
Branch: master
Commit: 06011b5ced51671a2e5a660808a544a73c8a7e33
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06011b5ced5167…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jun 1 21:44:46 2012 +0200
Updated bug entries #0729
---
.bugs/729 | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.bugs/729 b/.bugs/729
index a60815e..3f73a8d 100644
--- a/.bugs/729
+++ b/.bugs/729
@@ -1,8 +1,10 @@
Title: Its not no longer possible to modify views
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-05-31 13:15:37
Targetversion: 1.2.0
-Class: bug
Any view field that is not previously set, IE, any field that is currently set to “Don’t Use” can not be changed. The drop down menu is disabled….
+
+2012-06-01 21:44:15: changed state open -> done