Module: nagvis Branch: master Commit: 2f4fd6472932d983fde0e4a35ee68167273c9c11 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=2f4fd6472932d983fde0e4a35ee68167273c9c11
Author: LaMi <[email protected]> Date: Tue Mar 9 22:45:31 2010 +0100 #212 Added new pnp macros to context menus --- docs/en_US/context_templates.html | 14 ++++++-------- share/frontend/nagvis-js/js/NagVisObject.js | 7 ++++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/en_US/context_templates.html b/docs/en_US/context_templates.html index 183b810..3a1c980 100644 --- a/docs/en_US/context_templates.html +++ b/docs/en_US/context_templates.html @@ -69,20 +69,18 @@ <h3>Host objects</h3> <table style="width:100%"> <tr> - <th>Macro</th><th>Description</th> - </tr> - <tr> - <td>[address]</td><td>Address of the host configured in Nagios</td> + <th width="250">Macro</th><th>Description</th> </tr> + <tr><td>[address]</td><td>Address of the host configured in Nagios</td></tr> + <tr><td>[pnp_hostname]</td><td>Hostname with replaced blanks for links to PNP (<font color="#ff0000">New in 1.5</font>)</td></tr> </table> <h3>Service objects</h3> <table style="width:100%"> <tr> - <th>Macro</th><th>Description</th> - </tr> - <tr> - <td>[service_description]</td><td>Service description in Nagios</td> + <th width="250">Macro</th><th>Description</th> </tr> + <tr><td>[service_description]</td><td>Service description in Nagios</td></tr> + <tr><td>[pnp_service_description]</td><td>Service description with replaced blanks for links to PNP (<font color="#ff0000">New in 1.5</font>)</td></tr> </table> </body> </html> diff --git a/share/frontend/nagvis-js/js/NagVisObject.js b/share/frontend/nagvis-js/js/NagVisObject.js index b9f1bf2..32b2c82 100644 --- a/share/frontend/nagvis-js/js/NagVisObject.js +++ b/share/frontend/nagvis-js/js/NagVisObject.js @@ -169,12 +169,17 @@ var NagVisObject = Base.extend({ if(this.conf.type === 'service') { oMacros.service_description = escapeUrlValues(this.conf.service_description); + + oMacros.pnp_hostname = oObj.conf.name.replace(/\s/g,'%20'); + oMacros.pnp_service_description = oObj.conf.service_description.replace(/\s/g,'%20'); } else { oSectionMacros.service = '<!--\\sBEGIN\\sservice\\s-->.+?<!--\\sEND\\sservice\\s-->'; } // Macros which are only for hosts - if(this.conf.type !== 'host') { + if(this.conf.type === 'host') { + oMacros.pnp_hostname = oObj.conf.name.replace(/\s/g,'%20'); + } else { oSectionMacros.host = '<!--\\sBEGIN\\shost\\s-->.+?<!--\\sEND\\shost\\s-->'; } ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
