Module: check_mk
Branch: master
Commit: 844b63c7d3d2dc46078541bcddfe91eabf569829
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=844b63c7d3d2dc…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 17 11:07:17 2017 +0100
Some german translations and fixes in texts
Change-Id: Ic488820753eef934453748c6067cc736f3001959
---
web/htdocs/wato.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b90dceb..5b887d8 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3089,7 +3089,7 @@ class ModeDiscovery(WatoMode):
"disable them. If you are sure that they are just transitional, just leave them "
"until they vanish.")), # undecided
("vanished", True, _("Vanished services (monitored, but no longer exist)"),
- _("These service had been added to the monitoring by a previous discovery "
+ _("These services had been added to the monitoring by a previous discovery "
"but the actual items that are monitored are not present anymore. This might "
"be due to a real failure. In that case you should leave them in the monitoring. "
"If the actually monitored things are really not relevant for the monitoring "
@@ -3099,20 +3099,20 @@ class ModeDiscovery(WatoMode):
_("These services had been found by a discovery and are currently configured "
"to be monitored.")),
("ignored", True, _("Disabled services"),
- _("These services are being discovery but have been disabled by creating a rule "
- "in the rule set <i>Disabled service</i> oder <i>Disabled checks</i>.")),
+ _("These services are being discovered but have been disabled by creating a rule "
+ "in the rule set <i>Disabled services</i> oder <i>Disabled checks</i>.")),
("active", False, _("Active checks"),
- _("These service do not use the Check_MK agent or Check_MK-SNMP engine but actively "
+ _("These services do not use the Check_MK agent or Check_MK-SNMP engine but actively "
"call classical check plugins. They have been added by a rule in the section "
"<i>Active checks</i> or implicitely by Check_MK.")),
("manual", False, _("Manual checks"),
_("These services have not been found by the discovery but have been added "
- "manually by a rule in the WATO module <i>Manual checks</i>")),
+ "manually by a rule in the WATO module <i>Manual checks</i>.")),
("legacy", False, _("Legacy services (defined in main.mk)"),
- _("These services have been configured by the deprecated variable <i>legacy_check</i> "
+ _("These services have been configured by the deprecated variable <tt>legacy_checks</tt> "
"in <tt>main.mk</tt> or a similar configuration file.")),
("custom", False, _("Custom checks (defined via rule)"),
- _("These service do not use the Check_MK agent or Check_MK-SNMP engine but actively "
+ _("These services do not use the Check_MK agent or Check_MK-SNMP engine but actively "
"call a classical check plugin, that you have installed yourself.")),
("clustered_old", False, _("Monitored clustered services (located on cluster host)"),
_("These services have been found on this host but have been mapped to "
Module: check_mk
Branch: master
Commit: dcb6f27ad2fe2ecdc3bd4033c42823a7d1d9b9fc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dcb6f27ad2fe2e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 17 09:47:34 2017 +0100
Fixed sometimes broken snmp_communities link in host SNMP community help text
Change-Id: I79c067cb575216a609f87e3ca1575910d5512811
---
web/plugins/wato/builtin_attributes.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web/plugins/wato/builtin_attributes.py b/web/plugins/wato/builtin_attributes.py
index 338f515..360c981 100644
--- a/web/plugins/wato/builtin_attributes.py
+++ b/web/plugins/wato/builtin_attributes.py
@@ -184,7 +184,8 @@ declare_host_attribute(
"contacting this host via SNMP v1/v2 or v3. It is possible to configure the SNMP community by "
"using the <a href=\"%s\">SNMP Communities</a> ruleset, but when you configure "
"a community here, this will override the community defined by the rules.") % \
- html.makeuri([('mode', 'edit_ruleset'), ('varname', 'snmp_communities')]),
+ html.makeuri_contextless([('mode', 'edit_ruleset'), ('varname', 'snmp_communities')],
+ filename="wato.py"),
default_value = None,
)
),
Module: check_mk
Branch: master
Commit: 0919648e871dcd2f3740d89bbaacccd3723459f5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0919648e871dcd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 17 09:00:41 2017 +0100
4501 Bulk delete possible for bookmark lists, graph collections and custom graphs
A bulk deletion option has been added to the bookmark lists, graph collections and custom graphs.
A users own elements and elements of other users can now be deleted in bulk (if permitted).
Change-Id: I8dcea4745a755837b99d5f3cf3d7dce3f4d918dd
---
.werks/4501 | 11 +++++++++
web/htdocs/js/checkmk.js | 2 +-
web/htdocs/pagetypes.py | 61 ++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 69 insertions(+), 5 deletions(-)
diff --git a/.werks/4501 b/.werks/4501
new file mode 100644
index 0000000..4b13217
--- /dev/null
+++ b/.werks/4501
@@ -0,0 +1,11 @@
+Title: Bulk delete possible for bookmark lists, graph collections and custom graphs
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1489737551
+Class: feature
+
+A bulk deletion option has been added to the bookmark lists, graph collections and custom graphs.
+A users own elements and elements of other users can now be deleted in bulk (if permitted).
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 454d594..e003e14 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1624,7 +1624,7 @@ function iter_cells(checkbox, func) {
function get_all_checkboxes(container) {
var checkboxes = [];
- if(typeof(container) === 'object' && container.length) {
+ if(typeof(container) === 'object' && container.length && !container.tagName) {
// Array given - at the moment this is a list of TR objects
// Skip the header checkboxes
for(var i = 0; i < container.length; i++) {
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index c591fb7..3fb2216 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -824,6 +824,16 @@ class Overridable(Base):
html.write("<div class=error>%s</div>\n" % e.message)
html.add_user_error(e.varname, e.message)
+ # Bulk delete
+ if html.var("_bulk_delete_my") and html.transaction_valid():
+ if self._bulk_delete_after_confirm("my") == False:
+ html.footer()
+ return
+
+ elif html.var("_bulk_delete_foreign") and html.transaction_valid():
+ if self._bulk_delete_after_confirm("foreign") == False:
+ html.footer()
+ return
my_instances = []
foreign_instances = []
@@ -838,20 +848,30 @@ class Overridable(Base):
or instance.may_delete() or instance.may_edit():
foreign_instances.append(instance)
- for title, instances in [
- (_('Customized'), my_instances),
- (_('Owned by other users'), foreign_instances),
- (_('Builtin'), builtin_instances),
+
+ for what, title, instances in [
+ ("my", _('Customized'), my_instances),
+ ("foreign", _('Owned by other users'), foreign_instances),
+ ("builtin", _('Builtin'), builtin_instances),
]:
if not instances:
continue
html.write('<h3>' + title + '</h3>')
+ if what != "builtin":
+ html.begin_form("bulk_delete_%s" % what, method="POST")
+
table.begin(limit = None)
for instance in instances:
table.row()
+ if what != "builtin" and instance.may_delete():
+ table.cell(html.render_input("_toggle_group", type_="button",
+ class_="checkgroup", onclick="toggle_all_rows(this.form);",
+ value='X'), sortable=False, css="checkbox")
+ html.checkbox("_c_%s+%s+%s" % (what, instance.owner(), instance.name()))
+
# Actions
table.cell(_('Actions'), css = 'buttons visuals')
@@ -895,11 +915,44 @@ class Overridable(Base):
# TODO: Haeeh? Another custom columns
### if render_custom_columns:
### render_custom_columns(visual_name, visual)
+
table.end()
+ if what != "builtin":
+ html.button("_bulk_delete_%s" % what, _("Bulk delete"), "submit",
+ style="margin-top:10px")
+ html.hidden_fields()
+ html.end_form()
+
html.footer()
return
+
+ @classmethod
+ def _bulk_delete_after_confirm(cls, what):
+ to_delete = []
+ for varname in html.all_varnames_with_prefix("_c_%s+" % what):
+ if html.get_checkbox(varname):
+ checkbox_ident = varname.split("_c_%s+" % what)[-1]
+ to_delete.append(checkbox_ident.split("+", 1))
+
+ if not to_delete:
+ return
+
+ c = html.confirm(_("Do you really want to delete %d %s?") %
+ (len(to_delete), cls.phrase("title_plural")))
+
+ if c:
+ for owner, instance_id in to_delete:
+ cls.remove_instance((owner, instance_id))
+
+ for owner in set([ e[0] for e in to_delete]):
+ cls.save_user_instances(owner)
+
+ html.reload_sidebar()
+ elif c == False:
+ return False
+
# Override this in order to display additional columns of an instance
# in the table of all instances.
def render_extra_columns(self):