Module: check_mk
Branch: master
Commit: 9d79a600a38ee5c3bdf87e63fbb2f59fffbe5840
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d79a600a38ee5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 4 15:38:50 2013 +0100
Display HTTP links in plugin output as icon now
---
.werks/35 | 7 ++++---
ChangeLog | 2 +-
web/htdocs/images/pluginurl.png | Bin 0 -> 5597 bytes
web/htdocs/lib.py | 4 ++--
web/htdocs/status.css | 7 +++++++
5 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/.werks/35 b/.werks/35
index 5d7598e..b09f784 100644
--- a/.werks/35
+++ b/.werks/35
@@ -1,11 +1,12 @@
-Title: http[s] links are display again in the plugin output
+Title: Convert HTTP(S) links in plugin output into clickable icon
Level: 1
Component: multisite
Version: 1.2.3i7
Date: 1384432725
Class: fix
-The multisite GUI now translates html links into <tt><a href=
..></tt>
-This feature has been introduced to allow at least basic html support in plugin outputs.
+The Multisite GUI now translates HTTP links that are contained in the output
+of plugins into an icon that contains a clickable <tt>href</tt> to that
link.
+This feature has been introduced to allow at least basic HTML support in plugin outputs.
If you want to have full html support in plugin output (including the security risks it
brings)
you can disable the option "Escape HTML codes in plugin output" in the global
settings.
diff --git a/ChangeLog b/ChangeLog
index 69704a0..ade6e7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,7 +68,7 @@
* 0204 FIX: Reduced I/O on logins with access time recording or failed login
counts...
* 0206 FIX: Fixed logwatch permission check when using liveproxy for normal users...
* 0210 FIX: LDAP: Fixed problem syncing contactgroups of a user with umlauts in CN
- * 0035 FIX: http[s] links are display again in the plugin output...
+ * 0035 FIX: Convert HTTP(S) links in plugin output into clickable icon...
* 0006 FIX: Checkboxes for hosts/services were missing on modified views...
* 0284 FIX: Context help toggled on/off randomly...
* 0285 FIX: Fixed bookmarking of absolute URLs or PNP/NagVis URLs in sidebar
snapin...
diff --git a/web/htdocs/images/pluginurl.png b/web/htdocs/images/pluginurl.png
new file mode 100644
index 0000000..b5f28c4
Binary files /dev/null and b/web/htdocs/images/pluginurl.png differ
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index b96bdf5..3994f6d 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -264,8 +264,8 @@ def format_plugin_output(output, row = None):
if config.escape_plugin_output:
output =
re.sub("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
- 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)
+ lambda p: '<a href="%s"><img
class=pluginurl align=absmiddle title="%s"
src="images/pluginurl.png"></a>' %
+ (p.group(0), p.group(0)), output)
return output
diff --git a/web/htdocs/status.css b/web/htdocs/status.css
index 7fc12af..fa5c0bb 100644
--- a/web/htdocs/status.css
+++ b/web/htdocs/status.css
@@ -98,6 +98,13 @@ b.stmark {
border: 1px solid #666;
}
+/* inline icon in plugin output for URLs */
+img.pluginurl {
+ width: 16px;
+ height: 16px;
+ vertical-align: middle;
+}
+
/* *some* problem */
.states, .hstates {
background-image: url("images/someproblem.png");