[icinga-checkins] icinga.org: icinga-web/mfriedrich/fixes: * Fixed last_check time in tackle view to work with ff

git at icinga.org git at icinga.org
Tue Nov 15 13:36:49 CET 2011


Module: icinga-web
Branch: mfriedrich/fixes
Commit: 3ad734f14ab50b2a675444221bc07c3483d66395
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=3ad734f14ab50b2a675444221bc07c3483d66395

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Tue Nov 15 00:56:06 2011 +0100

* Fixed last_check time in tackle view to work with ff

---

 .../Cronks/lib/js/Cronks/Tackle/ObjectGrid.js      |    7 ++++---
 .../Cronks/lib/js/Cronks/Tackle/ServicesSubGrid.js |    6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/ObjectGrid.js b/app/modules/Cronks/lib/js/Cronks/Tackle/ObjectGrid.js
index d1a7a9d..bc1c83e 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/ObjectGrid.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/ObjectGrid.js
@@ -275,11 +275,12 @@ Icinga.Cronks.Tackle.ObjectGrid = Ext.extend(Ext.grid.GridPanel, {
                 renderer: function(value,meta,record) {
                    var str = AppKit.util.Date.getElapsedString(value);
                    var now = new Date();
-                   var lastCheckDate = new Date(value);
-                   var nextCheckDate = new Date(record.get('HOST_NEXT_CHECK'));
+                   var lastCheckDate = Date.parseDate(value,'Y-m-d H:i:s');
+                   var nextCheckDate = Date.parseDate(record.get('HOST_NEXT_CHECK'),'Y-m-d H:i:s');
+
                    var elapsed = parseInt(now.getElapsed(lastCheckDate)/1000,10);
                    
-                   if(!now.between(lastCheckDate,nextCheckDate))
+                   if(!now.between(lastCheckDate,nextCheckDate.add(Date.SECOND,30)))
                        return "<div style='color:red;padding-left:19px;background-position: left center;' class='icinga-icon-exclamation-red'"+
                               " qtip='Should have been checked "+AppKit.util.Date.getElapsedString(value)+"'>"+value+"</div>";
                    if(elapsed > (60*60*24))
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/ServicesSubGrid.js b/app/modules/Cronks/lib/js/Cronks/Tackle/ServicesSubGrid.js
index bd85275..a761039 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/ServicesSubGrid.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/ServicesSubGrid.js
@@ -155,11 +155,11 @@ Icinga.Cronks.Tackle.ServicesSubGrid = Ext.extend(Ext.grid.GridPanel, {
                 renderer: function(value,meta,record) {
                    var str = AppKit.util.Date.getElapsedString(value);
                    var now = new Date();
-                   var lastCheckDate = new Date(value);
-                   var nextCheckDate = new Date(record.get('SERVICE_NEXT_CHECK'));
+                   var lastCheckDate = Date.parseDate(value,'Y-m-d H:i:s');
+                   var nextCheckDate = Date.parseDate(record.get('SERVICE_NEXT_CHECK'),'Y-m-d H:i:s');
                    var elapsed = parseInt(now.getElapsed(lastCheckDate)/1000,10);
 
-                   if(!now.between(lastCheckDate,nextCheckDate))
+                   if(!now.between(lastCheckDate,nextCheckDate.add(Date.SECOND,30)))
                        return "<div style='color:red;padding-left:19px;background-position: left center;' class='icinga-icon-exclamation-red'"+
                               " qtip='Should have been checked "+AppKit.util.Date.getElapsedString(value)+"'>"+value+"</div>";
                    if(elapsed > (60*60*24))





More information about the icinga-checkins mailing list