Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- -- Adds hotlinks to connect to the server. To use:
- -- Copy this into the file xymonbodyfooter.cfg alongside xymonserver.cfg.
- -- In xymonserver.cfg, set: XYMONBODYFOOTER="file:$XYMONHOME/etc/xymonbodyfooter.cfg"
- -- Create COMMENT or DESCR strings in the form "...(connect: ssh, rdp, telnet)..."
- -->
- <!-- we pull in jquery and use it to manipulate the hostname to add links -->
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script type="text/javascript">
- var replaceConnect=1; // replace (connect:...) string, zero to disable
- jQuery('.line span').replaceWith(function() {
- var title=jQuery(this).attr("title");
- 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(/^(.*)\s*\(connect:\s*(.*)\)\s*(.*)/);
- if (titlematch != null) {
- svclist=titlematch[2].split(/\s*,\s*/);
- if (replaceConnect == 1) { title=titlematch[1]+titlematch[3]; };
- };
- var returnstr = "";
- for (var i=0; i < svclist.length; i++) {
- svc=svclist[i];
- // webby URLs open in new window
- returnstr += '<span title="connect with '+svc+'">';
- returnstr += ' <a href="' + svc + '://' + url + '"';
- if (svc == 'http' || svc == 'https') { returnstr += '" target="_blank"'; };
- returnstr += '>' + svc + '</a>';
- returnstr += '</span>';
- };
- return '<span title="'+title+'">' + servertext + '</span>' + '<font size="-2">' + returnstr + '</font>';
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement