Module: check_mk
Branch: master
Commit: 6b764906003c989f2243ca99d7c87dceb147ddb9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b764906003c98…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Nov 15 11:58:25 2013 +0100
FIX display http[s] links in plugin output
---
web/htdocs/lib.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 1606408..12929cb 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -256,7 +256,8 @@ def format_plugin_output(output, row = None):
output = output[:a] + "running on " + h + output[e+1:]
output =
re.sub("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
- lambda p: '<a
href="%(group)s">%(group)s</a>' % { "group": p.group(0)
}, output)
+ lambda p: '<a href="%s">%s</a>' %
+ (p.group(0), len(p.group(0)) > 40 and p.group(0)[:40] +
"..." or p.group(0)), output)
return output