aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-01 15:35:05 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-01 15:35:05 +0100
commitb718175601c02b8a251931622e7b79f469645111 (patch)
tree672e361498f33e0e3287cca05939c754630a1e81 /views
parent5f57bc117ff110d21fe6c130816c208c35f0b987 (diff)
Updated interface to auto-update nicely.
Diffstat (limited to 'views')
-rw-r--r--views/_navbar.haml2
-rw-r--r--views/alerts.haml23
2 files changed, 4 insertions, 21 deletions
diff --git a/views/_navbar.haml b/views/_navbar.haml
index 5df4991..283572f 100644
--- a/views/_navbar.haml
+++ b/views/_navbar.haml
@@ -28,3 +28,5 @@
#{flash[klass]}
:javascript
$(document).ready(function () { $('div.flash').delay(1000).fadeOut(2000);});
+ - else
+ %div{:class => ["flash", klass], :style => "display: none"}
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)