[icinga-checkins] icinga.org: icinga-web/cdoebler/default: * Defered creation of persistent cronks

git at icinga.org git at icinga.org
Fri Jan 22 12:05:30 CET 2010


Module: icinga-web
Branch: cdoebler/default
Commit: 5413e6d3805c0b43b69f3a43607de111db805e71
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=5413e6d3805c0b43b69f3a43607de111db805e71

Author: mhein <mhein at sasquatch.local.itsocks.de>
Date:   Thu Jan 21 16:26:14 2010 +0100

* Defered creation of persistent cronks
* Added a make target to purge the db user preferences

---

 Makefile.in                                        |   12 +++-
 .../Cronks/templates/System/CronkPortalSuccess.php |   62 +++++++++++---------
 etc/build.xml                                      |   12 ++++
 3 files changed, 54 insertions(+), 32 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index fdb0535..ccf33bf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -32,10 +32,11 @@ none:
 	@echo "\tdevclean - to a sourcecode ready for ci or packaging" 
 	@echo ""
 	@echo "Experimental targets:"
-	@echo "\tmake db-initialize - create the db"
-	@echo "\tmake db-deinitialize - reverse the path (removes all data and drop the relations)"
-	@echo "\tmake db-upgrade - tries to upgrade from a available db revision"
-	@echo "\tmake db-drop - create the entire db"
+	@echo "\tmake db-initialize			- create the db"
+	@echo "\tmake db-deinitialize		- reverse the path (removes all data and drop the relations)"
+	@echo "\tmake db-upgrade			- tries to upgrade from a available db revision"
+	@echo "\tmake db-drop				- create the entire db"
+	@echo "\tmake db-purge-userprefs	- purge existing user preferences"
 	@echo ""
 
 include $(INC_MAKE_FILES)
@@ -97,3 +98,6 @@ db-drop:
 db-upgrade:
 	$(PC) db-upgrade
 
+db-purge-userprefs:
+	$(PC) db-purge-userprefs
+	
diff --git a/app/cache/config/PLACEHOLDER b/app/cache/config/PLACEHOLDER
old mode 100755
new mode 100644
diff --git a/app/modules/Cronks/templates/System/CronkPortalSuccess.php b/app/modules/Cronks/templates/System/CronkPortalSuccess.php
index eeddbd9..53d5552 100644
--- a/app/modules/Cronks/templates/System/CronkPortalSuccess.php
+++ b/app/modules/Cronks/templates/System/CronkPortalSuccess.php
@@ -137,21 +137,27 @@ var tabPanel = new Ext.TabPanel({
 	},
 	
 	applyState: function(state) {
-		if (state.cronks) {
-			Ext.iterate(state.cronks, function(index, item, o) {
-				var config = {};
-				Ext.apply(config, item.config, item.crconf);
-				
-				var cronk = AppKit.Ext.CronkMgr.create(config);
-				
-				this.add(cronk);
-				
-			}, this);
+		(function() {
 			
-			this.doLayout();
+			if (state.cronks) {
+
+				// Adding all cronks
+				Ext.iterate(state.cronks, function(index, item, o) {
+					var config = {};
+					Ext.apply(config, item.config, item.crconf);
+					
+					var cronk = AppKit.Ext.CronkMgr.create(config);
+	
+					this.add(cronk);
+					
+				}, this);
+
+				// Sets tehe active tab
+				this.setActiveTab(state.active);
+			}
 			
-			this.setActiveTab(state.active);
-		}
+						
+		}).defer(200, this);
 	},
 	
 	// Here comes the drop zone
@@ -263,21 +269,21 @@ container.setHeight(Ext.lib.Dom.getViewHeight()-65);
 container.render("<?php echo $parentid; ?>");
 
 
-// Adding the first cronk (say hello here)
-if (tabPanel && tabPanel.items.getCount() <= 0) {
-	var cHello = AppKit.Ext.CronkMgr.create({
-		title: '<?php echo $tm->_("Welcome"); ?>',
-		crname: 'portalHello',
-		parentid: undefined,
-		layout: 'fit',
-		loaderUrl: "<?php echo $ro->gen('icinga.cronks.crloader', array('cronk' => null)); ?>",
-		closable: false
-	});
-	
-	tabPanel.add(cHello);
-	tabPanel.doLayout();	
-	tabPanel.setActiveTab(cHello);
-}
+//// Adding the first cronk (say hello here)
+//if (tabPanel && tabPanel.items.getCount() <= 0) {
+//	var cHello = AppKit.Ext.CronkMgr.create({
+//		title: '<?php echo $tm->_("Welcome"); ?>',
+//		crname: 'portalHello',
+//		parentid: undefined,
+//		layout: 'fit',
+//		loaderUrl: "<?php echo $ro->gen('icinga.cronks.crloader', array('cronk' => null)); ?>",
+//		closable: false
+//	});
+//	
+//	tabPanel.add(cHello);
+//	tabPanel.doLayout();	
+//	tabPanel.setActiveTab(cHello);
+//}
 
 // Adding the cronk list
 if ((west = Ext.getCmp('west-frame'))) {
diff --git a/etc/build.xml b/etc/build.xml
old mode 100755
new mode 100644
index df6309a..b670b03
--- a/etc/build.xml
+++ b/etc/build.xml
@@ -44,6 +44,18 @@
 			checkreturn="false" />
 	</target>
 	
+	<target name="db-purge-userprefs" depends="db-prepare">
+		
+		<property name="db.sql.truncateprefs" value="truncate table ${db.name}.nsm_user_preference" />
+		
+		<exec
+			command="${db.mysql.call_global} -e '${db.sql.truncateprefs}'"
+			dir="${builddir}"
+			passthru="true"
+			checkreturn="false" />
+		
+	</target>
+	
 	<target name="db-drop" depends="db-prepare">
 		
 		<property name="db.sql.drop" value="DROP DATABASE ${db.name};" />





More information about the icinga-checkins mailing list