-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
Copy pathapp.html
131 lines (118 loc) · 2.93 KB
/
app.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, max-age=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="expires" content="Fri, 18 Jue 2023 17:00:00 GMT" />
<title>Vue Developer Tools</title>
<!-- get env port and local ip -->
<script src="/local_ip"></script>
<style>
#app,
#intro {
display: flex;
flex-direction: column;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: 0;
padding: 0;
}
#intro {
z-index: 100000;
justify-content: center;
align-items: center;
background-color: #fff;
text-align: center;
font-family: Roboto, sans-serif;
color: #484848;
}
#intro.hidden {
display: none;
}
#intro .logo {
width: 120px;
}
#intro .title {
margin: 30px 0;
font-size: 26px;
}
#intro .content {
width: 500px;
font-size: 18px;
line-height: 45px;
text-align: center;
}
#intro .content-row {
display: flex;
align-items: center;
}
#intro .content-row label {
flex-basis: 35px;
text-align: right;
}
#intro .content-row input {
flex: 1;
height: 32px;
padding: 0 10px;
margin-left: 10px;
border: 1px solid #cacaca;
border-radius: 2px;
font-size: 14px;
}
#intro textarea {
flex: 1;
padding: 0 10px;
margin-left: 10px;
border: 1px solid #cacaca;
border-radius: 2px;
font-size: 14px;
width: 100%;
}
</style>
</head>
<body>
<div id="intro">
<img src="icons/128.png" alt="" class="logo">
<h2 class="title">
Waiting for connection...
</h2>
<div class="content">
<div class="content-row">
<label for="script-localhost">Add</label>
<input type="text" id="script-localhost">
</div>
<div class="content-row">
<label for="script-byip">Or</label>
<textarea id="script-byip" rows="5" ></textarea>
</div>
to the top of the page you want to debug.
</div>
</div>
<div id="app">
</div>
<script>
const port = process.env.PORT
const localIp = process.env.HOST
const $ = document.querySelector.bind(document)
const $localhost = $('#script-localhost')
const $byIp = $('#script-byip')
$localhost.value = '<' + 'script src="http://localhost:' + port + '"><' + '/script>'
$byIp.innerHTML = `<script>
window.__VUE_DEVTOOLS_HOST__ = 'http://${localIp}'
window.__VUE_DEVTOOLS_PORT__ = ${port}
</script>
<script src="http://${localIp}:${port}" ></script>`
function selectAll () {
this.selectionStart = 0
this.selectionEnd = this.value.length
}
$localhost.onclick = selectAll
$byIp.onclick = selectAll
</script>
<script src="build/devtools.js"></script>
</body>
</html>