Module: nagvis
Branch: master
Commit: bc91b2cf5cb4ab1a0dc45ca0e8efc0bb1055dae8
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=bc91b2cf5cb4ab1a0dc45ca0e8efc0bb1055dae8

Author: Lars Michelsen <[email protected]>
Date:   Sat Jul 17 19:32:36 2010 +0200

#327 Added hostgroup/servicegroup range macros to context menus

---

 share/frontend/nagvis-js/js/NagVisObject.js |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index 369c0bf..96eccae 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -176,16 +176,22 @@ var NagVisObject = Base.extend({
                        
                        oMacros.pnp_hostname = 
this.conf.name.replace(/\s/g,'%20');
                        oMacros.pnp_service_description = 
this.conf.service_description.replace(/\s/g,'%20');
-               } else {
+               } 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 = 
this.conf.name.replace(/\s/g,'%20');
-               } else {
+               else
                        oSectionMacros.host = 
'<!--\\sBEGIN\\shost\\s-->.+?<!--\\sEND\\shost\\s-->';
-               }
+
+               // Replace hostgroup range macros when not in a hostgroup
+               if(this.conf.type !== 'hostgroup')
+                       oSectionMacros.hostgroup = 
'<!--\\sBEGIN\\shostgroup\\s-->.+?<!--\\sEND\\shostgroup\\s-->';
+
+               // Replace servicegroup range macros when not in a servicegroup
+               if(this.conf.type !== 'servicegroup')
+                       oSectionMacros.servicegroup = 
'<!--\\sBEGIN\\sservicegroup\\s-->.+?<!--\\sEND\\sservicegroup\\s-->';
                
                // Loop and replace all unwanted section macros
                for (var key in oSectionMacros) {


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to