diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-11 11:48:58 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-11 11:48:58 +0000 |
commit | a5c435223703507964d991c38aed30f5b576f38c (patch) | |
tree | 12451fbfaa04b8f4149875f81cf5a99567d412e7 | |
parent | 419b228afeba243106a8757543cde23bbdd03189 (diff) | |
download | zabbix-a5c435223703507964d991c38aed30f5b576f38c.tar.gz zabbix-a5c435223703507964d991c38aed30f5b576f38c.tar.xz zabbix-a5c435223703507964d991c38aed30f5b576f38c.zip |
- [DEV-118] quick fix to refresh methods in dashboard screen (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5469 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | frontends/php/events.php | 2 | ||||
-rw-r--r-- | frontends/php/js/dashboard.js | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/frontends/php/events.php b/frontends/php/events.php index 0fb8229c..82ac00d3 100644 --- a/frontends/php/events.php +++ b/frontends/php/events.php @@ -475,7 +475,7 @@ include_once "include/page_header.php"; new CSpan(' | ','divider'), new CSpan(array($next,' »'),'textcolorstyles')); - $filter = create_filter(S_FILTER,$navigation,$filterForm,'tr_filter',get_profile('web.events.filter.state',1)); + $filter = create_filter(S_FILTER,$navigation,$filterForm,'tr_filter',get_profile('web.events.filter.state',0)); $filter->Show(); //------- diff --git a/frontends/php/js/dashboard.js b/frontends/php/js/dashboard.js index ad7e0df8..424e0ed3 100644 --- a/frontends/php/js/dashboard.js +++ b/frontends/php/js/dashboard.js @@ -93,7 +93,8 @@ interval: 10, // update interval in sec 'url': url, 'params': params, 'interval': frequency, - 'lastupdate': 0 + 'lastupdate': 0, + 'ready': true } if(typeof(this.optlist[id]) == 'undefined'){ @@ -110,7 +111,7 @@ interval: 10, // update interval in sec for(var i=0; i < this.objlist.length; i++){ if((typeof(this.optlist[this.objlist[i]]) != 'undefined') && !empty(this.optlist[this.objlist[i]])){ // alert(Math.abs(now - this.optlist[this.objlist[i]].lastupdate)); - if(this.optlist[this.objlist[i]].interval <= Math.abs(now - this.optlist[this.objlist[i]].lastupdate)){ + if(this.optlist[this.objlist[i]].ready && (this.optlist[this.objlist[i]].interval <= Math.abs(now - this.optlist[this.objlist[i]].lastupdate))){ this.update(this.optlist[this.objlist[i]],now); } } @@ -120,12 +121,14 @@ interval: 10, // update interval in sec }, update: function(obj4update,time){ + obj4update.ready = false; + new Ajax.Updater(obj4update.id, obj4update.url, { method: 'post', 'parameters': obj4update.params, 'evalScripts': true, - 'onSuccess': function(resp){ obj4update.lastupdate = time; }, //SDI(resp.responseText); + 'onSuccess': function(resp){ obj4update.lastupdate = time; obj4update.ready = true; }, //SDI(resp.responseText); 'onFailure': function(){ document.location = 'dashboard.php?'+Object.toQueryString(obj4update.params); } }); } |