diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-09-13 07:57:09 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-09-13 07:57:09 +0100 |
commit | dea8a85ceee0016b0dc06d19f926c407a5ab87bd (patch) | |
tree | 4a9b10160704d76b56ce406a7bdcac952bf255b6 /lib/mauve/web_interface.rb | |
parent | 55464fe1e748ebfb54fd514a109ee0ac615a222c (diff) |
Version bumb
Diffstat (limited to 'lib/mauve/web_interface.rb')
-rw-r--r-- | lib/mauve/web_interface.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/mauve/web_interface.rb b/lib/mauve/web_interface.rb index 928340c..707014a 100644 --- a/lib/mauve/web_interface.rb +++ b/lib/mauve/web_interface.rb @@ -507,7 +507,31 @@ EOF haml :events_list end + + get '/search' do + @alerts = [] + haml :search + end + get '/search/results' do + query = {} + allowed = %w(source subject alert_id summary) + + params.each do |k,v| + next if v.to_s.empty? + query[k.to_sym.send("like")] = v.to_s if allowed.include?(k) + end + + @alerts = Alert.all(query) + + haml :search + end + + post '/suppress' do + haml :suppress + end + + ######################################################################## helpers do |