[icinga-checkins] icinga.org: icinga-web/mhein/default: * Fixed oracle float interpretation causing NaN (uses ', ' instead of '.')

git at icinga.org git at icinga.org
Mon Nov 21 17:26:43 CET 2011


Module: icinga-web
Branch: mhein/default
Commit: 94636f80d0c43308481cee20a2dfb5e4533dccd7
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=94636f80d0c43308481cee20a2dfb5e4533dccd7

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Mon Nov 21 12:21:05 2011 +0100

* Fixed oracle float interpretation causing NaN (uses ',' instead of '.')

---

 .../Cronks/lib/js/Cronks/Tackle/SLAChartPanel.js   |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/SLAChartPanel.js b/app/modules/Cronks/lib/js/Cronks/Tackle/SLAChartPanel.js
index 4107ab1..0b32891 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/SLAChartPanel.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/SLAChartPanel.js
@@ -127,6 +127,13 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
             };
             
             for(var i=0;i<data.length;i++) {
+                data[i].percentage = parseFloat(data[i].percentage.replace(",","."),10);
+                
+                if(isNaN(data[i].percentage)) {
+                    AppKit.log("Object returned NaN as percentage");
+                    return {};
+                }
+
                 json.values.push({
                     label: this.getState(data[i].sla_state),
                     values: data[i].percentage < 0.1 ? 0.1 : data[i].percentage





More information about the icinga-checkins mailing list