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

Author: Lars Michelsen <[email protected]>
Date:   Thu Nov  4 11:17:11 2010 +0100

Conflicts:

        share/frontend/nagvis-js/js/nagvis.js

---

 share/frontend/nagvis-js/js/lines.js  |   12 ++++++------
 share/frontend/nagvis-js/js/nagvis.js |    9 +++++++++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/share/frontend/nagvis-js/js/lines.js 
b/share/frontend/nagvis-js/js/lines.js
index d905317..dca1cb6 100644
--- a/share/frontend/nagvis-js/js/lines.js
+++ b/share/frontend/nagvis-js/js/lines.js
@@ -258,12 +258,12 @@ function drawNagVisLine(objectId, lineType, cuts, x1, y1, 
x2, y2, z, width, colo
                        var xMid = middle(x1, x2, cut);
                        var yMid = middle(y1, y2, cut);
                        // perfdataA contains the percentage info
-                       if(perfdata[0] && perfdata[0][1] && perfdata[0][2])
+                       if(isset(perfdata[0]) && isset(perfdata[0][1]) && 
isset(perfdata[0][2]))
                                perfdataA = perfdata[0][1] + perfdata[0][2];
                        drawArrow(objectId, x1, y1, xMid, yMid, z, width, 
colorFill, colorBorder);
       drawLinkOrLabel(objectId, lineType, x1, y1, xMid, yMid, z, perfdataA, 
perfdataB, cutIn, bLinkArea, bLabelShow);
 
-                       if(perfdata[1] && perfdata[1][1] && perfdata[1][2])
+                       if(isset(perfdata[1]) && isset(perfdata[1][1]) && 
isset(perfdata[1][2]))
                                perfdataA = perfdata[1][1] + perfdata[1][2];
                        drawArrow(objectId, x2, y2, xMid, yMid, z, width, 
colorFill2, colorBorder);
       drawLinkOrLabel(objectId, lineType, x2, y2, xMid, yMid, z, perfdataA, 
perfdataB, cutOut, bLinkArea, bLabelShow);
@@ -274,16 +274,16 @@ function drawNagVisLine(objectId, lineType, cuts, x1, y1, 
x2, y2, z, width, colo
                        var yMid = middle(y1, y2, cut);
                        // perfdataA contains the percentage info
                        // perfdataB contains the bandwith info
-                       if(perfdata[0] && perfdata[0][1] && perfdata[0][2])
+                       if(isset(perfdata[0]) && isset(perfdata[0][1]) && 
isset(perfdata[0][2]))
                                perfdataA = perfdata[0][1] + perfdata[0][2];
-                       if(perfdata[2] && perfdata[2][1] && perfdata[2][2])
+                       if(isset(perfdata[2]) && isset(perfdata[2][1]) && 
isset(perfdata[2][2]))
                                perfdataB = perfdata[2][1] + perfdata[2][2];
                        drawArrow(objectId, x1, y1, xMid, yMid, z, width, 
colorFill, colorBorder);
       drawLinkOrLabel(objectId, lineType, x1, y1, xMid, yMid, z, perfdataA, 
perfdataB, cutOut, bLinkArea, bLabelShow);
 
-                       if(perfdata[1] && perfdata[1][1] && perfdata[1][2])
+                       if(isset(perfdata[1]) && isset(perfdata[1][1]) && 
isset(perfdata[1][2]))
                                perfdataA = perfdata[1][1] + perfdata[1][2];
-                       if(perfdata[3] && perfdata[3][1] && perfdata[3][2])
+                       if(isset(perfdata[3]) && isset(perfdata[3][1]) && 
isset(perfdata[3][2]))
                                perfdataB = perfdata[3][1] + perfdata[3][2];
                        drawArrow(objectId, x2, y2, xMid, yMid, z, width, 
colorFill2, colorBorder);
                        drawLinkOrLabel(objectId, lineType, x2, y2, xMid, yMid, 
z, perfdataA, perfdataB, cutIn, bLinkArea, bLabelShow);
diff --git a/share/frontend/nagvis-js/js/nagvis.js 
b/share/frontend/nagvis-js/js/nagvis.js
index 8024e1c..46a0a0b 100644
--- a/share/frontend/nagvis-js/js/nagvis.js
+++ b/share/frontend/nagvis-js/js/nagvis.js
@@ -993,3 +993,12 @@ function storeUserOption(key, value) {
        var url = oGeneralProperties.path_server + 
'?mod=User&act=setOption&opts['+escapeUrlValues(key)+']=' + 
escapeUrlValues(value);
        getAsyncRequest(url, false, undefined, undefined);
 }
+
+/**
+ * Checks if a variable is set
+ *
+ * @author  Lars Michelsen <[email protected]>
+ */
+function isset(v) {
+       return typeof(v) !== 'undefined';
+}


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to