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 3434 }
3535
3636 # intro .content {
37- width : 370 px ;
37+ width : 395 px ;
3838 font-size : 18px ;
3939 line-height : 45px ;
4040 text-align : center;
5252
5353 # intro .content-row input {
5454 flex : 1 ;
55- margin-left : 10px ;
56- font-size : 14px ;
5755 height : 32px ;
56+ padding : 0 10px ;
57+ margin-left : 10px ;
5858 border : 1px solid # cacaca ;
5959 border-radius : 2px ;
60- padding : 0 10px ;
60+ text-align : center;
61+ font-size : 14px ;
6162 }
6263 </ style >
6364</ head >
@@ -81,6 +82,26 @@ <h2 class="title">
8182 </ div >
8283 </ div >
8384 </ 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 >
84105 < script src ="build/devtools.js "> </ script >
85106</ body >
86107</ html >
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
12const electron = require ( 'electron' )
23const spawn = require ( 'cross-spawn' )
4+ const argv = process . argv . slice ( 2 )
35
46const result = spawn . sync (
57 electron ,
6- [
7- require . resolve ( './app' )
8- ] ,
8+ [ require . resolve ( './app' ) ] . concat ( argv ) ,
99 { stdio : 'ignore' }
1010)
1111
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ const http = require('http').Server(app)
33const io = require ( 'socket.io' ) ( http )
44const path = require ( 'path' )
55
6+ const port = process . env . PORT || 8098
7+
68app . get ( '/' , function ( req , res ) {
79 res . sendFile ( path . join ( __dirname , '/build/backend.js' ) )
810} )
@@ -17,6 +19,6 @@ io.on('connection', function (socket) {
1719 } )
1820} )
1921
20- http . listen ( 8098 , ( ) => {
21- console . log ( 'listening on *:8098' )
22+ http . listen ( port , ( ) => {
23+ console . log ( 'listening on *:' + port )
2224} )
Original file line number Diff line number Diff line change 11import io from 'socket.io-client'
2- import ip from 'ip'
32import { initDevTools } from 'src/devtools'
43import Bridge from 'src/bridge'
54
65const port = process . env . PORT || 8098
76const 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
257
268let reload = null
279
@@ -31,8 +13,6 @@ socket.on('vue-devtools-init', () => {
3113
3214 initDevTools ( {
3315 connect ( callback ) {
34- $intro . classList . add ( 'hidden' )
35-
3616 const wall = {
3717 listen ( fn ) {
3818 socket . on ( 'vue-message' , data => fn ( data ) )
You can’t perform that action at this time.
0 commit comments