[icinga-checkins] icinga.org: icinga-web/master: * Oracle precission fix of performnce cronk

git at icinga.org git at icinga.org
Fri Nov 18 17:05:37 CET 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Nov 17 17:44:49 2011 +0100

* Oracle precission fix of performnce cronk

---

 .../templates/System/MonitorPerformanceSuccess.php |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/modules/Cronks/templates/System/MonitorPerformanceSuccess.php b/app/modules/Cronks/templates/System/MonitorPerformanceSuccess.php
index af22d1e..0a92a6d 100644
--- a/app/modules/Cronks/templates/System/MonitorPerformanceSuccess.php
+++ b/app/modules/Cronks/templates/System/MonitorPerformanceSuccess.php
@@ -45,7 +45,7 @@ Cronk.util.initEnvironment("<?php echo $rd->getParameter('parentid'); ?>", funct
 			
 				'<div class="clearfix icinga-monitor-performance-container">',
 					'<div title="' + _('Services (active/passive/disabled)') + '" class="key icinga-icon-service"></div>',
-					'<div class="value">{NUM_ACTIVE_SERVICE_CHECKS} / {NUM_PASSIVE_SERVICE_CHECKS} /  / {NUM_DISABLED_SERVICE_CHECKS}</div>',
+					'<div class="value">{NUM_ACTIVE_SERVICE_CHECKS} / {NUM_PASSIVE_SERVICE_CHECKS} /  {NUM_DISABLED_SERVICE_CHECKS}</div>',
 				'</div>',
 				
 				'<div class="clearfix icinga-monitor-performance-container">',
@@ -70,7 +70,18 @@ Cronk.util.initEnvironment("<?php echo $rd->getParameter('parentid'); ?>", funct
 		store: ds,
 		tpl: mTpl,
 		itemSelector:'div.icinga-monitor-performance-container',
-        emptyText: 'Error'
+        emptyText: 'Error',
+        prepareData : function(data, recordIndex, record) {
+        	Ext.iterate(data, function(k, v) {
+        		v = String(v).replace(/,/, '.');
+        		if (k.indexOf('NUM_') === 0) {
+        			data[k] = Ext.util.Format.number(v, '0');
+        		} else if (k.indexOf('.') >>> -1) {
+        			data[k] = Ext.util.Format.number(v, '0.00');
+        		}
+        	}, this);
+        	return data;
+        }
 	});
 	
 	this.doLayout();	





More information about the icinga-checkins mailing list