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 | |
parent | 55464fe1e748ebfb54fd514a109ee0ac615a222c (diff) |
Version bumb
Diffstat (limited to 'lib/mauve')
-rw-r--r-- | lib/mauve/alert.rb | 3 | ||||
-rw-r--r-- | lib/mauve/history.rb | 5 | ||||
-rw-r--r-- | lib/mauve/version.rb | 2 | ||||
-rw-r--r-- | lib/mauve/web_interface.rb | 24 |
4 files changed, 30 insertions, 4 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb index ecea4e6..fa2ce65 100644 --- a/lib/mauve/alert.rb +++ b/lib/mauve/alert.rb @@ -223,7 +223,8 @@ module Mauve h = History.new(:alerts => [self], :type => "update") if self.update_type == "acknowledged" - h.event = "ACKNOWLEDGED by #{self.acknowledged_by} until #{self.will_unacknowledge_at}" + h.event = "ACKNOWLEDGEDuntil #{self.will_unacknowledge_at}" + h.user = self.acknowledged_by elsif is_a_change h.event = "CHANGED: " diff --git a/lib/mauve/history.rb b/lib/mauve/history.rb index 5a0caff..76025a0 100644 --- a/lib/mauve/history.rb +++ b/lib/mauve/history.rb @@ -24,8 +24,8 @@ module Mauve # # This is horrid. FIXME! # - history_schema = '"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "type" VARCHAR(50) DEFAULT \'unknown\' NOT NULL, "event" TEXT DEFAULT \'Nothing set\' NOT NULL, "created_at" TIMESTAMP NOT NULL' - history_cols = 'id, type, event, created_at' + history_schema = '"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "type" VARCHAR(50) DEFAULT \'unknown\' NOT NULL, "event" TEXT DEFAULT \'Nothing set\' NOT NULL, "user" VARCHAR(50) DEFAULT NULL, "created_at" TIMESTAMP NOT NULL' + history_cols = 'id, type, event, user, created_at' ## # Now adjust the Histories table to remove its alert_id col # @@ -63,6 +63,7 @@ module Mauve property :id, Serial property :type, String, :required => true, :default => "unknown", :lazy => false property :event, Text, :required => true, :default => "Nothing set", :lazy => false + property :user, String property :created_at, Time, :required => true has n, :alerts, :through => :alerthistory diff --git a/lib/mauve/version.rb b/lib/mauve/version.rb index e6b6eb4..56ac522 100644 --- a/lib/mauve/version.rb +++ b/lib/mauve/version.rb @@ -1,5 +1,5 @@ module Mauve - VERSION="3.5.7" + VERSION="3.5.8" end 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 |