lib/riemann/dash/public/dash.js in riemann-dash-0.2.5 vs lib/riemann/dash/public/dash.js in riemann-dash-0.2.6

- old
+ new

@@ -132,12 +132,15 @@ // Reload the dash. var reload = function() { persistence.load(function(config) { // Server var server = config.server || '127.0.0.1:5556'; + var server_type = config.server_type || "ws"; subs.server(server); + subs.server_type(server_type); toolbar.server(server); + toolbar.server_type(server_type); // Workspaces if (config.workspaces) { workspaces = config.workspaces; workspaces.forEach(function(w) { @@ -171,10 +174,11 @@ stash(); persistence.save( { server: toolbar.server(), + server_type: toolbar.server_type(), workspaces: workspaces }, function() { toastr.info("Configuration saved.") }, function(xhr, msg) { console.log("Error saving config", msg); @@ -229,9 +233,16 @@ // Handle server changes from toolbar. toolbar.onServerChange(function(server) { console.log("Server changed to", server); // Notify subscription system subs.server(server); + // Reload view. + switchWorkspace(currentWorkspace()); + }); + + toolbar.onServerTypeChange(function (server_type) { + console.log("Server type changed to", server_type); + subs.server_type(server_type); // Reload view. switchWorkspace(currentWorkspace()); }); // Handle toolbar workspace switching.