[icinga-checkins] icinga.org: icinga-web/mfriedrich/fixes: * Introducing: devel-mode ( disabled js caching)

git at icinga.org git at icinga.org
Mon Jan 10 09:04:58 CET 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Dec  9 15:36:49 2010 +0100

* Introducing: devel-mode (disabled js caching)

---

 .gitignore                                         |    1 +
 Makefile.in                                        |    1 +
 aclocal.m4                                         |    8 ++++
 .../{SquishLoader.xml => SquishLoader.xml.in}      |    2 +-
 app/modules/Cronks/lib/js/grid/GridPanel.js        |    3 +-
 configure                                          |   35 ++++++++++++++++++-
 configure.ac                                       |   13 +++++++-
 7 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0912c12..3976fc3 100755
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@ app/data/log/
 app/config/icinga.xml
 app/config/databases.xml
 app/modules/Web/config/icinga-io.xml
+app/modules/AppKit/cache/Widgets/SquishLoader.xml
 bin/clearcache.sh
 icinga-web.session
 icinga-web.webprj
diff --git a/Makefile.in b/Makefile.in
index b14d3f5..e5574cc 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -116,6 +116,7 @@ distclean:
 	app/config/databases.xml \
 	app/config/icinga.xml \
 	app/modules/Web/config/icinga-io.xml \
+	app/modules/AppKit/cache/Widgets/SquishLoader.xml \
 	etc/build.properties \
 	etc/tests/test.properties \
 	etc/apache2/icinga-web.conf \
diff --git a/aclocal.m4 b/aclocal.m4
index 33e9499..6d4c716 100755
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -56,3 +56,11 @@ AC_DEFUN([ACICINGA_CLEANUP_APICONFIG], [
 		ACICINGA_REMOVE_BLOCK([$FILE],[$T])
 	done
 ])
+
+AC_DEFUN([ACICINGA_DEVEL_MODE], [
+	AC_MSG_CHECKING([for devel-mode])
+	AS_IF([ test "$devel_mode" == "yes" ], [
+		flag_caching="false"
+		AC_MSG_RESULT([YES (!!)]) 
+	], [ AC_MSG_RESULT([no (good)]) ])
+])
\ No newline at end of file
diff --git a/app/modules/AppKit/cache/Widgets/SquishLoader.xml b/app/modules/AppKit/cache/Widgets/SquishLoader.xml.in
similarity index 86%
rename from app/modules/AppKit/cache/Widgets/SquishLoader.xml
rename to app/modules/AppKit/cache/Widgets/SquishLoader.xml.in
index 3409d61..89e4f36 100644
--- a/app/modules/AppKit/cache/Widgets/SquishLoader.xml
+++ b/app/modules/AppKit/cache/Widgets/SquishLoader.xml.in
@@ -3,7 +3,7 @@
 	<ae:configuration>
 
 		<cachings>
-			<caching method="read" lifetime="4 hours" enabled="true">
+			<caching method="read" lifetime="4 hours" enabled="@flag_caching@">
 
 				<group>javascript_content</group>
 
diff --git a/app/modules/Cronks/lib/js/grid/GridPanel.js b/app/modules/Cronks/lib/js/grid/GridPanel.js
index aefcb21..8976e2f 100755
--- a/app/modules/Cronks/lib/js/grid/GridPanel.js
+++ b/app/modules/Cronks/lib/js/grid/GridPanel.js
@@ -30,7 +30,8 @@ Cronk.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
 	buildTopToolbar : function() {
 		
 		var autoRefresh = AppKit.getPrefVal('org.icinga.grid.refreshTime') || 300;
-		var autoRefreshDefault = AppKit.getPrefVal('org.icinga.autoRefresh') && AppKit.getPrefVal('org.icinga.autoRefresh') != 'false' 
+		var autoRefreshDefault = AppKit.getPrefVal('org.icinga.autoRefresh') && AppKit.getPrefVal('org.icinga.autoRefresh') != 'false';
+		
 		return new Ext.Toolbar({
 			items: [{
 				text: _('Refresh'),
diff --git a/configure b/configure
index 64783f9..6fde2db 100755
--- a/configure
+++ b/configure
@@ -560,6 +560,7 @@ PACKAGE_URL=''
 ac_default_prefix=/usr/local/icinga-web
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+flag_caching
 INSTALL_OPTS_CACHE
 INSTALL_OPTS_WEB
 INSTALL_OPTS
@@ -667,6 +668,7 @@ with_api_db_user
 with_api_db_pass
 with_api_db_name
 with_api_db_prefix
+with_devel_mode
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1314,6 +1316,7 @@ Optional Packages:
                           DB name (default icinga)
   --with-api-db-prefix=PREFIX
                           DB table prefiy (default icinga_)
+  --with-devel-mode       Web devel mode (disable caching)
 
 Some influential environment variables:
   PHP         php cli binary
@@ -2492,13 +2495,38 @@ else
 fi
 
 
+
+# Check whether --with-devel_mode was given.
+if test "${with_devel_mode+set}" = set; then :
+  withval=$with_devel_mode; devel_mode=$withval
+else
+  devel_mode=no
+
+fi
+
+
 # Custom vars
 INSTALL_OPTS="-o $bin_user -g $bin_group"
 INSTALL_OPTS_WEB="-o $web_user -g $web_group"
 INSTALL_OPTS_CACHE="-o $web_user -g $web_group"
-
+flag_caching=true
 CFLAGS=""
 
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for devel-mode" >&5
+$as_echo_n "checking for devel-mode... " >&6; }
+	if  test "$devel_mode" == "yes" ; then :
+
+		flag_caching="false"
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: YES (!!)" >&5
+$as_echo "YES (!!)" >&6; }
+
+else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (good)" >&5
+$as_echo "no (good)" >&6; }
+fi
+
+
 # Substitutions
 
 
@@ -2536,7 +2564,9 @@ CFLAGS=""
 
 
 
-ac_config_files="$ac_config_files Makefile lib/Makefile pub/Makefile etc/Makefile bin/Makefile doc/Makefile app/Makefile etc/sitecfg/Makefile app/config/databases.xml app/config/icinga.xml app/modules/Web/config/icinga-io.xml etc/build.properties etc/tests/test.properties etc/apache2/icinga-web.conf bin/clearcache.sh pub/.htaccess pub/soap/.htaccess"
+
+
+ac_config_files="$ac_config_files Makefile lib/Makefile pub/Makefile etc/Makefile bin/Makefile doc/Makefile app/Makefile etc/sitecfg/Makefile app/config/databases.xml app/config/icinga.xml app/modules/Web/config/icinga-io.xml app/modules/AppKit/cache/Widgets/SquishLoader.xml etc/build.properties etc/tests/test.properties etc/apache2/icinga-web.conf bin/clearcache.sh pub/.htaccess pub/soap/.htaccess"
 
 
 cat >confcache <<\_ACEOF
@@ -3256,6 +3286,7 @@ do
     "app/config/databases.xml") CONFIG_FILES="$CONFIG_FILES app/config/databases.xml" ;;
     "app/config/icinga.xml") CONFIG_FILES="$CONFIG_FILES app/config/icinga.xml" ;;
     "app/modules/Web/config/icinga-io.xml") CONFIG_FILES="$CONFIG_FILES app/modules/Web/config/icinga-io.xml" ;;
+    "app/modules/AppKit/cache/Widgets/SquishLoader.xml") CONFIG_FILES="$CONFIG_FILES app/modules/AppKit/cache/Widgets/SquishLoader.xml" ;;
     "etc/build.properties") CONFIG_FILES="$CONFIG_FILES etc/build.properties" ;;
     "etc/tests/test.properties") CONFIG_FILES="$CONFIG_FILES etc/tests/test.properties" ;;
     "etc/apache2/icinga-web.conf") CONFIG_FILES="$CONFIG_FILES etc/apache2/icinga-web.conf" ;;
diff --git a/configure.ac b/configure.ac
index f3b9601..c1b4190 100755
--- a/configure.ac
+++ b/configure.ac
@@ -212,13 +212,21 @@ AC_ARG_WITH([api_db_prefix],
 	api_db_prefix=icinga_
 )
 
+AC_ARG_WITH([devel_mode],
+	AS_HELP_STRING([--with-devel-mode], [Web devel mode (disable caching)]),
+	devel_mode=$withval,
+	devel_mode=no
+)
+
 # Custom vars
 INSTALL_OPTS="-o $bin_user -g $bin_group"
 INSTALL_OPTS_WEB="-o $web_user -g $web_group"
 INSTALL_OPTS_CACHE="-o $web_user -g $web_group"
-
+flag_caching=true
 CFLAGS=""
 
+ACICINGA_DEVEL_MODE()
+
 # Substitutions
 AC_SUBST(web_user)
 AC_SUBST(web_group)
@@ -255,6 +263,8 @@ AC_SUBST(PHING)
 AC_SUBST(INSTALL_OPTS)
 AC_SUBST(INSTALL_OPTS_WEB)
 AC_SUBST(INSTALL_OPTS_CACHE)
+AC_SUBST(flag_caching)
+
 
 AC_CONFIG_FILES([
 	Makefile
@@ -268,6 +278,7 @@ AC_CONFIG_FILES([
 	app/config/databases.xml
 	app/config/icinga.xml
 	app/modules/Web/config/icinga-io.xml
+	app/modules/AppKit/cache/Widgets/SquishLoader.xml
 	etc/build.properties
 	etc/tests/test.properties
 	etc/apache2/icinga-web.conf





More information about the icinga-checkins mailing list