[icinga-checkins] icinga.org: icinga-web/jmosshammer/default2: * New overall status cronk ready

git at icinga.org git at icinga.org
Mon Jul 19 10:36:00 CEST 2010


Module: icinga-web
Branch: jmosshammer/default2
Commit: 222942ea4938932ac68c20e823f49224480c10cf
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=222942ea4938932ac68c20e823f49224480c10cf

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Jun 22 14:09:15 2010 +0200

* New overall status cronk ready
* Single click for search results
* Simple text status through the JS API (Icinga.StatusData)

---

 app/modules/Cronks/lib/js/Cronk.js                 |    2 +-
 app/modules/Cronks/lib/js/CronkTabpanel.js         |    2 +-
 .../Cronks/templates/System/CronkPortalSuccess.php |    2 +-
 .../templates/System/ObjectSearchSuccess.php       |    2 +-
 .../templates/System/StatusOverallSuccess.php      |   29 +++++++++++++++++---
 app/modules/Web/lib/js/StatusData.js               |    6 +++-
 6 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronk.js b/app/modules/Cronks/lib/js/Cronk.js
index 12a297d..932bb98 100755
--- a/app/modules/Cronks/lib/js/Cronk.js
+++ b/app/modules/Cronks/lib/js/Cronk.js
@@ -146,7 +146,7 @@ Cronk.defaults.CONFIG_COPY = [
 			this.applyCronkConfig();
 			
 			this.applyCronkEvents();
-			
+			// AppKit.log("CREATE", this.getCronkInitialConfig(this.configCopy));
 			Cronk.Registry.add(this.getCronkInitialConfig(this.configCopy));
 		},
 		
diff --git a/app/modules/Cronks/lib/js/CronkTabpanel.js b/app/modules/Cronks/lib/js/CronkTabpanel.js
index 0366041..e698c95 100755
--- a/app/modules/Cronks/lib/js/CronkTabpanel.js
+++ b/app/modules/Cronks/lib/js/CronkTabpanel.js
@@ -24,7 +24,7 @@ Ext.extend(Cronk.util.Tabpanel, Ext.ux.SlidingTabPanel, {
 				cout[item.getId()] = Cronk.Registry.get(item.getId());
 			}
 		});
-		
+		// AppKit.log("STATE", cout);
 		var t = this.getActiveTab();
 		
 		return {
diff --git a/app/modules/Cronks/templates/System/CronkPortalSuccess.php b/app/modules/Cronks/templates/System/CronkPortalSuccess.php
index 0907f02..2248713 100755
--- a/app/modules/Cronks/templates/System/CronkPortalSuccess.php
+++ b/app/modules/Cronks/templates/System/CronkPortalSuccess.php
@@ -17,7 +17,7 @@ Cronk.util.initEnvironment('viewport-center', function() {
 			region: 'north',
 			id: 'north-frame',
 			layout: 'column',
-			style: 'height: 50px;',
+			style: 'height: 50px; padding: 5px; background-color: #ffffff',
 			defaults: { border: false },
 			autoHeight: true,
 
diff --git a/app/modules/Cronks/templates/System/ObjectSearchSuccess.php b/app/modules/Cronks/templates/System/ObjectSearchSuccess.php
index 8493f58..29db20a 100755
--- a/app/modules/Cronks/templates/System/ObjectSearchSuccess.php
+++ b/app/modules/Cronks/templates/System/ObjectSearchSuccess.php
@@ -144,7 +144,7 @@ Cronk.util.initEnvironment("<?php echo $parentid = $rd->getParameter('parentid')
 			        }),
 					
 					listeners: {
-						celldblclick: oSearchHandler.doubleClickProc
+						cellclick: oSearchHandler.doubleClickProc
 					},
 					
 					store: oStore()
diff --git a/app/modules/Cronks/templates/System/StatusOverallSuccess.php b/app/modules/Cronks/templates/System/StatusOverallSuccess.php
index 40e5b03..e5c01b7 100644
--- a/app/modules/Cronks/templates/System/StatusOverallSuccess.php
+++ b/app/modules/Cronks/templates/System/StatusOverallSuccess.php
@@ -39,11 +39,32 @@ Cronk.util.initEnvironment("<?php echo $rd->getParameter('parentid'); ?>", funct
 			listeners: {
 				click: function(dview, index, node, e) {
 					var d = dview.getStore().getAt(index).data;
-					var template = 'icinga-' + d.type + '-template';
-					var id = 'status-overall-' + d.type + d.state_org;
-					var c = {
-						
+
+					var params = {
+						template: 'icinga-' + d.type + '-template'
+					};
+
+					var filter = {};
+
+					// 100 is the summary of all (== no filter)
+					if (d.state_org < 100) {
+						filter['f[' + d.type + '_status-value]'] = d.state_org;
+						filter['f[' + d.type + '_status-operator]'] = 50;
 					}
+
+					var id = 'status-overall-grid' + d.type + '-' + d.state_org;
+
+					var cronk = {
+						parentid: id,
+						id: id + '-frame',
+						stateuid: id + '-persistent',
+						title: String.format('{0}s {1}', d.type, Icinga.StatusData.simpleText(d.type, d.state_org).toLowerCase()),
+						crname: 'gridProc',
+						closable: true,
+						params: params
+					};
+
+					Cronk.util.InterGridUtil.gridFilterLink(cronk, filter);
 				}
 			},
 
diff --git a/app/modules/Web/lib/js/StatusData.js b/app/modules/Web/lib/js/StatusData.js
index 8bbda70..ac71ebd 100755
--- a/app/modules/Web/lib/js/StatusData.js
+++ b/app/modules/Web/lib/js/StatusData.js
@@ -111,7 +111,11 @@ Icinga.StatusData = (function() {
 		wrapText : function(type, statusid, format) {
 			return textTemplate.apply(elementWrapper(type, statusid, format));
 		},
-		
+
+		simpleText : function(type, statusid, format) {
+			return elementWrapper(type, statusid, format).text;
+		},
+
 		renderServiceStatus : function(value, metaData, record, rowIndex, colIndex, store) {
 			return Icinga.StatusData.wrapElement('service', value);
 		},





More information about the icinga-checkins mailing list