summaryrefslogtreecommitdiffstats
path: root/frontends/php/js
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-11 11:48:58 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-11 11:48:58 +0000
commita5c435223703507964d991c38aed30f5b576f38c (patch)
tree12451fbfaa04b8f4149875f81cf5a99567d412e7 /frontends/php/js
parent419b228afeba243106a8757543cde23bbdd03189 (diff)
downloadzabbix-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
Diffstat (limited to 'frontends/php/js')
-rw-r--r--frontends/php/js/dashboard.js9
1 files changed, 6 insertions, 3 deletions
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); }
});
}