sensu-dashboard 0.9.8.beta.2 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
data/lib/sensu-dashboard/app.rb
CHANGED
@@ -2,7 +2,6 @@ require 'sensu/base'
|
|
2
2
|
require 'thin'
|
3
3
|
require 'sinatra/async'
|
4
4
|
require 'em-http-request'
|
5
|
-
require 'em-websocket'
|
6
5
|
require 'sass'
|
7
6
|
|
8
7
|
class Dashboard < Sinatra::Base
|
@@ -11,7 +10,6 @@ class Dashboard < Sinatra::Base
|
|
11
10
|
def self.run(options={})
|
12
11
|
EM::run do
|
13
12
|
self.setup(options)
|
14
|
-
self.websocket_server
|
15
13
|
|
16
14
|
Thin::Logging.silent = true
|
17
15
|
Thin::Server.start(self, $settings[:dashboard][:port])
|
@@ -44,20 +42,6 @@ class Dashboard < Sinatra::Base
|
|
44
42
|
end
|
45
43
|
end
|
46
44
|
|
47
|
-
def self.websocket_server
|
48
|
-
$websocket_connections = []
|
49
|
-
EM::WebSocket.start(:host => '0.0.0.0', :port => 9000) do |websocket|
|
50
|
-
websocket.onopen do
|
51
|
-
$logger.debug('client connected to websocket')
|
52
|
-
$websocket_connections.push(websocket)
|
53
|
-
end
|
54
|
-
websocket.onclose do
|
55
|
-
$logger.debug('client disconnected from websocket')
|
56
|
-
$websocket_connections.delete(websocket)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
45
|
def request_log(env)
|
62
46
|
$logger.info([env['REQUEST_METHOD'], env['REQUEST_PATH']].join(' '), {
|
63
47
|
:remote_address => env['REMOTE_ADDR'],
|
@@ -106,12 +90,7 @@ class Dashboard < Sinatra::Base
|
|
106
90
|
end
|
107
91
|
|
108
92
|
apost '/events.json' do
|
109
|
-
|
110
|
-
$websocket_connections.each do |websocket|
|
111
|
-
websocket.send '{"update":"true"}'
|
112
|
-
end
|
113
|
-
end
|
114
|
-
body '{"success":"triggered dashboard refresh"}'
|
93
|
+
body '{"error": "this feature has been removed"}'
|
115
94
|
end
|
116
95
|
|
117
96
|
aget '/autocomplete.json' do
|
@@ -73,11 +73,6 @@
|
|
73
73
|
<script type="text/javascript">
|
74
74
|
fetchEvents();
|
75
75
|
|
76
|
-
ws = new WebSocket("ws://" + location.hostname + ":9000");
|
77
|
-
ws.onmessage = function(evt) {
|
78
|
-
fetchEvents();
|
79
|
-
}
|
80
|
-
|
81
76
|
$("#disable_client_alerts").click(function() {
|
82
77
|
var client_id = $("#client_id_value").html();
|
83
78
|
var alert_img = $("#disable_client_alerts").children().first();
|
@@ -187,4 +182,4 @@ $('#filter_unknown_checks').change(function() {
|
|
187
182
|
filter_unknown_checks = !filter_unknown_checks;
|
188
183
|
fetchEvents();
|
189
184
|
});
|
190
|
-
</script>
|
185
|
+
</script>
|
@@ -53,9 +53,9 @@
|
|
53
53
|
<!-- all our JS is at the bottom of the page, except for Modernizr. -->
|
54
54
|
<script src="js/modernizr-1.7.min.js"></script>
|
55
55
|
|
56
|
-
<% if $settings['dashboard']['autorefresh'] %>
|
56
|
+
<% if $settings['dashboard']['autorefresh'] || $settings['dashboard']['auto_refresh'] %>
|
57
57
|
<!-- page autorefresh -->
|
58
|
-
<meta http-equiv="refresh" content="<%= $settings['dashboard']['autorefresh'] %>">
|
58
|
+
<meta http-equiv="refresh" content="<%= $settings['dashboard']['autorefresh'] || $settings['dashboard']['auto_refresh'] %>">
|
59
59
|
<% end %>
|
60
60
|
</head>
|
61
61
|
|
data/sensu-dashboard.gemspec
CHANGED
@@ -6,14 +6,13 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "sensu-dashboard"
|
7
7
|
s.version = Sensu::Dashboard::VERSION
|
8
8
|
s.authors = ["Justin Kolberg", "Sean Porter"]
|
9
|
-
s.email = ["justin.kolberg@sonian.net", "
|
9
|
+
s.email = ["justin.kolberg@sonian.net", "portertech@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/sonian/sensu-dashboard"
|
11
11
|
s.summary = %q{A web interface for sensu, a publish/subscribe server monitoring framework}
|
12
12
|
s.description = %q{Display current events and clients in sensu via a simple web interface}
|
13
13
|
|
14
|
-
s.add_dependency("sensu", "~> 0.9.6
|
14
|
+
s.add_dependency("sensu", "~> 0.9.6")
|
15
15
|
s.add_dependency("em-http-request", "1.0.1")
|
16
|
-
s.add_dependency("em-websocket", "0.3.6")
|
17
16
|
s.add_dependency("sass")
|
18
17
|
|
19
18
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-dashboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 43
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 8
|
10
|
-
|
11
|
-
- 2
|
12
|
-
version: 0.9.8.beta.2
|
10
|
+
version: 0.9.8
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Justin Kolberg
|
@@ -18,7 +16,7 @@ autorequire:
|
|
18
16
|
bindir: bin
|
19
17
|
cert_chain: []
|
20
18
|
|
21
|
-
date: 2012-07-
|
19
|
+
date: 2012-07-25 00:00:00 -07:00
|
22
20
|
default_executable:
|
23
21
|
dependencies:
|
24
22
|
- !ruby/object:Gem::Dependency
|
@@ -29,14 +27,12 @@ dependencies:
|
|
29
27
|
requirements:
|
30
28
|
- - ~>
|
31
29
|
- !ruby/object:Gem::Version
|
32
|
-
hash:
|
30
|
+
hash: 55
|
33
31
|
segments:
|
34
32
|
- 0
|
35
33
|
- 9
|
36
34
|
- 6
|
37
|
-
|
38
|
-
- 3
|
39
|
-
version: 0.9.6.beta.3
|
35
|
+
version: 0.9.6
|
40
36
|
type: :runtime
|
41
37
|
version_requirements: *id001
|
42
38
|
- !ruby/object:Gem::Dependency
|
@@ -55,26 +51,10 @@ dependencies:
|
|
55
51
|
version: 1.0.1
|
56
52
|
type: :runtime
|
57
53
|
version_requirements: *id002
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: em-websocket
|
60
|
-
prerelease: false
|
61
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
|
-
requirements:
|
64
|
-
- - "="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
hash: 31
|
67
|
-
segments:
|
68
|
-
- 0
|
69
|
-
- 3
|
70
|
-
- 6
|
71
|
-
version: 0.3.6
|
72
|
-
type: :runtime
|
73
|
-
version_requirements: *id003
|
74
54
|
- !ruby/object:Gem::Dependency
|
75
55
|
name: sass
|
76
56
|
prerelease: false
|
77
|
-
requirement: &
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
78
58
|
none: false
|
79
59
|
requirements:
|
80
60
|
- - ">="
|
@@ -84,11 +64,11 @@ dependencies:
|
|
84
64
|
- 0
|
85
65
|
version: "0"
|
86
66
|
type: :runtime
|
87
|
-
version_requirements: *
|
67
|
+
version_requirements: *id003
|
88
68
|
description: Display current events and clients in sensu via a simple web interface
|
89
69
|
email:
|
90
70
|
- justin.kolberg@sonian.net
|
91
|
-
-
|
71
|
+
- portertech@gmail.com
|
92
72
|
executables:
|
93
73
|
- sensu-dashboard
|
94
74
|
extensions: []
|
@@ -158,14 +138,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
139
|
none: false
|
160
140
|
requirements:
|
161
|
-
- - "
|
141
|
+
- - ">="
|
162
142
|
- !ruby/object:Gem::Version
|
163
|
-
hash:
|
143
|
+
hash: 3
|
164
144
|
segments:
|
165
|
-
-
|
166
|
-
|
167
|
-
- 1
|
168
|
-
version: 1.3.1
|
145
|
+
- 0
|
146
|
+
version: "0"
|
169
147
|
requirements: []
|
170
148
|
|
171
149
|
rubyforge_project:
|