Author:   Lars Michelsen <[email protected]>
Date:     Fri Feb  3 10:51:56 2012 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Fri Feb  3 10:51:56 2012 +0100

Weathermap line color definitions support usage values above 100% and below 0%

---

 ChangeLog                                          |    3 +++
 TODO                                               |    4 +++-
 .../frontend/nagvis-js/js/NagVisStatefulObject.js  |   10 ++++++----
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ad7145..2772daf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@ Core
   * Livestatus Backend: Only try to connect to livestatus once per page load
   * FIX: Fixed wrong computed shape urls which broke all shapes
 
+Frontend
+  * Weathermap line color definitions support usage values above 100% and 
below 0%
+
 1.6.3
 Core
   * Bugfix: Made upper/lower case rotation_id/backend_id definitions possible
diff --git a/TODO b/TODO
index e90123e..b7a9a6e 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,7 @@ This is a small file for storing quick thoughts about new 
features and needed ch
 ===============================================================================
 
 Probleme:
-- Warnings anzeigen, wenn Funktionen aus oldPhpVersionFixes.php angezogen 
werden
+  - Warnings anzeigen, wenn Funktionen aus oldPhpVersionFixes.php angezogen 
werden
 
 Relative Koordinaten:
   - Wie funktionieren Linien zu Linien Referenzen? Geht das überhaupt?
@@ -17,6 +17,8 @@ Relative Koordinaten:
 
 -------------------------------------------------------------------------------
 
+- Weathermap Line Parser pro Check-Kommando behandeln - Das sollte den Code 
wesentlich sauberer machen
+
 - SQLite/MySQL Handling/Update abstrahieren und wesentliche Dinge an zentraler 
Stelle definieren
 
 - NagVis Multisite Snapin optional als Baum
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js 
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 7b4f563..ccff82d 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -576,17 +576,17 @@ var NagVisStatefulObject = NagVisObject.extend({
                 }
 
                 // Get colorFill #1 (in)
-                if(setPerfdata[0][2] !== null && setPerfdata[0][2] == '%' && 
setPerfdata[0][1] !== null && setPerfdata[0][1] >= 0 && setPerfdata[0][1] <= 
100)
+                if(setPerfdata[0][2] !== null && setPerfdata[0][2] == '%' && 
setPerfdata[0][1] !== null) {
                     colorFill = this.getColorFill(setPerfdata[0][1]);
-                else {
+                } else {
                     colorFill = '#000000';
                     this.perfdataError('First', setPerfdata[0][1], 
this.conf.name, this.conf.service_description);
                 }
 
                 // Get colorFill #2 (out)
-                if(setPerfdata[1][2] !== null && setPerfdata[1][2] == '%' && 
setPerfdata [1][1] !== null && setPerfdata[1][1] >= 0 && setPerfdata[1][1] <= 
100)
+                if(setPerfdata[1][2] !== null && setPerfdata[1][2] == '%' && 
setPerfdata [1][1] !== null) {
                     colorFill2 = this.getColorFill(setPerfdata[1][1]);
-                else {
+                } else {
                     colorFill2 = '#000000';
                     this.perfdataError('Second', setPerfdata[1][1], 
this.conf.name, this.conf.service_description);
                 }
@@ -620,10 +620,12 @@ var NagVisStatefulObject = NagVisObject.extend({
      */
     getColorFill: function(perc) {
         var ranges = this.conf.line_weather_colors.split(',');
+        alert(this.conf.line_weather_colors);
         // 0 contains the percentage until this color is used
         // 1 contains the color to be used
         for(var i = 0; i < ranges.length; i++) {
             var parts = ranges[i].split(':');
+            alert(parseInt(perc) + ' ' + parts[0]);
             if(parseInt(perc) <= parts[0])
                 return parts[1];
             parts = null;


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to