Module: check_mk
Branch: master
Commit: 909d614f01ac527f166f65a04ad2336438c8fbfa
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=909d614f01ac52…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 20 11:31:38 2014 +0100
Updated bug entries #1008, #2193
---
.bugs/1008 | 7 +++++--
.bugs/2193 | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/.bugs/1008 b/.bugs/1008
index 0496e6e..02305a9 100644
--- a/.bugs/1008
+++ b/.bugs/1008
@@ -1,9 +1,9 @@
Title: dashboards: dashboard of a single hostgroup cannot be edited
Component: multisite
-State: open
+Class: bug
+State: works4me
Date: 2014-11-05 21:35:53
Targetversion: future
-Class: bug
after creating a dashboard for a single hostgroup, saving it and editing it
again, the following traceback occurs at the and and the dashboard cannot
@@ -34,3 +34,6 @@ Traceback (most recent call last):
File "/omd/sites/heute/share/check_mk/web/htdocs/visuals.py", line 854, in set_value
html.set_var(varname, value.get(varname))
AttributeError: 'unicode' object has no attribute 'get'
+
+2014-11-20 11:31:33: changed state open -> works4me
+Already fixed.
diff --git a/.bugs/2193 b/.bugs/2193
index 70f27d8..a1cf48a 100644
--- a/.bugs/2193
+++ b/.bugs/2193
@@ -1,10 +1,13 @@
Title: Dashboard: after going to a dashlet detail, edit mode is lost
Component: multisite
-State: open
+Class: nastiness
+State: works4me
Date: 2014-10-06 19:00:53
Targetversion: future
-Class: nastiness
When you are in dashboard edit mode and go to the details of a dashlet
and then got back - either by saving or by the back button - then the
edit mode of the dashboard is lost. But it should keep in edit mode.
+
+2014-11-20 11:26:10: changed state open -> works4me
+Unable to reproduce this. Already fixed.
Module: check_mk
Branch: master
Commit: 16da594edf2cb8d3d426ec14ef0a3427d55d4d64
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16da594edf2cb8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 20 11:37:02 2014 +0100
Fixed dashlet deletion after latest confirm dialog change
---
web/htdocs/dashboard.py | 2 +-
web/htdocs/htmllib.py | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 77cd07c..b8834b4 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -977,7 +977,7 @@ def page_delete_dashlet():
html.context_button(_('Back'), back_url, 'back')
html.end_context_buttons()
- result = html.confirm(_('Do you really want to delete this dashlet?'), method = 'GET')
+ result = html.confirm(_('Do you really want to delete this dashlet?'), method='GET', add_transid=True)
if result == False:
html.footer()
return # confirm dialog shown
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index d2f20ad..c43be21 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1128,7 +1128,12 @@ class html:
else:
return False
- def confirm(self, msg, method="POST", action=None):
+ # The confirm dialog is normally not a dialog which need to be protected
+ # by a transid itselfs. It is only a intermediate step to the real action
+ # But there are use cases where the confirm dialog is used during rendering
+ # a normal page, for example when deleting a dashlet from a dashboard. In
+ # such cases, the transid must be added by the confirm dialog.
+ def confirm(self, msg, method="POST", action=None, add_transid=False):
if self.var("_do_actions") == _("No"):
# User has pressed "No", now invalidate the unused transid
self.check_transaction()
@@ -1137,9 +1142,7 @@ class html:
if self.mobile:
self.write('<center>')
self.write("<div class=really>%s" % msg)
- # The confirm dialog is never a dialog which need to be protected
- # by a transid itselfs. It is only a intermediate step to the real action
- self.begin_form("confirm", method=method, action=action, add_transid=False)
+ self.begin_form("confirm", method=method, action=action, add_transid=add_transid)
self.hidden_fields(add_action_vars = True)
self.button("_do_confirm", _("Yes!"), "really")
self.button("_do_actions", _("No"), "")
Module: check_mk
Branch: master
Commit: 5f1dd7ed6bb7e58103bf9feaaf808b577b221a17
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f1dd7ed6bb7e5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 20 09:51:57 2014 +0100
#1527 FIX Fixed views missing values of some filters (serviceregex, hostgroup filters, ...)
With the rewrite of the views/dashboards/visuals we introduced a mechanism of transforming
views of the old format to the new format. This transform mechanism missed to transform
hard coded values of some filters where the variable names had been renamed.
The affected filters are:
'serviceregex'
'hostregex'
'hostgroupnameregex'
'servicegroupnameregex'
'opthostgroup'
'optservicegroup'
'hostgroup'
'servicegroup'
'host_contactgroup'
'service_contactgroup'
If you already have migrated to a previous release, which transformed your views and made
you miss these filters or hard coded values, you can install a version containing this
fix, remove the file <tt>var/check_mk/web/USER/user_views.mk</tt> from your site and then
access the Web-GUI again. This should fix the problem. Be aware: By removing the user_views.mk
all your changes to your views you made since the initial creation of the user_views.mk
will be reverted.
---
.werks/1527 | 31 +++++++++++++++++++++++++++++++
web/htdocs/views.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
diff --git a/.werks/1527 b/.werks/1527
new file mode 100644
index 0000000..502c88e
--- /dev/null
+++ b/.werks/1527
@@ -0,0 +1,31 @@
+Title: Fixed views missing values of some filters (serviceregex, hostgroup filters, ...)
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6p3
+Date: 1416473103
+Class: fix
+
+With the rewrite of the views/dashboards/visuals we introduced a mechanism of transforming
+views of the old format to the new format. This transform mechanism missed to transform
+hard coded values of some filters where the variable names had been renamed.
+
+The affected filters are:
+
+'serviceregex'
+'hostregex'
+'hostgroupnameregex'
+'servicegroupnameregex'
+'opthostgroup'
+'optservicegroup'
+'hostgroup'
+'servicegroup'
+'host_contactgroup'
+'service_contactgroup'
+
+If you already have migrated to a previous release, which transformed your views and made
+you miss these filters or hard coded values, you can install a version containing this
+fix, remove the file <tt>var/check_mk/web/USER/user_views.mk</tt> from your site and then
+access the Web-GUI again. This should fix the problem. Be aware: By removing the user_views.mk
+all your changes to your views you made since the initial creation of the user_views.mk
+will be reverted.
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 8601980..b6f0d13 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -171,6 +171,7 @@ def transform_old_views():
# The exact match filters have been removed. They where used only as
# link filters anyway - at least by the builtin views.
continue
+
for var in f.htmlvars:
# Check whether or not the filter is supported by the datasource,
# then either skip or use the filter vars
@@ -179,6 +180,56 @@ def transform_old_views():
all_vars[var] = value
context[filter_name][var] = value
+ # We changed different filters since the visuals-rewrite. This must be treated here, since
+ # we need to transform views which have been created with the old filter var names.
+ # Changes which have been made so far:
+ changed_filter_vars = {
+ 'serviceregex': { # Name of the filter
+ # old var name: new var name
+ 'service': 'service_regex',
+ },
+ 'hostregex': {
+ 'host': 'host_regex',
+ },
+ 'hostgroupnameregex': {
+ 'hostgroup_name': 'hostgroup_regex',
+ },
+ 'servicegroupnameregex': {
+ 'servicegroup_name': 'servicegroup_regex',
+ },
+ 'opthostgroup': {
+ 'opthostgroup': 'opthost_group',
+ 'neg_opthostgroup': 'neg_opthost_group',
+ },
+ 'optservicegroup': {
+ 'optservicegroup': 'optservice_group',
+ 'neg_optservicegroup': 'neg_optservice_group',
+ },
+ 'hostgroup': {
+ 'hostgroup': 'host_group',
+ 'neg_hostgroup': 'neg_host_group',
+ },
+ 'servicegroup': {
+ 'servicegroup': 'service_group',
+ 'neg_servicegroup': 'neg_service_group',
+ },
+ 'host_contactgroup': {
+ 'host_contactgroup': 'host_contact_group',
+ 'neg_host_contactgroup': 'neg_host_contact_group',
+ },
+ 'service_contactgroup': {
+ 'service_contactgroup': 'service_contact_group',
+ 'neg_service_contactgroup': 'neg_service_contact_group',
+ },
+ }
+
+ if filter_name in changed_filter_vars and f.info in datasource['infos']:
+ for old_var, new_var in changed_filter_vars[filter_name].items():
+ if old_var in filtervars:
+ value = filtervars[old_var]
+ all_vars[new_var] = value
+ context[filter_name][new_var] = value
+
# Now, when there are single object infos specified, add these keys to the
# context
for single_key in single_keys: