[icinga-checkins] icinga.org: icinga-web/mhein/default: * Added new filters (fixes #573)

git at icinga.org git at icinga.org
Thu Jan 13 12:44:34 CET 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Jan 13 12:44:16 2011 +0100

* Added new filters (fixes #573)

---

 .../Cronks/data/xml/grid/icinga-host-template.xml  |   25 ++++++++++++-
 .../data/xml/grid/icinga-service-template.xml      |   21 +++++++++++
 app/modules/Cronks/lib/js/FilterHandler.js         |   38 ++++++++++++--------
 .../IcingaTemplateDisplayServiceIcons.class.php    |    4 +-
 4 files changed, 69 insertions(+), 19 deletions(-)

diff --git a/app/modules/Cronks/data/xml/grid/icinga-host-template.xml b/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
index 9fdffb6..9cac424 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
@@ -234,6 +234,24 @@
 				<parameter name="api_valuefield">HOSTGROUP_NAME</parameter>
 
         	</paramter>
+        	<paramter name="notifications_enabled">
+        		<parameter name="enabled">true</parameter>
+        		<parameter name="type">extjs</parameter>
+        		<parameter name="subtype">appkit.ext.filter.bool</parameter>
+        		<parameter name="label">Notifications enabled</parameter>
+        	</paramter>
+        	<paramter name="problem_acknowledged">
+        		<parameter name="enabled">true</parameter>
+        		<parameter name="type">extjs</parameter>
+        		<parameter name="subtype">appkit.ext.filter.bool</parameter>
+        		<parameter name="label">Acknowledged</parameter>
+        	</paramter>
+        	<paramter name="scheduled_downtime_depth">
+        		<parameter name="enabled">true</parameter>
+        		<parameter name="type">extjs</parameter>
+        		<parameter name="subtype">appkit.ext.filter.bool</parameter>
+        		<parameter name="label">In Downtime</parameter>
+        	</paramter>
         </parameter>
     </option>
     
@@ -274,7 +292,10 @@
 			<parameter name="servicegroup_name">SERVICEGROUP_NAME</parameter>
        		<parameter name="custom_variable_name">HOST_CUSTOMVARIABLE_NAME</parameter>
        		<parameter name="custom_variable_value">HOST_CUSTOMVARIABLE_VALUE</parameter>
-
+			<parameter name="notifications_enabled">HOST_NOTIFICATIONS_ENABLED</parameter>
+			<parameter name="problem_acknowledged">HOST_PROBLEM_HAS_BEEN_ACKNOWLEDGED</parameter>
+			<parameter name="scheduled_downtime_depth">HOST_SCHEDULED_DOWNTIME_DEPTH</parameter>
+			
 			<!-- Some mapping for stupid filters -->
 			<parameter name="customvariable_name">HOST_CUSTOMVARIABLE_NAME</parameter>
 			<parameter name="customvariable_value">HOST_CUSTOMVARIABLE_VALUE</parameter>
@@ -530,7 +551,7 @@
 	                	<parameter name="arguments">
 	                		<parameter name="title">EventDB for {host_name}</parameter>
 	                		<parameter name="url"><![CDATA[http://localhost/{host_name}/{host_object_id}]]></parameter>
-					<parameter name="activateOnClick">true</parameter>
+							<parameter name="activateOnClick">true</parameter>
 	                	</parameter>
 	                </parameter>
                 </parameter>
diff --git a/app/modules/Cronks/data/xml/grid/icinga-service-template.xml b/app/modules/Cronks/data/xml/grid/icinga-service-template.xml
index 533d830..e19d301 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-service-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-service-template.xml
@@ -206,6 +206,24 @@
 				<parameter name="api_keyfield">SERVICEGROUP_NAME</parameter>
 				<parameter name="api_valuefield">SERVICEGROUP_NAME</parameter>
         	</paramter>
+        	<paramter name="notifications_enabled">
+        		<parameter name="enabled">true</parameter>
+        		<parameter name="type">extjs</parameter>
+        		<parameter name="subtype">appkit.ext.filter.bool</parameter>
+        		<parameter name="label">Notifications enabled</parameter>
+        	</paramter>
+        	<paramter name="problem_acknowledged">
+        		<parameter name="enabled">true</parameter>
+        		<parameter name="type">extjs</parameter>
+        		<parameter name="subtype">appkit.ext.filter.bool</parameter>
+        		<parameter name="label">Acknowledged</parameter>
+        	</paramter>
+        	<paramter name="scheduled_downtime_depth">
+        		<parameter name="enabled">true</parameter>
+        		<parameter name="type">extjs</parameter>
+        		<parameter name="subtype">appkit.ext.filter.bool</parameter>
+        		<parameter name="label">In Downtime</parameter>
+        	</paramter>
         </parameter>
         
     </option>
@@ -248,6 +266,9 @@
        		<parameter name="servicegroup_name">SERVICEGROUP_NAME</parameter>
 			<parameter name="custom_variable_name">SERVICE_CUSTOMVARIABLE_NAME</parameter>
        		<parameter name="custom_variable_value">SERVICE_CUSTOMVARIABLE_VALUE</parameter>
+       		<parameter name="notifications_enabled">SERVICE_NOTIFICATIONS_ENABLED</parameter>
+			<parameter name="problem_acknowledged">SERVICE_PROBLEM_HAS_BEEN_ACKNOWLEDGED</parameter>
+			<parameter name="scheduled_downtime_depth">SERVICE_SCHEDULED_DOWNTIME_DEPTH</parameter>
 
 			<!-- Stupid filter mapping -->
 			<parameter name="customvariable_name">SERVICE_CUSTOMVARIABLE_NAME</parameter>
diff --git a/app/modules/Cronks/lib/js/FilterHandler.js b/app/modules/Cronks/lib/js/FilterHandler.js
index 3a1b702..8bd1842 100755
--- a/app/modules/Cronks/lib/js/FilterHandler.js
+++ b/app/modules/Cronks/lib/js/FilterHandler.js
@@ -87,28 +87,34 @@ Cronk.FilterHandler = Ext.extend(Ext.util.Observable, {
 		'appkit.ext.filter.text': 'text',
 		'appkit.ext.filter.number': 'number',
 		'appkit.ext.filter.servicestatus': 'number',
-		'appkit.ext.filter.hoststatus': 'number'
+		'appkit.ext.filter.hoststatus': 'number',
+		'appkit.ext.filter.bool': 'bool'
 	},
 	
 	oOpList : {
 		text: [
-			[60, 'contain'],
-			[61, 'does not contain'],
-			[50, 'is'],
-			[51, 'is not']
+			[60, _('contain')],
+			[61, _('does not contain')],
+			[50, _('is')],
+			[51, _('is not')]
 		]	,
 		
 		number: [
-			[50, 'is'],
-			[51, 'is not'],
-			[70, 'less than'],
-			[71, 'greater than']
+			[50, _('is')],
+			[51, _('is not')],
+			[70, _('less than')],
+			[71, _('greater than')]
+		],
+		
+		bool: [
+			[50, _('is')]
 		]
 	},
 	
 	oOpDefault : {
 		number: 50,
-		text: 60
+		text: 60,
+		bool: 50
 	},
 	
 	meta : {},
@@ -241,11 +247,6 @@ Cronk.FilterHandler = Ext.extend(Ext.util.Observable, {
 			width : 110
 		});
 		
-		// Select tester
-		// oCombo.on('select', function(c, record, index) {
-		// 
-		// }, this);
-		
 		// Set the default value after rendering
 		oCombo.on('render', function(c) {
 			c.setValue(this.oOpDefault[type]);
@@ -321,6 +322,13 @@ Cronk.FilterHandler = Ext.extend(Ext.util.Observable, {
 				], meta);
 			break;
 			
+			case 'appkit.ext.filter.bool':
+				return this.getComboComponent([
+					['1', '1', _('Yes')],
+					['2', '0', _('No')]
+				], meta);
+			break;
+			
 			case 'appkit.ext.filter.hoststatus':
 				return this.getComboComponent([
 					['1', '0', 'UP'],
diff --git a/app/modules/Web/lib/tdisplay/IcingaTemplateDisplayServiceIcons.class.php b/app/modules/Web/lib/tdisplay/IcingaTemplateDisplayServiceIcons.class.php
index 82c47f1..93f54a2 100755
--- a/app/modules/Web/lib/tdisplay/IcingaTemplateDisplayServiceIcons.class.php
+++ b/app/modules/Web/lib/tdisplay/IcingaTemplateDisplayServiceIcons.class.php
@@ -56,7 +56,7 @@ class IcingaTemplateDisplayServiceIcons extends IcingaTemplateDisplay {
 		),
 		
 		'${field.SERVICE_SCHEDULED_DOWNTIME_DEPTH}' => array (
-			true	=> array ('downtime.png', 'Service is flapping')
+			true	=> array ('downtime.png', 'In downtime')
 		)
 	);
 	
@@ -101,7 +101,7 @@ class IcingaTemplateDisplayServiceIcons extends IcingaTemplateDisplay {
 		),
 		
 		'${field.HOST_SCHEDULED_DOWNTIME_DEPTH}' => array (
-			true	=> array ('downtime.png', 'Service is flapping')
+			true	=> array ('downtime.png', 'In downtime')
 		)
 	);
 	





More information about the icinga-checkins mailing list