-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
334 lines (292 loc) · 9.95 KB
/
index.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DD@Electron</title>
<link rel="stylesheet" href="./bulma/bulma.css">
<script src="./vue/vue.js"></script>
<style>
.fullheight {
height: calc(100vh + 24px);
width: 3000px;
position: absolute;
top: 0;
overflow: hidden;
font-family: monospace;
font-size: 12px;
color: grey;
opacity: 0.233;
padding-top: 2px;
padding-left: 2px;
}
.cursorHelp {
cursor: help;
}
.history {
height: calc(100vh - 48px - 48px - 1.5rem - 36px);
overflow: auto;
}
.danmakuBox {
padding-top: 0;
height: calc(100vh - 200px);
min-height: 300px;
overflow: auto;
white-space: nowrap;
padding-bottom: 0;
}
.danmakuContainer {
position: relative;
overflow: visible;
}
.danmakuDetectors {
position: absolute;
}
.danmaku {
position: absolute;
}
.title {
-webkit-app-region: drag;
-webkit-user-select: none;
cursor: grab;
}
.danmakuTime {
color: rgba(0, 0, 0, 0.3);
display: inline-block;
min-width: 7em;
text-align: center;
}
</style>
</head>
<body>
<div id="main" style="display: none;">
<div class="fullheight">
<p v-for="log in logs">
{{log}}
</p>
</div>
<section class="hero is-fullheight">
<div class="hero-body">
<div class="container">
<h1 class="title">
DD<i>@</i>Electron
</h1>
<h2 class="subtitle">DD@Home</h2>
<br>
<nav class="level has-text-centered">
<div class="level-item">
<div>
<p class="heading">已处理请求</p>
<p class="title">{{state.completeNum}}</p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">已连接直播间</p>
<p class="title">{{state.livedRooms}}</p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">运行时间</p>
<p class="title">{{uptime}}</p>
</div>
</div>
</nav>
</div>
</div>
</section>
<hr>
<section class="section">
<div class="container">
<h1 class="title">弹幕</h1>
<h2 class="subtitle">Danmaku</h2>
</div>
<br>
<form @submit="send">
<div class="field has-addons">
<div class="control is-expanded">
<input class="input" type="text" placeholder="弹幕" v-model="danmaku">
</div>
<div class="control">
<button class="button is-info" type="submit" :disabled="danmakuWait || longDanmaku || emptyDanmaku">
<span v-if="longDanmaku">太长啦: {{danmaku.length}}/256</span>
<span v-else-if="emptyDanmaku">内容为空</span>
<span v-else>发送</span>
</button>
</div>
</div>
</form>
</section>
<section class="section danmakuBox" id="danmakuBox">
<div class="danmakuContainer" :style="{ height: `${danmakuHeight}px` }">
<p class="danmaku" v-for="({name,text,absoluteTime,relativeTime,bottom,i}) in danmakus" :key="`danmaku_${i}`" :style="{ bottom:`${bottom}px`, display: bottom === -100 ? 'none' : '' }">
<span class="danmakuTime" v-bind:title="absoluteTime">({{relativeTime}})</span><b>{{name}}</b>: {{text}}
</p>
<div class="danmakuDetectors" v-for="({height,bottom,i}) in danmakuDetectors" :style="{ height:`${height}px`, bottom:`${bottom}px` }" :id="`danmakuDetectors_${i}`" :key="`danmakuDetectors_${i}`" :n="i">
</div>
</div>
</section>
<hr>
<section class="section">
<div class="container">
<h1 class="title">状态</h1>
<h2 class="subtitle">Service</h2>
</div>
<br>
<nav class="level has-text-centered">
<div class="level-item">
<div>
<p class="heading">目前在线</p>
<p class="title">{{state.online}}</p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">任务</p>
<p class="title">{{state.pending}}</p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">监听中直播间</p>
<p class="title">{{state.roomLength}}</p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading cursorHelp" title="每秒处理能力">DD力</p>
<p class="title">{{powerSec}}</p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading cursorHelp" title="平均每个直播间的连接">平均直播连接</p>
<p class="title">{{averageActive}}</p>
</div>
</div>
</nav>
<div class="table-container">
<table class="table is-striped is-hoverable is-fullwidth">
<tbody>
<tr v-for="home in homes" :key="home.id">
<template v-if="home.id === state.id">
<td><b>{{home.name}}@{{home.runtime}}</b></td>
<td><b>{{home.resolves}}/{{home.sum}}</b></td>
<td><b>{{home.platform}}</b></td>
<td><b>{{home.version}}</b></td>
</template>
<template v-else>
<td>{{home.name}}@{{home.runtime}}</td>
<td>{{home.resolves}}/{{home.sum}}</td>
<td>{{home.platform}}</td>
<td>{{home.version}}</td>
</template>
</tr>
</tbody>
</table>
</div>
</section>
<hr>
<section class="section">
<div class="container">
<h1 class="title">设置</h1>
<h2 class="subtitle">(重载生效)</h2>
</div>
<br>
<div class="field">
<label class="label">间隔</label>
<div class="control">
<input class="input" type="number" v-model="interval" :class="{'is-danger': intervalWarning}" placeholder="毫秒">
</div>
<p class="help is-danger" v-if="intervalWarning">
间隔太小会影响使用bilibili
</p>
<p class="help">当前: {{state.INTERVAL}} ms</p>
</div>
<br>
<div class="field">
<label class="label">直播间连接数</label>
<div class="control">
<input class="input" type="number" v-model="wsLimit" placeholder="同时转发多少直播间">
</div>
<p class="help">当前: {{state.wsLimit}}</p>
</div>
<br>
<div class="field">
<label class="label">昵称 (可选)</label>
<div class="control">
<input class="input" type="text" v-model="nickname" placeholder="会显示在统计中哦">
</div>
<p class="help">当前: {{state.nickname || '无'}}</p>
</div>
<br>
<div class="field">
<label class="label">UUID</label>
</div>
<div class="field has-addons">
<div class="control is-expanded">
<input class="input" type="text" v-model="uuid" placeholder="用于记录状态">
</div>
<div class="control">
<a class="button" @click="randomUUID">
随机
</a>
</div>
</div>
<div class="field">
<p class="help">当前: {{state.uuid}}</p>
</div>
<br>
<div class="field">
<p class="control">
<button class="button is-inverted is-outlined is-rounded" @click="close">
重载
</button>
</p>
</div>
<br>
<p>当前url: <code>{{state.url}}</code></p>
</section>
<hr>
<section class="section">
<div class="container">
<h1 class="title">关于</h1>
<h2 class="subtitle">
DD@Electron v{{version}}
</h2>
<p>已处理请求(总计): {{state.completeNum}}</p>
<p>已处理请求(本次启动): {{state.completeNumNow}}</p>
<p>平均间隔: {{state.delay}}ms</p>
<p>运行时间: {{uptime}}</p>
<br>
<p>Github: <a href="https://github.com/dd-center/DDatElectron" target="_blank" rel="noopener noreferrer">https://github.com/dd-center/DDatElectron</a></p>
<p>核心/终端命令行CLI版本 DDatHome-nodejs: <a href="https://github.com/dd-center/DDatHome-nodejs" target="_blank" rel="noopener noreferrer">https://github.com/dd-center/DDatHome-nodejs</a></p>
<p>命令行CLI版本可执行文件: <a href="https://github.com/dd-center/DDatHome-nodejs/releases/latest" target="_blank" rel="noopener noreferrer">https://github.com/dd-center/DDatHome-nodejs/releases/latest</a></p>
<br>
<p>版本: {{version}} <span v-if="state.update === false">(最新版本)</span></p>
<p v-if="state.update">(新版本 {{state.update}}) <a v-if="state.updateDownloaded" @click="restart" class="button is-small is-rounded is-info">重启更新</a></p>
<template v-if="state.updateProgress && !state.updateDownloaded">
<p>{{Math.round(state.updateProgress.total/1024/1024*100)/100}}MB 下载中...</p>
<progress class="progress is-small" :value="state.updateProgress.percent" max="100"></progress>
</template>
</div>
</section>
<hr>
<section class="section">
<div class="container">
<h1 class="title" title="可能会忘记写">更新日志</h1>
<div class="history">
<div v-for="[version, messages] in updates" :key="`update_${version}`">
<b>{{version}}</b>
<p v-for="(message, i) in messages" :key="`updateMessage_${version}_${i}`">
{{message}}
</p>
</div>
</div>
</div>
</section>
</div>
</body>
<script src="./main.js"></script>
</html>