Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
addons:hotlink-hostnames [2015/09/29 03:36] – [xymonbodyfooter.cfg] jez | addons:hotlink-hostnames [2015/09/29 04:12] (current) – removed jez | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== My Addon (CHANGEME) ====== | ||
- | |||
- | ^ Author | [[ jlaidman@rebel-it.com.au | Jeremy Laidman ]] | | ||
- | ^ Compatibility | Xymon 4.x | | ||
- | ^ Requirements | none | | ||
- | ^ Download | None | | ||
- | ^ Last Update | 2015-09-29 | | ||
- | |||
- | ===== Description ===== | ||
- | |||
- | This is an enhancement to the footer template file, to auto-hotlink hostnames to support click-to-connect for ssh:// and telnet:// URLs. | ||
- | |||
- | ===== Installation ===== | ||
- | |||
- | 1. Copy the file into xymonbodyfooter.cfg alongside xymonserver.cfg. | ||
- | 2. In xymonserver.cfg, | ||
- | 3. Create COMMENT or DESCR strings in the form " | ||
- | |||
- | The " | ||
- | |||
- | ===== Source ===== | ||
- | ==== xymonbodyfooter.cfg ==== | ||
- | |||
- | <hidden onHidden=" | ||
- | < | ||
- | <!-- | ||
- | -- Adds hotlinks to connect to the server. | ||
- | -- Copy this into the file xymonbodyfooter.cfg alongside xymonserver.cfg. | ||
- | -- In xymonserver.cfg, | ||
- | -- Create COMMENT or DESCR strings in the form " | ||
- | --> | ||
- | |||
- | <!-- we pull in jquery and use it to manipulate the hostname to add links --> | ||
- | <script src=" | ||
- | <script type=" | ||
- | var replaceConnect=1; | ||
- | jQuery(' | ||
- | var title=jQuery(this).attr(" | ||
- | if (title == null) { return; }; // no title? nothing to do | ||
- | |||
- | var url = jQuery.trim(jQuery(this).text()); | ||
- | var servertext = jQuery.trim(jQuery(this).text()); | ||
- | |||
- | var svclist=[]; | ||
- | var titlematch=title.match(/ | ||
- | if (titlematch != null) { | ||
- | svclist=titlematch[2].split(/ | ||
- | if (replaceConnect == 1) { title=titlematch[1]+titlematch[3]; | ||
- | }; | ||
- | |||
- | var returnstr = ""; | ||
- | for (var i=0; i < svclist.length; | ||
- | svc=svclist[i]; | ||
- | // webby URLs open in new window | ||
- | returnstr += '< | ||
- | returnstr += ' <a href="' | ||
- | if (svc == ' | ||
- | returnstr += '>' | ||
- | returnstr += '</ | ||
- | }; | ||
- | return '< | ||
- | }); | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | |||
- | ===== Known Bugs and Issues ===== | ||
- | |||
- | ===== To Do ===== | ||
- | |||
- | ===== Credits ===== | ||
- | |||
- | ===== Changelog ===== | ||
- | |||
- | * **2015-09-29** | ||
- | * Initial release | ||