Module: check_mk
Branch: master
Commit: 79c9f6eceb616b18ffddf0bfadee36c6bb646430
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=79c9f6eceb616b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 11 11:09:43 2015 +0100
#2762 FIX Fixed formating of check_http when using "clickable URL" option
---
.werks/2762 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/lib.py | 7 ++++++-
web/htdocs/status.css | 1 +
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/2762 b/.werks/2762
new file mode 100644
index 0000000..542e599
--- /dev/null
+++ b/.werks/2762
@@ -0,0 +1,10 @@
+Title: Fixed formating of check_http when using "clickable URL" option
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1447236552
+
+
diff --git a/ChangeLog b/ChangeLog
index c9d0896..b6417a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,6 +87,7 @@
* 2709 FIX: fixed exception when opening the action menu...
* 2447 FIX: Fixed sorting of performancedata values with units...
* 2758 FIX: Fixed processing of metrics containing varnames with quotes and/or
spaces
+ * 2762 FIX: Fixed formating of check_http when using "clickable URL"
option
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index d45213a..110c144 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -288,10 +288,15 @@ def format_plugin_output(output, row = None):
output = output[:a] + "running on " + h + output[e+1:]
if config.escape_plugin_output:
- output = re.sub("http[s]?://[^\"'>\t\s\n,]+",
+ # (?:<A HREF="), (?: target="_blank">)?
and endswith(" </A>") is a special
+ # handling for the HTML code produced by check_http when "clickable
URL" option is active.
+ output = re.sub("(?:<A
HREF=")?http[s]?://[^\"'>\t\s\n,]+(?:
target="_blank">)?",
lambda p: '<a href="%s"><img
class=pluginurl align=absmiddle title="%s"
src="images/pluginurl.png"></a>' %
(p.group(0).replace('"', ''),
p.group(0).replace('"', '')), output)
+ if output.endswith(" </A>"):
+ output = output[:-11]
+
return output
def format_exception():
diff --git a/web/htdocs/status.css b/web/htdocs/status.css
index 798db16..f74afc1 100644
--- a/web/htdocs/status.css
+++ b/web/htdocs/status.css
@@ -123,6 +123,7 @@ img.pluginurl {
width: 16px;
height: 16px;
vertical-align: middle;
+ margin: 1px;
}
/* *some* problem */