[icinga-checkins] icinga.org: icinga-web/master: * Added autorefresh per default on StaticContent

git at icinga.org git at icinga.org
Thu Feb 16 14:26:31 CET 2012


Module: icinga-web
Branch: master
Commit: 869d16feefc9b923314dfed3d2f3b2dcc89a351f
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=869d16feefc9b923314dfed3d2f3b2dcc89a351f

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Thu Feb 16 14:23:47 2012 +0100

* Added autorefresh per default on StaticContent

---

 .../templates/System/StaticContentSuccess.php      |   26 +++++++++++++-------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/app/modules/Cronks/templates/System/StaticContentSuccess.php b/app/modules/Cronks/templates/System/StaticContentSuccess.php
index 9ae7edf..9901454 100755
--- a/app/modules/Cronks/templates/System/StaticContentSuccess.php
+++ b/app/modules/Cronks/templates/System/StaticContentSuccess.php
@@ -47,18 +47,19 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 									text: _('Refresh'),
 									iconCls: 'icinga-icon-arrow-refresh',
 									tooltip: _('Refresh the data in the grid'),
-									handler: function(oBtn, e) { panel.getUpdater().refresh(); }
-								}, {
+									handler: function(oBtn, e) { panel.getUpdater().refresh(); },
+                                    
+                                }, {
 									text: _('Settings'),
 									iconCls: 'icinga-icon-cog',
 									toolTip: _('Tactical overview settings'),
 									menu: {
 										items: [{
 											text: _('Auto refresh'),
-											checked: false,
+											checked: true,
 											checkHandler: function(checkItem, checked) {
 												if (checked == true) {
-													this.trefresh = AppKit.getTr().start({
+													panel.trefresh = AppKit.getTr().start({
 														run: function() {
 															this.getUpdater().refresh();
 														},
@@ -67,20 +68,27 @@ Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, fun
 													});
 												}
 												else {
-													AppKit.getTr().stop(this.trefresh);
-													delete this.trefresh;
+													AppKit.getTr().stop(panel.trefresh);
+													delete panel.trefresh;
 												}
 											}
+
 										}]
 									}
 								}]
 							}
 						});
-						
+
 						CE.add(panel);
-						
 						CE.doLayout();
-						
+                        //refresh
+						panel.trefresh = AppKit.getTr().start({
+                            run: function() {
+                                this.getUpdater().refresh();
+                            },
+                            interval: 120000,
+                            scope: panel
+                        });
 						return true;						
 					}
 					





More information about the icinga-checkins mailing list