[icinga-checkins] icinga.org: icinga-web/next: Fix pending state handling in ColumnRenderer for IcingaStatus (refs #3843)

git at icinga.org git at icinga.org
Wed Mar 13 12:19:29 CET 2013


Module: icinga-web
Branch: next
Commit: 29be57a764c0f75ed1cca371db0bf979477c795b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=29be57a764c0f75ed1cca371db0bf979477c795b

Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Tue Mar 12 17:09:48 2013 +0100

Fix pending state handling in ColumnRenderer for IcingaStatus (refs #3843)

the problem was caused by an string to int comparsion using ===

---

 .../renderer/AdvancedHostStatusColumnRenderer.js   |    2 +-
 .../lib/js/Cronk/grid/renderer/ColumnRenderer.js   |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js b/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js
index c9ea257..12760e6 100644
--- a/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/renderer/AdvancedHostStatusColumnRenderer.js
@@ -138,7 +138,7 @@ Ext.ns('Cronk.grid');
         this.hostStatus = function () {
             return function (value, metaData, record, rowIndex, colIndex, store) {
                 if (Ext.isDefined(record.json.host_has_been_checked)) {
-                    if (record.json.host_has_been_checked === 0) {
+                    if (record.json.host_has_been_checked == 0) {
                         value = 99;
                     }
                 }
diff --git a/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js b/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js
index c96833b..8a4943e 100755
--- a/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/renderer/ColumnRenderer.js
@@ -252,11 +252,11 @@ Ext.ns('Cronk.grid');
                 return function (value, metaData, record, rowIndex, colIndex, store) {
 
                     if (Ext.isDefined(record.json.service_is_pending)) {
-                        if (record.json.service_is_pending > 0) {
+                        if (record.json.service_is_pending == 1) {
                             value = 99;
                         }
                     } else if (Ext.isDefined(record.json.service_has_been_checked)) {
-                        if (record.json.service_has_been_checked === 0) {
+                        if (record.json.service_has_been_checked == 0) {
                             value = 99;
                         }
                     }
@@ -270,11 +270,11 @@ Ext.ns('Cronk.grid');
             hostStatus: function (cfg) {
                 return function (value, metaData, record, rowIndex, colIndex, store) {
                     if (Ext.isDefined(record.json.host_is_pending)) {
-                        if (record.json.host_is_pending > 0) {
+                        if (record.json.host_is_pending == 1) {
                             value = 99;
                         }
                     } else if (Ext.isDefined(record.json.host_has_been_checked)) {
-                        if (record.json.host_has_been_checked === 0) {
+                        if (record.json.host_has_been_checked == 0) {
                             value = 99;
                         }
                     }
@@ -312,4 +312,4 @@ Ext.ns('Cronk.grid');
             }
     };
 
-})();
\ No newline at end of file
+})();





More information about the icinga-checkins mailing list