Author:   Lars Michelsen <[email protected]>
Date:     Tue Feb  5 14:08:54 2013 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Tue Feb  5 14:08:54 2013 +0100

Commented out sample custom actions; hiding macro sections in context menus of 
not defined actions

---

 etc/nagvis.ini.php-sample                   |   46 +++++++++++++-------------
 share/frontend/nagvis-js/js/NagVisObject.js |    9 +++--
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/etc/nagvis.ini.php-sample b/etc/nagvis.ini.php-sample
index 01f29df..07ccf28 100644
--- a/etc/nagvis.ini.php-sample
+++ b/etc/nagvis.ini.php-sample
@@ -431,11 +431,11 @@ interval=15
 ; has the string "win" in the TAGS Nagios custom macro. 
 ; When clicking on the link, NagVis generates a .rdp file which contains makes
 ; the client connect to the given host via RDP.
-[action_rdp]
-action_type="rdp"
-obj_type="host,service"
-condition="TAGS~win"
-client_os="win"
+;[action_rdp]
+;action_type="rdp"
+;obj_type="host,service"
+;condition="TAGS~win"
+;client_os="win"
 ;domain=""
 ;username=""
 
@@ -444,40 +444,40 @@ client_os="win"
 ; detects that the client watching the map uses windows.
 ; When clicking on the link, NagVis generates a .cmd file which contains a
 ; call to putty which makes putty connect via SSH to this host.
-[action_win_ssh]
-action_type="win_ssh"
-obj_type="host,service"
-client_os="win"
-condition="TAGS~unix"
+;[action_win_ssh]
+;action_type="win_ssh"
+;obj_type="host,service"
+;client_os="win"
+;condition="TAGS~unix"
 
 ; Adds the action "connect via ssh" to service/host objects which have the
 ; string "unix" in the TAGS Nagios custom macro. Is only added when NagVis
 ; detects that the client watching the map uses linux or mac os.
 ; When clicking on the link, the browser opens the URL ssh://<address>/,
 ; you need to configure your clients browser to handle these urls correctly.
-[action_ssh_url]
-action_type="ssh_url"
-obj_type="host,service"
-client_os="mac,lnx"
-condition="TAGS~unix"
+;[action_ssh_url]
+;action_type="ssh_url"
+;obj_type="host,service"
+;client_os="mac,lnx"
+;condition="TAGS~unix"
 
 ; Adds the action "connect via http" to service/host objects which have the
 ; string "web-80" in the TAGS Nagios custom macro
 ; When clicking on the link, the browser opens a new window with the URL
 ; http://<host_address>/. This can be changed by modyfing the context template.
-[action_http]
-action_type="http"
-obj_type="host,service"
-condition="TAGS~web-80"
+;[action_http]
+;action_type="http"
+;obj_type="host,service"
+;condition="TAGS~web-80"
 
 ; Adds the action "connect via http" to service/host objects which have the
 ; string "web-443" in the TAGS Nagios custom macro
 ; When clicking on the link, the browser opens a new window with the URL
 ; https://<host_address>/. This can be changed by modyfing the context 
template.
-[action_https]
-action_type="https"
-obj_type="host,service"
-condition="TAGS~web-443"
+;[action_https]
+;action_type="https"
+;obj_type="host,service"
+;condition="TAGS~web-443"
 
 ; 
------------------------------------------------------------------------------
 ; Below you find some advanced stuff
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index 668313e..b5fd2bb 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -348,13 +348,16 @@ var NagVisObject = Base.extend({
                 }
             }
 
-            // Filtered out, hide the selection
-            if(hide) {
-                oSectionMacros['action_'+key] = 
'<!--\\sBEGIN\\saction_'+key+'\\s-->.+?<!--\\sEND\\saction_'+key+'\\s-->';
+            // Remove the section macros of not hidden actions
+            if(!hide) {
+                oSectionMacros['action_'+key] = 
'<!--\\s(BEGIN|END)\\saction_'+key+'\\s-->';
             }
             cond = null;
             action = null;
         }
+        
+        // Remove all not hidden actions
+        oSectionMacros['actions'] = 
'<!--\\sBEGIN\\saction_.+?\\s-->.+?<!--\\sEND\\saction_.+?\\s-->';
 
         // Loop and replace all unwanted section macros
         for (var key in oSectionMacros) {


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to