lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
January 2016
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
9 participants
303 discussions
Start a n
N
ew thread
Metrics table now contains links for adding these to custom graphs
by Mathias Kettner
Module: check_mk Branch: master Commit: 44a658f93c1a55825f34c50e5b7ba0559dc2c34d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44a658f93c1a55…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 23:42:41 2016 +0100 Metrics table now contains links for adding these to custom graphs --- web/htdocs/metrics.py | 16 +++++++++++++++- web/htdocs/pagetypes.py | 5 +++++ web/htdocs/views.css | 6 ------ web/plugins/views/painters.py | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py index 6fe5679..7ed4f70 100644 --- a/web/htdocs/metrics.py +++ b/web/htdocs/metrics.py @@ -1407,13 +1407,27 @@ def host_service_graph_dashlet_pnp(site, host_name, service_description, source) # | Renders a simple table with all metrics of a host or service | # '----------------------------------------------------------------------' -def render_metrics_table(translated_metrics): +def render_metrics_table(translated_metrics, host_name, service_description): output = "<table class=metricstable>" for metric_name, metric in sorted(translated_metrics.items(), cmp=lambda a,b: cmp(a[1]["title"], b[1]["title"])): output += "<tr>" output += "<td class=color><div class=color style=\"background-color: %s\"></div></td>" % metric["color"] output += "<td>%s:</td>" % metric["title"] output += "<td class=value>%s</td>" % metric["unit"]["render"](metric["value"]) + if cmk_graphs_possible(): + output += "<td>" + output += html.render_popup_trigger( + html.render_icon("custom_graph", help=_("Add this metric to a custom graph"), cssclass="iconbutton"), + ident = "add_metric_to_graph_" + host_name + ";" + service_description, + what = "add_metric_to_custom_graph", + url_vars = [ + ("host", host_name), + ("service", service_description), + ("metric", metric_name), + ("back_url", "HIRN MIST TODO"), + ] + ) + output += "</td>" output += "</tr>" output += "</table>" return output diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py index 1b56ef9..37e2d51 100644 --- a/web/htdocs/pagetypes.py +++ b/web/htdocs/pagetypes.py @@ -354,6 +354,11 @@ class PageRenderer: class Overridable: @classmethod + def sanitize(self, d): + d.setdefault("public", False) + + + @classmethod def parameters(self, clazz): if clazz.has_overriding_permission("publish"): return [( _("General Properties"), [ diff --git a/web/htdocs/views.css b/web/htdocs/views.css index 9d233df..a3aeee6 100644 --- a/web/htdocs/views.css +++ b/web/htdocs/views.css @@ -805,9 +805,3 @@ td.if_state.if_not_available { color: black; background-color: #cccccc; } - -/* metrics table in painter svc_metrics */ -table.metricstable td.value { - padding-left: 10px; - text-align: right; -} diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py index 702aa05..72e1c01 100644 --- a/web/plugins/views/painters.py +++ b/web/plugins/views/painters.py @@ -530,7 +530,7 @@ multisite_painters["svc_perf_data"] = { def paint_service_metrics(row): translated_metrics = metrics.translate_metrics(*metrics.parse_perf_data(row["service_perf_data"], row["service_check_command"])) - return "", metrics.render_metrics_table(translated_metrics) + return "", metrics.render_metrics_table(translated_metrics, row["host_name"], row["service_description"]) multisite_painters["svc_metrics"] = { "title" : _("Service Metrics"),
8 years, 7 months
1
0
0
0
#2929 Show all metrics of a service in a nicely formatted table in the service details
by Mathias Kettner
Module: check_mk Branch: master Commit: 210890aa7b79882a6fb7efbef767bf01de030e85 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=210890aa7b7988…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 22:20:22 2016 +0100 #2929 Show all metrics of a service in a nicely formatted table in the service details --- .werks/2929 | 9 +++++++++ ChangeLog | 1 + web/htdocs/metrics.py | 24 ++++++++++++++++++++++++ web/htdocs/views.css | 6 ++++++ web/plugins/views/builtin.py | 3 ++- web/plugins/views/painters.py | 15 ++++++++++++++- 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/.werks/2929 b/.werks/2929 new file mode 100644 index 0000000..71b24cf --- /dev/null +++ b/.werks/2929 @@ -0,0 +1,9 @@ +Title: Show all metrics of a service in a nicely formatted table in the service details +Level: 1 +Component: multisite +Compatible: compat +Version: 1.2.7i4 +Date: 1454275199 +Class: feature + + diff --git a/ChangeLog b/ChangeLog index b4693ea..66b8167 100644 --- a/ChangeLog +++ b/ChangeLog @@ -241,6 +241,7 @@ * 2768 SHowing number of unacknowledged incompatible changes in sidebar header * 2769 Verifying that the Check_MK GUI is not used with Apache threaded MPM (e.g. worker) * 2880 Automatically detect changes in local web/plugins, no Apache restart needed anymore... + * 2929 Show all metrics of a service in a nicely formatted table in the service details * 2680 FIX: LDAP: Fixed exception when syncing groups using configurations from previous versions... * 2435 FIX: New graphing system: fixed broken graphs for iSCSI checks... * 2696 FIX: Fixed broken perfometer for update checks diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py index d15d2d5..6fe5679 100644 --- a/web/htdocs/metrics.py +++ b/web/htdocs/metrics.py @@ -1393,3 +1393,27 @@ def host_service_graph_dashlet_pnp(site, host_name, service_description, source) html.write(url_prefix + "pnp4nagios/index.php/image?host=%s&srv=%s&source=%d&view=%s&theme=multisite" % \ (html.urlencode(pnp_host), html.urlencode(pnp_svc), source, html.var("timerange"))) + + +#. +# .--Metrics Table-------------------------------------------------------. +# | __ __ _ _ _____ _ _ | +# | | \/ | ___| |_ _ __(_) ___ ___ |_ _|_ _| |__ | | ___ | +# | | |\/| |/ _ \ __| '__| |/ __/ __| | |/ _` | '_ \| |/ _ \ | +# | | | | | __/ |_| | | | (__\__ \ | | (_| | |_) | | __/ | +# | |_| |_|\___|\__|_| |_|\___|___/ |_|\__,_|_.__/|_|\___| | +# | | +# +----------------------------------------------------------------------+ +# | Renders a simple table with all metrics of a host or service | +# '----------------------------------------------------------------------' + +def render_metrics_table(translated_metrics): + output = "<table class=metricstable>" + for metric_name, metric in sorted(translated_metrics.items(), cmp=lambda a,b: cmp(a[1]["title"], b[1]["title"])): + output += "<tr>" + output += "<td class=color><div class=color style=\"background-color: %s\"></div></td>" % metric["color"] + output += "<td>%s:</td>" % metric["title"] + output += "<td class=value>%s</td>" % metric["unit"]["render"](metric["value"]) + output += "</tr>" + output += "</table>" + return output diff --git a/web/htdocs/views.css b/web/htdocs/views.css index a3aeee6..9d233df 100644 --- a/web/htdocs/views.css +++ b/web/htdocs/views.css @@ -805,3 +805,9 @@ td.if_state.if_not_available { color: black; background-color: #cccccc; } + +/* metrics table in painter svc_metrics */ +table.metricstable td.value { + padding-left: 10px; + text-align: right; +} diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py index 9bea7f0..672ecd2 100644 --- a/web/plugins/views/builtin.py +++ b/web/plugins/views/builtin.py @@ -1251,7 +1251,7 @@ multisite_builtin_views.update({ ('svc_long_plugin_output', None), ('perfometer', None), ('svc_pnpgraph', None), - ('svc_perf_data', None), + ('svc_metrics', None), ('svc_in_downtime', None), ('svc_in_notifper', None), @@ -1276,6 +1276,7 @@ multisite_builtin_views.update({ ('svc_group_memberlist', None), ('svc_servicelevel', None), ('svc_check_command', None), + ('svc_perf_data', None), ('svc_custom_vars', None), ('check_manpage', None), ('svc_custom_notes', None), diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py index 8923e28..702aa05 100644 --- a/web/plugins/views/painters.py +++ b/web/plugins/views/painters.py @@ -513,19 +513,32 @@ multisite_painters["svc_plugin_output"] = { "paint" : lambda row: paint_stalified(row, format_plugin_output(row["service_plugin_output"], row)), "sorter" : 'svcoutput', } + multisite_painters["svc_long_plugin_output"] = { "title" : _("Long output of check plugin (multiline)"), "short" : _("Status detail"), "columns" : ["service_long_plugin_output"], "paint" : lambda row: paint_stalified(row, format_plugin_output(row["service_long_plugin_output"], row).replace('\\n', '<br>').replace('\n', '<br>')), } + multisite_painters["svc_perf_data"] = { - "title" : _("Service performance data"), + "title" : _("Service performance data (source code)"), "short" : _("Perfdata"), "columns" : ["service_perf_data"], "paint" : lambda row: paint_stalified(row, row["service_perf_data"]) } +def paint_service_metrics(row): + translated_metrics = metrics.translate_metrics(*metrics.parse_perf_data(row["service_perf_data"], row["service_check_command"])) + return "", metrics.render_metrics_table(translated_metrics) + +multisite_painters["svc_metrics"] = { + "title" : _("Service Metrics"), + "short" : _("Metrics"), + "columns" : [ "service_check_command", "service_perf_data"], + "paint" : paint_service_metrics, +} + def get_perfdata_nth_value(row, n, remove_unit = False): perfdata = row.get("service_perf_data") if not perfdata:
8 years, 7 months
1
0
0
0
Slight style update for new color picker
by Mathias Kettner
Module: check_mk Branch: master Commit: 8b120c18314ade60163d0b6ba4b7d193d41ca2d2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b120c18314ade…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 20:02:14 2016 +0100 Slight style update for new color picker --- web/htdocs/check_mk.css | 7 ++++++- web/htdocs/metrics.py | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css index 6bbb1b9..5a496e9 100644 --- a/web/htdocs/check_mk.css +++ b/web/htdocs/check_mk.css @@ -597,7 +597,7 @@ table.data td .cp-preview { top: 2px; } -.picker-wrapper, +.picker-wrapper, .slide-wrapper { position: relative; float: left; @@ -644,6 +644,11 @@ table.data td .cp-preview { background-color: black; } +div.popup_trigger.colorpicker .popup_menu { + top: 17px; + left: 26px; +} + /*--Werks------------------------------------------------------------------. | __ __ _ | | \ \ / /__ _ __| | _____ | diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py index 2014e72..d15d2d5 100644 --- a/web/htdocs/metrics.py +++ b/web/htdocs/metrics.py @@ -356,7 +356,6 @@ def parse_perf_data(perf_data_string, check_command=None): # Get translation info for one performance var. def perfvar_translation(perfvar_nr, perfvar_name, check_command): cm = check_metrics.get(check_command, {}) - translation_entry = {} # Default: no translation neccessary if perfvar_name in cm:
8 years, 7 months
1
0
0
0
Precision of unit type float increased from 1 to 2 digits
by Mathias Kettner
Module: check_mk Branch: master Commit: 6cd41ec3e4c5bf85dd27520e447c326766a6ddc5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6cd41ec3e4c5bf…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 14:13:06 2016 +0100 Precision of unit type float increased from 1 to 2 digits --- web/plugins/metrics/check_mk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py index 6c1eaf5..813ec4c 100644 --- a/web/plugins/metrics/check_mk.py +++ b/web/plugins/metrics/check_mk.py @@ -49,7 +49,7 @@ unit_info[""] = { "title" : "", "description" : _("Floating point number"), "symbol" : "", - "render" : lambda v: "%.1f" % v, + "render" : lambda v: "%.2f" % v, } unit_info["count"] = {
8 years, 7 months
1
0
0
0
Color() can do something on change now
by Mathias Kettner
Module: check_mk Branch: master Commit: 01feb58c7489b52a8c3a8d01d3cacaf5d025a08a URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01feb58c7489b5…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 14:12:48 2016 +0100 Color() can do something on change now --- web/htdocs/valuespec.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py index ed2ba0f..abda1c2 100644 --- a/web/htdocs/valuespec.py +++ b/web/htdocs/valuespec.py @@ -3594,11 +3594,9 @@ class Color(ValueSpec): " function(hex, hsv, rgb) {" \ " document.getElementById(\"%s_value\").value = hex;" \ " document.getElementById(\"%s_preview\").style.backgroundColor = hex;" \ - " %s" \ - "}).setHex(\"%s\");</script>" % (varprefix, varprefix, varprefix, - self._on_change or "", value) + "}).setHex(\"%s\");</script>" % (varprefix, varprefix, varprefix, value) - html.popup_trigger(indicator, varprefix + '_popup', menu_content=menu_content, cssclass="colorpicker") + html.popup_trigger(indicator, varprefix + '_popup', menu_content=menu_content, cssclass="colorpicker", onclose=self._on_change)
8 years, 7 months
1
0
0
0
Alternative: new layout option "horizontal"
by Mathias Kettner
Module: check_mk Branch: master Commit: 27c169767b3c290a0ef3e10211cdc45093977912 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27c169767b3c29…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 14:12:26 2016 +0100 Alternative: new layout option "horizontal" --- web/htdocs/valuespec.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py index 8cde9ea..ed2ba0f 100644 --- a/web/htdocs/valuespec.py +++ b/web/htdocs/valuespec.py @@ -2567,7 +2567,8 @@ class Alternative(ValueSpec): self._match = kwargs.get("match") # custom match function, returns index in elements self._style = kwargs.get("style", "radio") # alternative: "dropdown" self._show_alternative_title = kwargs.get("show_alternative_title") - self._on_change = kwargs.get("on_change") # currently only working for select + self._on_change = kwargs.get("on_change") # currently only working for style="dropdown" + self._orientation = kwargs.get("orientation", "vertical") # or horizontal: for style="dropdown" # Return the alternative (i.e. valuespec) # that matches the datatype of a given value. We assume @@ -2600,8 +2601,11 @@ class Alternative(ValueSpec): onchange="valuespec_cascading_change(this, '%s', %d);" % (varprefix, len(options)) if self._on_change: onchange += self._on_change + if self._orientation == "horizontal": + html.write("<table><tr><td>") html.select(varprefix + "_use", options, sel_option, onchange) - html.write(" ") + if self._orientation == "vertical": + html.write(" ") for nr, vs in enumerate(self._elements): if str(nr) == sel_option: @@ -2611,12 +2615,17 @@ class Alternative(ValueSpec): disp = "none" cur_val = vs.default_value() + if self._orientation == "horizontal": + html.write("</td><td>") html.write('<span id="%s_%s_sub" style="display: %s">' % (varprefix, nr, disp)) html.help(vs.help()) vs.render_input(varprefix + "_%d" % nr, cur_val) html.write("</span>") + if self._orientation == "horizontal": + html.write("</td></tr></table>") + def render_input_radio(self, varprefix, value): mvs = self.matching_alternative(value) for nr, vs in enumerate(self._elements):
8 years, 7 months
1
0
0
0
popup_trigger can now call code on close
by Mathias Kettner
Module: check_mk Branch: master Commit: cd19f96e78337ea1c78d7f0078786bfd82a79c1e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cd19f96e78337e…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 14:11:50 2016 +0100 popup_trigger can now call code on close --- web/htdocs/htmllib.py | 7 ++++--- web/htdocs/js/checkmk.js | 13 ++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 5cf7c3d..81d76dc 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -1032,14 +1032,15 @@ class html(GUITester): else: self.status_icons[img] = tooltip - def render_popup_trigger(self, content, ident, what=None, data=None, url_vars=None, style=None, menu_content=None, cssclass=None): + def render_popup_trigger(self, content, ident, what=None, data=None, url_vars=None, style=None, menu_content=None, cssclass=None, onclose=None): style = style and (' style="%s"' % style) or "" src = '<div class="popup_trigger%s" id="popup_trigger_%s"%s>\n' % (cssclass and (" " + cssclass) or "", ident, style) - onclick = 'toggle_popup(event, this, \'%s\', %s, %s, %s, %s)' % \ + onclick = 'toggle_popup(event, this, \'%s\', %s, %s, %s, %s, %s)' % \ (ident, what and "'"+what+"'" or 'null', data and self.attrencode(json.dumps(data)) or 'null', url_vars and "'"+self.urlencode_vars(url_vars)+"'" or 'null', - menu_content and "'"+self.attrencode(menu_content)+"'" or 'null') + menu_content and "'"+self.attrencode(menu_content)+"'" or 'null', + onclose and "'%s'" % onclose.replace("'", "\\'") or 'null') src += '<a class="popup_trigger" href="javascript:void(0)" onclick="%s">\n' % onclick src += content src += '</a>' diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js index 6ec57f5..1106ba4 100644 --- a/web/htdocs/js/checkmk.js +++ b/web/htdocs/js/checkmk.js @@ -2439,6 +2439,9 @@ function close_popup() menu = null; } popup_id = null; + + if (on_popup_close) + eval(on_popup_close); } // Registerd as click handler on the page while the popup menu is opened @@ -2466,9 +2469,12 @@ function handle_popup_close(event) { // The static content of the menu is given in the "menu_content" parameter. // data: json data which can be used by actions in popup menus // url_vars: vars are added to ajax_popup_*.py calls for rendering the popup menu -function toggle_popup(event, trigger_obj, ident, what, data, url_vars, menu_content) +var on_popup_close = null; +function toggle_popup(event, trigger_obj, ident, what, data, url_vars, menu_content, onclose) { - if(!event) + on_popup_close = onclose; + + if (!event) event = window.event; var container = trigger_obj.parentNode; @@ -2476,7 +2482,8 @@ function toggle_popup(event, trigger_obj, ident, what, data, url_vars, menu_cont if (popup_id === ident) { close_popup(); return; // same icon clicked: just close the menu - } else { + } + else { close_popup(); } }
8 years, 7 months
1
0
0
0
html.image_button now has style attribute
by Mathias Kettner
Module: check_mk Branch: master Commit: bda0cddda2d85964b580da510420b833630b851b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bda0cddda2d859…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 14:11:08 2016 +0100 html.image_button now has style attribute --- web/htdocs/htmllib.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index f50bf3f..5cf7c3d 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -349,15 +349,16 @@ class html(GUITester): def makeactionuri_contextless(self, addvars, filename=None): return self.makeuri_contextless(addvars + [("_transid", self.get_transid())], filename=filename) - def image_button(self, varname, title, cssclass = ''): + def image_button(self, varname, title, cssclass = '', style=None): if not self.mobile: - self.write('<label for="%s" class="image_button">' % self.attrencode(varname)) + self.write('<label for="%s" class="image_button"%s>' % + (self.attrencode(varname), style and (" style=\"%s\"" % style) or "")) self.raw_button(varname, title, cssclass) if not self.mobile: self.write('</label>') - def button(self, *args): - self.image_button(*args) + def button(self, *args, **kwargs): + self.image_button(*args, **kwargs) def raw_button(self, varname, title, cssclass=""):
8 years, 7 months
1
0
0
0
DropdownChoice and Alternative now have an on_change attribute
by Mathias Kettner
Module: check_mk Branch: master Commit: d111b230388c4d15ac968d385763b1675bd43e46 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d111b230388c4d…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 12:46:53 2016 +0100 DropdownChoice and Alternative now have an on_change attribute --- web/htdocs/valuespec.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py index 187a491..8cde9ea 100644 --- a/web/htdocs/valuespec.py +++ b/web/htdocs/valuespec.py @@ -1236,6 +1236,7 @@ class DropdownChoice(ValueSpec): self._no_preselect_value = kwargs.get("no_preselect_value", None) self._no_preselect_title = kwargs.get("no_preselect_title", "") # if not preselected self._no_preselect_error = kwargs.get("no_preselect_error", _("Please make a selection")) + self._on_change = kwargs.get("on_change") def choices(self): result = [] @@ -1279,9 +1280,9 @@ class DropdownChoice(ValueSpec): html.icon_select(varprefix, options, defval) else: if not self._sorted: - html.select(varprefix, options, defval) + html.select(varprefix, options, defval, onchange=self._on_change) else: - html.sorted_select(varprefix, options, defval) + html.sorted_select(varprefix, options, defval, onchange=self._on_change) def value_to_text(self, value): for entry in self.choices(): @@ -2566,6 +2567,7 @@ class Alternative(ValueSpec): self._match = kwargs.get("match") # custom match function, returns index in elements self._style = kwargs.get("style", "radio") # alternative: "dropdown" self._show_alternative_title = kwargs.get("show_alternative_title") + self._on_change = kwargs.get("on_change") # currently only working for select # Return the alternative (i.e. valuespec) # that matches the datatype of a given value. We assume @@ -2596,6 +2598,8 @@ class Alternative(ValueSpec): sel_option = str(nr) options.append((str(nr), vs.title())) onchange="valuespec_cascading_change(this, '%s', %d);" % (varprefix, len(options)) + if self._on_change: + onchange += self._on_change html.select(varprefix + "_use", options, sel_option, onchange) html.write(" ")
8 years, 7 months
1
0
0
0
Fixed type in unit of floating point
by Mathias Kettner
Module: check_mk Branch: master Commit: ebc81cd02c5d7d3230eca27ab419fad862fe6db0 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ebc81cd02c5d7d…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Jan 31 12:47:12 2016 +0100 Fixed type in unit of floating point --- web/plugins/metrics/check_mk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py index b6aa73e..6c1eaf5 100644 --- a/web/plugins/metrics/check_mk.py +++ b/web/plugins/metrics/check_mk.py @@ -47,7 +47,7 @@ unit_info[""] = { "title" : "", - "description" : _("Floating point numnber"), + "description" : _("Floating point number"), "symbol" : "", "render" : lambda v: "%.1f" % v, }
8 years, 7 months
1
0
0
0
← Newer
1
2
3
4
...
31
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Results per page:
10
25
50
100
200