From cdd1b094b27960595a8750247c5b2f2576cd5872 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Fri, 19 Aug 2011 11:58:25 +0100 Subject: rejigged JS reloading of alerts table. --- static/javascript/mauve_utils.js | 9 +++++++++ views/alerts.haml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1