diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-19 11:58:25 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-19 11:58:25 +0100 |
commit | cdd1b094b27960595a8750247c5b2f2576cd5872 (patch) | |
tree | 9c4661b8008593b8df9541a984302f46c2c11820 | |
parent | 5fac7af657afccb5ef2dc887b4312e0a9b8f4969 (diff) |
rejigged JS reloading of alerts table.
-rw-r--r-- | static/javascript/mauve_utils.js | 9 | ||||
-rw-r--r-- | views/alerts.haml | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/static/javascript/mauve_utils.js b/static/javascript/mauve_utils.js index 38af0cc..e467b5d 100644 --- a/static/javascript/mauve_utils.js +++ b/static/javascript/mauve_utils.js @@ -149,6 +149,10 @@ function updateAlertsTable(alert_type, group_by) { $('#alerts_table').replaceWith(data); clearError("updateAlertsTable"); updateAlertCounts(); + // + // Schedule next update. + // + setTimeout("updateAlertsTable('"+alert_type+"','"+group_by+"');", 30000); } }, error: function( a,b,c ) { @@ -157,9 +161,14 @@ function updateAlertsTable(alert_type, group_by) { } else { showError("Got "+a.status+" "+a.statusText+" when updating alerts table.", "updateAlertsTable"); } + // + // Schedule next update. + // + setTimeout("updateAlertsTable('"+alert_type+"','"+group_by+"');", 30000); }, }); + return false; } diff --git a/views/alerts.haml b/views/alerts.haml index 3018d6c..8968249 100644 --- a/views/alerts.haml +++ b/views/alerts.haml @@ -8,5 +8,5 @@ %p No alerts to display. :javascript // Do the magic updates.. - setInterval("updateAlertsTable('#{@alert_type}','#{@group_by}');", 120000) + setTimeout("updateAlertsTable('#{@alert_type}','#{@group_by}');", 30000) |