From b718175601c02b8a251931622e7b79f469645111 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Mon, 1 Aug 2011 15:35:05 +0100 Subject: Updated interface to auto-update nicely. --- views/alerts.haml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'views/alerts.haml') diff --git a/views/alerts.haml b/views/alerts.haml index aedbc72..54bfff7 100644 --- a/views/alerts.haml +++ b/views/alerts.haml @@ -7,25 +7,6 @@ .notice#alerts_table %p No alerts to display. :javascript - $(document).ready( function() { - $.PeriodicalUpdater({ - url: '/ajax/alerts_table/#{@alert_type}/#{@group_by}', - minTimeout: 10000, - maxTimeout: 30000, - }, function(alerts_table, success, xhr, handle){ - $('#alerts_table').replaceWith(alerts_table); - }); - $.PeriodicalUpdater({ - url: '/ajax/alert_counts', - minTimeout: 10000, - maxTimeout: 30000, - }, function(alert_counts, success, xhr, handle){ - var counts = jQuery.parseJSON( alert_counts ); - $('#count_raised').html(counts[0]+counts[1]+counts[2]); - $('#count_ackd').html(counts[3]); - $('#count_cleared').html(counts[4]); - return false; - }); - - }); + // Do the magic updates.. + setInterval("updateAlertsTable('#{@alert_type}','#{@group_by}');", 30000) -- cgit v1.2.3