diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-16 16:09:08 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-06-16 16:09:08 +0100 |
commit | 4ca1b2c8db777cd1e389a227072b1cd108e23d05 (patch) | |
tree | 20c3b89ae8dfbe839f1ab73334ff409e306a4fa5 /views/alerts.haml | |
parent | 0b553879d0606b3f24047302e8958f9610341f2b (diff) |
Updated web interface to use a Sinatra layout.
Diffstat (limited to 'views/alerts.haml')
-rw-r--r-- | views/alerts.haml | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/views/alerts.haml b/views/alerts.haml index 2d871cc..aedbc72 100644 --- a/views/alerts.haml +++ b/views/alerts.haml @@ -1,12 +1,31 @@ -!!! 5 -%html - = partial('head') - %body - =partial("navbar") - .container - - if @grouped_alerts.length > 0 - = partial('alerts_table') - - else - .notice - %p No alerts to display. +- if @grouped_alerts.length > 0 + %form#alerts{:method => :post, :action => '/alerts/acknowledge'} + = partial('alerts_table') + %h2 Actions + %p= partial('acknowledge_input') +- else + .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; + }); + + }); |