[icinga-checkins] icinga.org: icinga-web/mhein/default: * added validators to status map

git at icinga.org git at icinga.org
Thu Oct 8 13:45:23 CEST 2009


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

Author: Christian Doebler <christian.doebler at netways.de>
Date:   Wed Oct  7 10:00:32 2009 +0200

* added validators to status map
* wrapped up status map in dynamic containers

---

 .../Cronks/templates/System/StatusMapSuccess.php   |   45 ++++++++++++++++----
 app/modules/Cronks/validate/System/StatusMap.xml   |   12 +++++
 .../Cronks/validate/System/StatusSummary.xml       |   30 +++++++-------
 pub/styles/statusmap.css                           |    4 ++
 4 files changed, 67 insertions(+), 24 deletions(-)

diff --git a/app/modules/Cronks/templates/System/StatusMapSuccess.php b/app/modules/Cronks/templates/System/StatusMapSuccess.php
index ad92dad..6041ea6 100644
--- a/app/modules/Cronks/templates/System/StatusMapSuccess.php
+++ b/app/modules/Cronks/templates/System/StatusMapSuccess.php
@@ -2,16 +2,8 @@
 	/**
 	* @author Christian Doebler <christian.doebler at netways.de>
 	*/
+	$parentId = $rd->getParameter('parentid');
 ?>
-<div id="jitContainer">
-	<div id="jitContainerCenter">
-		<div id="jitMap"></div>    
-	</div>
-	<div id="jitContainerRight">
-		<div id="jitDetails"></div>
-	</div>
-	<div id="jitLog"></div>
-</div>
 <script type="text/javascript">
 	function jitAddEvent(obj, type, fn) {
 		if (obj.addEventListener) {
@@ -33,6 +25,8 @@
 
 	function JitStatusMap (config) {
 
+		this.cmp = Ext.getCmp("<?php echo $parentId; ?>");
+
 		this.config = {
 			url: false,
 			params: false,
@@ -116,6 +110,7 @@
 
 		this.init = function (config) {
 			this.setConfig(config);
+			this.createContainer();
 			this.getMapData();
 		}
 
@@ -130,6 +125,38 @@
 			}
 		}
 
+		this.createContainer = function () {
+			var container = new Ext.Container({
+				id: "jitContainer",
+				autoEl: 'div', 
+				layout: 'column',
+				defaults: {
+					xtype: 'container',
+					autoEl: 'div',
+					layout: 'auto',
+					//columnWidth: 0.5,
+					style: {
+						border: "none"
+					}
+				},
+				items : [{
+					id: "jitContainerCenter",
+					items: {
+						id: "jitMap"
+					}
+				},{
+					id: "jitContainerRight",
+					items: {
+						id: "jitDetails"
+					}
+				},{
+					id: "jitLog"
+				}]
+			});
+			this.cmp.add(container);
+			this.cmp.doLayout();
+		}
+
 		this.getMapData = function () {
 			var ajax = Ext.Ajax.request({
 				url : this.config.url,
diff --git a/app/modules/Cronks/validate/System/StatusMap.xml b/app/modules/Cronks/validate/System/StatusMap.xml
index bfa516d..dacacaf 100644
--- a/app/modules/Cronks/validate/System/StatusMap.xml
+++ b/app/modules/Cronks/validate/System/StatusMap.xml
@@ -7,6 +7,18 @@
 	<ae:configuration>
 		
 		<validators>
+			<validator class="string" name="cmpid" required="false">
+				<argument>cmpid</argument>
+				<errors>
+					<error>Validation of htmlid failed!</error>
+				</errors>
+			</validator>
+			<validator class="string" name="parentid" required="false">
+				<argument>parentid</argument>
+				<errors>
+					<error>Validation of parentid failed!</error>
+				</errors>
+			</validator>
 		</validators>
 		
 	</ae:configuration>
diff --git a/app/modules/Cronks/validate/System/StatusSummary.xml b/app/modules/Cronks/validate/System/StatusSummary.xml
index 118fb7e..65a05e0 100644
--- a/app/modules/Cronks/validate/System/StatusSummary.xml
+++ b/app/modules/Cronks/validate/System/StatusSummary.xml
@@ -8,21 +8,21 @@
 		
 		<validators>
 
-		<validator class="string" name="cmpid" required="false">
-					<argument>cmpid</argument>
-					
-					<errors>
-						<error>Validation of htmlid failed!</error>
-					</errors>
-		</validator>
-		
-		<validator class="string" name="parentid" required="false">
-					<argument>parentid</argument>
-					
-					<errors>
-						<error>Validation of parentid failed!</error>
-					</errors>
-		</validator>
+			<validator class="string" name="cmpid" required="false">
+						<argument>cmpid</argument>
+						
+						<errors>
+							<error>Validation of htmlid failed!</error>
+						</errors>
+			</validator>
+			
+			<validator class="string" name="parentid" required="false">
+						<argument>parentid</argument>
+						
+						<errors>
+							<error>Validation of parentid failed!</error>
+						</errors>
+			</validator>
 
 			<validator class="string" name="type" required="true">
 					<argument>type</argument>
diff --git a/pub/styles/statusmap.css b/pub/styles/statusmap.css
index 9cc1aba..55355af 100644
--- a/pub/styles/statusmap.css
+++ b/pub/styles/statusmap.css
@@ -43,4 +43,8 @@
     height:600px;
     margin:auto;
     overflow:hidden;
+}
+
+#jitMap div {
+	border: none;
 }
\ No newline at end of file





More information about the icinga-checkins mailing list