[icinga-checkins] icinga.org: icinga-web/mhein/default: * Settings for grid panels

git at icinga.org git at icinga.org
Thu Jan 28 14:54:58 CET 2010


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

Author: Marius Hein <mhein at sasquatch.local.itsocks.de>
Date:   Thu Jan 28 14:54:28 2010 +0100

* Settings for grid panels
* Auto refresh for grid panels

---

 .../Cronks/templates/System/PortalViewSuccess.php  |    6 ++-
 lib/appkit/js/ext/ExtJs.js                         |    6 ++++
 lib/appkit/js/ext/grid/GridPanel.js                |   30 ++++++++++++++++++++
 pub/styles/silk-icons.css                          |    3 +-
 4 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/app/modules/Cronks/templates/System/PortalViewSuccess.php b/app/modules/Cronks/templates/System/PortalViewSuccess.php
index 8e8bd5b..8f1da71 100644
--- a/app/modules/Cronks/templates/System/PortalViewSuccess.php
+++ b/app/modules/Cronks/templates/System/PortalViewSuccess.php
@@ -216,6 +216,7 @@
 				stateId: stateuid,
 				stateful: true,
 				
+				// @todo The collapse event does not work?
 				stateEvents: ['add', 'remove', 'titlechange', 'resize'],
 				
 				getState: function () {
@@ -234,7 +235,8 @@
 								
 								c.config.title = cronk.title;
 								c.config.height = cronk.getHeight();
-								
+								c.config.collapsed = cronk.collapsed;
+//								console.log("COL: " + cronk.collapsed);
 								d[cindex][cronk.getId()] = c;
 							}
 							
@@ -260,7 +262,7 @@
 								Ext.iterate(item, function (key, citem, o) {
 									var c = {}
 									Ext.apply(c, citem.config, citem.crconf);
-									
+//									console.log(c);
 									c.tools = tools;
 									
 									var cronk = AppKit.Ext.CronkMgr.create(c);
diff --git a/lib/appkit/js/ext/ExtJs.js b/lib/appkit/js/ext/ExtJs.js
index 900399a..6131941 100644
--- a/lib/appkit/js/ext/ExtJs.js
+++ b/lib/appkit/js/ext/ExtJs.js
@@ -65,6 +65,8 @@ AppKit.Ext = function() {
                 '</div>'].join('');
 	};
 	
+	var taskRunner = new Ext.util.TaskRunner();
+	
 	// Extending Observable to use event system
 	pub = Ext.extend(Ext.util.Observable, {
 		constructor : function() {
@@ -81,6 +83,10 @@ AppKit.Ext = function() {
 	// Our public interface
 	Ext.override(pub, {
 		
+		getTr : function() {
+			return taskRunner;
+		},
+		
 		bogusHandler : function(oBtn, e) {
 			AppKit.Ext.Message('Button clicked ...', 'button {0} was clicked ...', oBtn.getItemId());
 		},
diff --git a/lib/appkit/js/ext/grid/GridPanel.js b/lib/appkit/js/ext/grid/GridPanel.js
index 892efd8..f609e8d 100644
--- a/lib/appkit/js/ext/grid/GridPanel.js
+++ b/lib/appkit/js/ext/grid/GridPanel.js
@@ -19,6 +19,36 @@ AppKit.Ext.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
 			tooltip: 'Refresh the data in the grid',
 			handler: function(oBtn, e) { this.store.reload(); },
 			scope: this
+		}, {
+			text: 'Settings',
+			iconCls: 'silk-cog',
+			toolTip: 'Grid settings',
+			menu: {
+				items: [{
+					xtype: 'button',
+					text: 'Auto refresh',
+					iconCls: 'silk-database-refresh',
+					enableToggle: true,
+					handler: function(oBtn, e) {
+						
+						if (oBtn.pressed == true) {
+							this.trefresh = AppKit.Ext.getTr().start({
+								run: function() {
+									this.getStore().reload();
+								},
+								interval: 120000,
+								scope: this
+							});
+						}
+						else {
+							AppKit.Ext.getTr().stop(this.trefresh);
+							delete this.trefresh;
+						}
+						
+					},
+					scope: this
+				}]
+			}
 		}];
 	},
 	
diff --git a/pub/styles/silk-icons.css b/pub/styles/silk-icons.css
index 5006a38..3615659 100644
--- a/pub/styles/silk-icons.css
+++ b/pub/styles/silk-icons.css
@@ -177,4 +177,5 @@
 .silk-vector { background-image: url(../images/fam/vector.png) !important; background-repeat: no-repeat; }
 .silk-wrench { background-image: url(../images/fam/wrench.png) !important; background-repeat: no-repeat; }
 .silk-world { background-image: url(../images/fam/world.png) !important; background-repeat: no-repeat; }
-.silk-zoom { background-image: url(../images/fam/zoom.png) !important; background-repeat: no-repeat; }
\ No newline at end of file
+.silk-zoom { background-image: url(../images/fam/zoom.png) !important; background-repeat: no-repeat; }
+.silk-database-refresh { background-image: url(../images/fam/database_refresh.png) !important; background-repeat: no-repeat; }
\ No newline at end of file





More information about the icinga-checkins mailing list