File tree Expand file tree Collapse file tree 4 files changed +32
-29
lines changed Expand file tree Collapse file tree 4 files changed +32
-29
lines changed Original file line number Diff line number Diff line change 34
34
}
35
35
36
36
# intro .content {
37
- width : 370 px ;
37
+ width : 395 px ;
38
38
font-size : 18px ;
39
39
line-height : 45px ;
40
40
text-align : center;
52
52
53
53
# intro .content-row input {
54
54
flex : 1 ;
55
- margin-left : 10px ;
56
- font-size : 14px ;
57
55
height : 32px ;
56
+ padding : 0 10px ;
57
+ margin-left : 10px ;
58
58
border : 1px solid # cacaca ;
59
59
border-radius : 2px ;
60
- padding : 0 10px ;
60
+ text-align : center;
61
+ font-size : 14px ;
61
62
}
62
63
</ style >
63
64
</ head >
@@ -81,6 +82,26 @@ <h2 class="title">
81
82
</ div >
82
83
</ div >
83
84
</ div >
85
+ < script >
86
+ const port = process . env . PORT || 8098
87
+ const localIp = require ( 'ip' ) . address ( ) ;
88
+ const $ = document . querySelector . bind ( document )
89
+
90
+ const $localhost = $ ( '#script-localhost' )
91
+ const $byIp = $ ( '#script-byip' )
92
+ const $intro = $ ( '#intro' )
93
+
94
+ $localhost . value = '<' + 'script src="http://localhost:' + port + '"><' + '/script>'
95
+ $byIp . value = '<' + 'script src="http://' + localIp + ':' + port + '"><' + '/script>'
96
+
97
+ function selectAll ( ) {
98
+ this . selectionStart = 0
99
+ this . selectionEnd = this . value . length
100
+ }
101
+
102
+ $localhost . onclick = selectAll
103
+ $byIp . onclick = selectAll
104
+ </ script >
84
105
< script src ="build/devtools.js "> </ script >
85
106
</ body >
86
107
</ html >
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
1
2
const electron = require ( 'electron' )
2
3
const spawn = require ( 'cross-spawn' )
4
+ const argv = process . argv . slice ( 2 )
3
5
4
6
const result = spawn . sync (
5
7
electron ,
6
- [
7
- require . resolve ( './app' )
8
- ] ,
8
+ [ require . resolve ( './app' ) ] . concat ( argv ) ,
9
9
{ stdio : 'ignore' }
10
10
)
11
11
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ const http = require('http').Server(app)
3
3
const io = require ( 'socket.io' ) ( http )
4
4
const path = require ( 'path' )
5
5
6
+ const port = process . env . PORT || 8098
7
+
6
8
app . get ( '/' , function ( req , res ) {
7
9
res . sendFile ( path . join ( __dirname , '/build/backend.js' ) )
8
10
} )
@@ -17,6 +19,6 @@ io.on('connection', function (socket) {
17
19
} )
18
20
} )
19
21
20
- http . listen ( 8098 , ( ) => {
21
- console . log ( 'listening on *:8098' )
22
+ http . listen ( port , ( ) => {
23
+ console . log ( 'listening on *:' + port )
22
24
} )
Original file line number Diff line number Diff line change 1
1
import io from 'socket.io-client'
2
- import ip from 'ip'
3
2
import { initDevTools } from 'src/devtools'
4
3
import Bridge from 'src/bridge'
5
4
6
5
const port = process . env . PORT || 8098
7
6
const socket = io ( 'http://localhost:' + port )
8
- const localIp = ip . address ( )
9
- const $ = document . querySelector . bind ( document )
10
-
11
- const $localhost = $ ( '#script-localhost' )
12
- const $byIp = $ ( '#script-byip' )
13
- const $intro = $ ( '#intro' )
14
-
15
- $localhost . value = '<' + 'script src="http://localhost:' + port + '"><' + '/script>'
16
- $byIp . value = '<' + 'script src="http://' + localIp + ':' + port + '"><' + '/script>'
17
-
18
- function selectAll ( ) {
19
- this . selectionStart = 0
20
- this . selectionEnd = this . value . length
21
- }
22
-
23
- $localhost . onclick = selectAll
24
- $byIp . onclick = selectAll
25
7
26
8
let reload = null
27
9
@@ -31,8 +13,6 @@ socket.on('vue-devtools-init', () => {
31
13
32
14
initDevTools ( {
33
15
connect ( callback ) {
34
- $intro . classList . add ( 'hidden' )
35
-
36
16
const wall = {
37
17
listen ( fn ) {
38
18
socket . on ( 'vue-message' , data => fn ( data ) )
You can’t perform that action at this time.
0 commit comments