Module: check_mk
Branch: master
Commit: 69cde2121fa75d1b3c213446727e020f2ba2cd0c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69cde2121fa75d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 3 14:24:07 2016 +0100
Set focus to title, not to ID when creating new page types
---
web/htdocs/forms.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index 0256951..81fdcd7 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -188,7 +188,10 @@ def edit_valuespec(vs, value, buttontext=None, method="GET", varprefix="",
html.button("save", buttontext)
html.del_var("filled_in") # Should be ignored be hidden_fields, but I do not dare to change it there
html.hidden_fields()
- vs.set_focus(varprefix)
+ if focus:
+ html.set_focus(focus)
+ else:
+ vs.set_focus(varprefix)
html.end_form()
# New functions for painting forms
Module: check_mk
Branch: master
Commit: d8aee146a37ab301b22cd77ca7b0df7ecdc0cb40
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8aee146a37ab3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 3 14:24:43 2016 +0100
Allow to continue to a detail page after creating a new page
---
web/htdocs/pagetypes.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index a9d8da1..7766e83 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -475,6 +475,9 @@ class Overridable:
def list_url(self):
return "%ss.py" % self.type_name()
+ def after_create_url(self):
+ return None # where redirect after a create should go
+
@classmethod
def context_button_list(self):
html.context_button(self.phrase("title_plural"), self.list_url(), self.type_name())
@@ -901,7 +904,7 @@ class Overridable:
if page:
raise MKUserError("_p_name", _("You already have an element with the ID <b>%s</b>") % page_dict["name"])
- new_page_dict = forms.edit_valuespec(vs, page_dict, validate=validate)
+ new_page_dict = forms.edit_valuespec(vs, page_dict, validate=validate, focus="_p_title")
if new_page_dict != None:
# Take over keys from previous value that are specific to the page type
# and not edited here.
@@ -915,7 +918,12 @@ class Overridable:
self.add_page(new_page)
self.save_user_instances(owner)
- html.immediate_browser_redirect(1, back_url)
+ if mode == "create":
+ redirect_url = new_page.after_create_url() or back_url
+ else:
+ redirect_url = back_url
+
+ html.immediate_browser_redirect(0.5, redirect_url)
html.message(_('Your changes haven been saved.'))
# Reload sidebar.TODO: This code logically belongs to PageRenderer. How
# can we simply move it there?
Module: check_mk
Branch: master
Commit: 6b7c667e710cfb13b2cc289f66f940c82a9b7938
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b7c667e710cfb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 3 13:53:25 2016 +0100
#3044 FIX Fixed garbled notifications page on page reload after an action has been performed
---
.werks/3044 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 5 ++---
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/.werks/3044 b/.werks/3044
new file mode 100644
index 0000000..46af05f
--- /dev/null
+++ b/.werks/3044
@@ -0,0 +1,9 @@
+Title: Fixed garbled notifications page on page reload after an action has been performed
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1454503973
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index a2ca644..dfc3ca8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -332,6 +332,7 @@
* 2928 FIX: Fix display of rule set Do hardware/software Inventory...
* 3036 FIX: Bulk discovery steps are now timing out short before HTTP request timeout...
* 3038 FIX: Fixed invalid error message when creating service group assignment rule without having service groups
+ * 3044 FIX: Fixed garbled notifications page on page reload after an action has been performed
Notifications:
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4292824..80b0abb 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7722,19 +7722,16 @@ def mode_notifications(phase):
if html.check_transaction():
options["show_user_rules"] = not not html.var("_show_user")
config.save_user_file("notification_display_options", options)
- return
elif html.has_var("_show_backlog"):
if html.check_transaction():
options["show_backlog"] = not not html.var("_show_backlog")
config.save_user_file("notification_display_options", options)
- return
elif html.has_var("_show_bulks"):
if html.check_transaction():
options["show_bulks"] = not not html.var("_show_bulks")
config.save_user_file("notification_display_options", options)
- return
elif html.has_var("_replay"):
if html.check_transaction():
@@ -7745,6 +7742,8 @@ def mode_notifications(phase):
else:
return generic_rule_list_actions(rules, "notification", _("notification rule"), save_notification_rules)
+ return
+
# Check setting of global notifications. Are they enabled? If not, display
# a warning here. Note: this is a main.mk setting, so we cannot access this
Module: check_mk
Branch: master
Commit: 929dcead152033a089cc92947dc9b111eae5a5a9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=929dcead152033…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 3 13:46:45 2016 +0100
Fixed multiple issues in various check parameter rules for configuring averaging
---
web/plugins/wato/check_parameters.py | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index fed6378..ff4aa9a 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -422,8 +422,9 @@ register_check_parameters(
title = _("Averaging"),
help = _("When this option is activated then the block rate is being "
"averaged <b>before</b> the levels are being applied."),
- unit = _("min"),
+ unit = _("minutes"),
default_value = 3,
+ minvalue = 1,
label = _("Compute average over last "),
)),
],
@@ -490,8 +491,9 @@ register_check_parameters(
help = _("When this option is activated then the packet rates are being "
"averaged <b>before</b> the levels are being applied. Setting this to zero will "
"deactivate averaging."),
- unit = _("min"),
+ unit = _("minutes"),
default_value = 3,
+ minvalue = 1,
label = _("Compute average over last "),
)),
( "fragment",
@@ -3946,7 +3948,7 @@ register_check_parameters(
"errors and traffic are applied to the averaged value. That "
"way you can make the check react only on long-time changes, "
"not on one-minute events."),
- label = _("minutes"),
+ unit = _("minutes"),
minvalue = 1,
)
),
@@ -5010,7 +5012,8 @@ register_check_parameters(
title = _("Averaging"),
help = _("When this option is activated then the CPU utilization is being "
"averaged <b>before</b> the levels are being applied."),
- unit = "min",
+ unit = _("minutes"),
+ minvalue = 1,
default_value = 15,
label = _("Compute average over last "),
)),
@@ -5928,7 +5931,9 @@ register_check_parameters(
"of the disk throughput is computed and the levels for read "
"and write will be applied to the average instead of the current "
"value."),
- unit = "min"))
+ minvalue = 1,
+ default_value = 5,
+ unit = _("minutes")))
]),
TextAscii(
title = _("Instance"),
@@ -6815,7 +6820,9 @@ register_check_parameters(
"of the disk throughput is computed and the levels for read "
"and write will be applied to the average instead of the current "
"value."),
- unit = "min")),
+ default_value = 5,
+ minvalue = 1,
+ unit = _("minutes"))),
( "latency",
Tuple(
title = _("IO Latency"),