Skip to content
Browse files

[fix] removed websocket from dashboard, will be back in v2

  • Loading branch information...
1 parent a7feed0 commit 371859d9b6918def0b4e09467fd15d913157a4e0 @portertech portertech committed
View
23 lib/sensu-dashboard/app.rb
@@ -2,7 +2,6 @@
require 'thin'
require 'sinatra/async'
require 'em-http-request'
-require 'em-websocket'
require 'sass'
class Dashboard < Sinatra::Base
@@ -11,7 +10,6 @@ class Dashboard < Sinatra::Base
def self.run(options={})
EM::run do
self.setup(options)
- self.websocket_server
Thin::Logging.silent = true
Thin::Server.start(self, $settings[:dashboard][:port])
@@ -44,20 +42,6 @@ def self.setup(options={})
end
end
- def self.websocket_server
- $websocket_connections = []
- EM::WebSocket.start(:host => '0.0.0.0', :port => 9000) do |websocket|
- websocket.onopen do
- $logger.debug('client connected to websocket')
- $websocket_connections.push(websocket)
- end
- websocket.onclose do
- $logger.debug('client disconnected from websocket')
- $websocket_connections.delete(websocket)
- end
- end
- end
-
def request_log(env)
$logger.info([env['REQUEST_METHOD'], env['REQUEST_PATH']].join(' '), {
:remote_address => env['REMOTE_ADDR'],
@@ -106,12 +90,7 @@ def request_log(env)
end
apost '/events.json' do
- unless $websocket_connections.empty?
- $websocket_connections.each do |websocket|
- websocket.send '{"update":"true"}'
- end
- end
- body '{"success":"triggered dashboard refresh"}'
+ body '{"error": "this feature has been removed"}'
end
aget '/autocomplete.json' do
View
7 lib/sensu-dashboard/views/event_templates.erb
@@ -73,11 +73,6 @@
<script type="text/javascript">
fetchEvents();
-ws = new WebSocket("ws://" + location.hostname + ":9000");
-ws.onmessage = function(evt) {
- fetchEvents();
-}
-
$("#disable_client_alerts").click(function() {
var client_id = $("#client_id_value").html();
var alert_img = $("#disable_client_alerts").children().first();
@@ -187,4 +182,4 @@ $('#filter_unknown_checks').change(function() {
filter_unknown_checks = !filter_unknown_checks;
fetchEvents();
});
-</script>
+</script>
View
4 lib/sensu-dashboard/views/layout.erb
@@ -53,9 +53,9 @@
<!-- all our JS is at the bottom of the page, except for Modernizr. -->
<script src="js/modernizr-1.7.min.js"></script>
- <% if $settings['dashboard']['autorefresh'] %>
+ <% if $settings['dashboard']['autorefresh'] || $settings['dashboard']['auto_refresh'] %>
<!-- page autorefresh -->
- <meta http-equiv="refresh" content="<%= $settings['dashboard']['autorefresh'] %>">
+ <meta http-equiv="refresh" content="<%= $settings['dashboard']['autorefresh'] || $settings['dashboard']['auto_refresh'] %>">
<% end %>
</head>
View
5 sensu-dashboard.gemspec
@@ -6,14 +6,13 @@ Gem::Specification.new do |s|
s.name = "sensu-dashboard"
s.version = Sensu::Dashboard::VERSION
s.authors = ["Justin Kolberg", "Sean Porter"]
- s.email = ["justin.kolberg@sonian.net", "sean.porter@sonian.net"]
+ s.email = ["justin.kolberg@sonian.net", "portertech@gmail.com"]
s.homepage = "https://github.com/sonian/sensu-dashboard"
s.summary = %q{A web interface for sensu, a publish/subscribe server monitoring framework}
s.description = %q{Display current events and clients in sensu via a simple web interface}
- s.add_dependency("sensu", "~> 0.9.6.beta.3")
+ s.add_dependency("sensu", "~> 0.9.6")
s.add_dependency("em-http-request", "1.0.1")
- s.add_dependency("em-websocket", "0.3.6")
s.add_dependency("sass")
s.files = `git ls-files`.split("\n")

0 comments on commit 371859d

Please sign in to comment.
Something went wrong with that request. Please try again.