sensu-dashboard 0.5.7 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -200,7 +200,6 @@ EventMachine.run do
200
200
 
201
201
  apost '/stash/*.json' do |path|
202
202
  begin
203
- puts request.body.read
204
203
  request_options = {
205
204
  :body => {'timestamp' => Time.now.to_i}.to_json,
206
205
  :head => {
@@ -245,6 +244,32 @@ EventMachine.run do
245
244
  end
246
245
  end
247
246
 
247
+ apost '/event/resolve.json' do
248
+ begin
249
+ request_options = {
250
+ :body => request.body.read,
251
+ :head => {
252
+ 'content-type' => 'application/json'
253
+ }
254
+ }
255
+ http = EventMachine::HttpRequest.new("#{api_server}/event/resolve").post request_options
256
+ rescue => e
257
+ puts e
258
+ status 404
259
+ body '{"error":"could not resolve an event with the sensu api"}'
260
+ end
261
+
262
+ http.errback do
263
+ status 404
264
+ body '{"error":"could not resolve an event with the sensu api"}'
265
+ end
266
+
267
+ http.callback do
268
+ status http.response_header.status
269
+ body http.response
270
+ end
271
+ end
272
+
248
273
  websocket_connections = Array.new
249
274
  EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 9000) do |websocket|
250
275
  websocket.onopen do
@@ -1,5 +1,5 @@
1
1
  module Sensu
2
2
  module Dashboard
3
- VERSION = "0.5.7"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -147,4 +147,22 @@ $("#disable_client_check_alerts").click(function() {
147
147
  });
148
148
  }
149
149
  });
150
+ $("#resolve_event").click(function() {
151
+ var client = $("#client_id_value").html();
152
+ var check = $("#check_name_value").html();
153
+ $.ajax({
154
+ type: 'POST',
155
+ contentType: 'application/json',
156
+ url: '/event/resolve.json',
157
+ data: JSON.stringify({"client":client, "check":check}),
158
+ success: function(data, textStatus, xhr) {
159
+ $("#lean_overlay").fadeOut(200);
160
+ $("#event_details_modal").css({'display':'none'});
161
+ fetchEvents();
162
+ },
163
+ error: function(xhr, textStatus, errorThrown) {
164
+ alert('Failed to resolve event');
165
+ }
166
+ });
167
+ });
150
168
  </script>
@@ -30,6 +30,9 @@
30
30
  <div id="disable_client_check_alerts" class="action_btn" style="margin-right: 7px;">
31
31
  <img src="/img/loading_circle.gif" style="vertical-align: middle; padding-right: 7px;"/><strong>Check</strong>
32
32
  </div>
33
+ <div id="resolve_event" class="action_btn" style="margin-right: 7px;">
34
+ <img src="/img/cross.png" style="vertical-align: middle; padding-right: 7px;"/><strong>Resolve</strong>
35
+ </div>
33
36
  </div>
34
37
  <div style="clear: both;"></div>
35
38
  </div>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-dashboard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 7
10
- version: 0.5.7
8
+ - 6
9
+ - 0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Kolberg
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-14 00:00:00 -08:00
19
+ date: 2011-11-15 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -97,6 +97,7 @@ files:
97
97
  - lib/sensu-dashboard/app.rb
98
98
  - lib/sensu-dashboard/public/css/autoSuggest.css
99
99
  - lib/sensu-dashboard/public/css/style.css
100
+ - lib/sensu-dashboard/public/img/cross.png
100
101
  - lib/sensu-dashboard/public/img/footer_bg.png
101
102
  - lib/sensu-dashboard/public/img/header_bg.png
102
103
  - lib/sensu-dashboard/public/img/loading_circle.gif