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

Author: Lars Michelsen <[email protected]>
Date:   Thu Oct 21 22:58:39 2010 +0200

#327 Fixed hostgroup context replacement and added hostgroup/map section macros 
to the hover menus

---

 docs/en_US/hover_templates.html             |    2 +-
 share/frontend/nagvis-js/js/NagVisObject.js |    2 +-
 share/frontend/nagvis-js/js/hover.js        |    8 ++++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/docs/en_US/hover_templates.html b/docs/en_US/hover_templates.html
index e72fc7c..8dd917e 100644
--- a/docs/en_US/hover_templates.html
+++ b/docs/en_US/hover_templates.html
@@ -136,7 +136,7 @@
                
                Below you can find a full list of the special macros
                
-               <h3> All exception map objects </h3>
+               <h3> All except map objects </h3>
                <table style="width:100%">
                <tr>
                <th width="250"> Macro </th><th> Description </th>
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index c1103c9..fdf14d4 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -202,7 +202,7 @@ var NagVisObject = Base.extend({
 
                // Replace map range macros when not in a hostgroup
                if(this.conf.type !== 'map')
-                       oSectionMacros.hostgroup = 
'<!--\\sBEGIN\\smap\\s-->.+?<!--\\sEND\\smap\\s-->';
+                       oSectionMacros.map = 
'<!--\\sBEGIN\\smap\\s-->.+?<!--\\sEND\\smap\\s-->';
                
                // Loop and replace all unwanted section macros
                for (var key in oSectionMacros) {
diff --git a/share/frontend/nagvis-js/js/hover.js 
b/share/frontend/nagvis-js/js/hover.js
index 0be14cc..f9ee1aa 100644
--- a/share/frontend/nagvis-js/js/hover.js
+++ b/share/frontend/nagvis-js/js/hover.js
@@ -264,6 +264,14 @@ function replaceHoverTemplateStaticMacros(replaceChild, 
oObj, sTemplateCode) {
        if(oObj.conf.type !== 'servicegroup')
                oSectionMacros.servicegroup = 
'<!--\\sBEGIN\\sservicegroup\\s-->.+?<!--\\sEND\\sservicegroup\\s-->';
        
+       // Replace hostgroup sections when not hostgroup object
+       if(oObj.conf.type !== 'hostgroup')
+               oSectionMacros.hostgroup = 
'<!--\\sBEGIN\\shostgroup\\s-->.+?<!--\\sEND\\shostgroup\\s-->';
+       
+       // Replace map sections when not map object
+       if(oObj.conf.type !== 'map')
+               oSectionMacros.map = 
'<!--\\sBEGIN\\smap\\s-->.+?<!--\\sEND\\smap\\s-->';
+       
        // Macros which are only for servicegroup childs
        if(replaceChild == '1' && oObj.parent_type === 'servicegroup' && 
oObj.conf.type === 'service')
                oMacros.obj_name1 = oObj.conf.name;


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to