abalone 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 565875b71d7b4f783f558c97f5e4f0b3695f7428
4
- data.tar.gz: cb3a9ed9725aee44626bb591602355a3e95a65fc
3
+ metadata.gz: 0cdad8f9c302f699c2ac1ec4ad0d7ac5bc4e16e1
4
+ data.tar.gz: d2c9862f6c4aa8337487c285a3b02fe73c0a19e0
5
5
  SHA512:
6
- metadata.gz: d31db1d05ed62bdfdfe4884c4e5e9e6e1b0bbf45ef837b3363af363d7cd9aea617ca0fd45b379d5afd9bbe4928d0452f8b2619d60e335c5cdfdb5dfe334455a7
7
- data.tar.gz: 1100692ff4a162c5daa2800bdd077cc6d481e9792235b0101e24bc8670d0fccd5957df785689d83b39956608477c0ee367fc49ffda32a17309887ca86c625992
6
+ metadata.gz: baa34215faa681b8e7eef176bb774f15578b51999a66c73c13a0ccdeb03a171c137aa09d5ecae27749bb34a6e713eae19b18e1dde4022cac8c566bb3a240cca2
7
+ data.tar.gz: 8e7ebbc4c01c6730713a6469425f1e94a5a832d9d6754981a2d6a58dc50683c345514f9d67ad02c0cfdaca69fb2a270792412afa4565ce283857c7931751332e
data/README.md CHANGED
@@ -28,6 +28,10 @@ Abalone defaults to loading configuration from `/etc/abalone/config.yaml`. You
28
28
  can pass the path to another config file at the command line. In that file, you
29
29
  can set several options:
30
30
 
31
+ * `:autoconnect`
32
+ * Set this to true if you'd like the session to start on page load and false
33
+ if you'd like the user to click a *Start Session* button instead. Defaults
34
+ to `true`.
31
35
  * `:port`
32
36
  * Which port to run the server on.
33
37
  * Default value: `9000`
@@ -6,9 +6,10 @@ require 'abalone'
6
6
  require 'yaml'
7
7
 
8
8
  defaults = {
9
- :port => 9000,
10
- :bind => '0.0.0.0',
11
- :logfile => $stderr,
9
+ :port => 9000,
10
+ :bind => '0.0.0.0',
11
+ :logfile => $stderr,
12
+ :autoconnect => true,
12
13
  }
13
14
  loglevel = Logger::WARN
14
15
  configfile = '/etc/abalone/config.yaml'
@@ -20,6 +20,7 @@ class Abalone < Sinatra::Base
20
20
  if !request.websocket?
21
21
  #redirect '/index.html'
22
22
  @requestUsername = (settings.respond_to?(:ssh) and ! settings.ssh.include?(:user)) rescue false
23
+ @autoconnect = settings.autoconnect
23
24
  erb :index
24
25
  else
25
26
  request.websocket do |ws|
@@ -5,10 +5,12 @@ var socket;
5
5
  function connect(userPrompt) {
6
6
  var protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://';
7
7
 
8
+ // hide the connect button
9
+ document.getElementById("overlay").style.display = "none";
10
+
8
11
  if(socket) {
9
12
  socket.onclose = null;
10
13
  socket.close();
11
- document.getElementById("overlay").style.display = "none";
12
14
  }
13
15
 
14
16
  if(userPrompt && location.pathname == '/') {
@@ -18,7 +18,7 @@
18
18
  height: 100%;
19
19
  width: 100%;
20
20
  background-color: rgba(0,0,0,0.75);
21
- display: none;
21
+ <% if @autoconnect %>display: none;<% end %>
22
22
  }
23
23
  #overlay input {
24
24
  display: block;
@@ -36,8 +36,8 @@
36
36
  </style>
37
37
  </head>
38
38
 
39
- <body onload="connect(<%= @requestUsername %>);">
40
- <div id="overlay"><input type="button" onclick="javascript:connect(<%= @requestUsername %>);" value="reconnect" /></div>
39
+ <body <% if @autoconnect %>onload="connect(<%= @requestUsername %>);"<% end %>>
40
+ <div id="overlay"><input type="button" onclick="javascript:connect(<%= @requestUsername %>);" value="Start Session" /></div>
41
41
  <div id="terminal"></div>
42
42
  </body>
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abalone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Ford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra