2022-05-26 15:18:53 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
|
|
|
|
|
<style>
|
|
|
|
|
html {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
body {
|
|
|
|
|
margin: 0;
|
|
|
|
|
color: #000;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#image {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 32px;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
bottom: 32px;
|
|
|
|
|
background-position: center center;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: contain;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
2023-06-08 20:47:56 +08:00
|
|
|
<div id="bg" style="background-color: #1e1f22; height: 100%;position: fixed;width: 100%;box-sizing: border-box;"></div>
|
|
|
|
|
<div id="image" style="background-image: url(images/boot.svg)"></div>
|
|
|
|
|
<div style="position: fixed;bottom: 34px;width: 100%;height: 1px;background-color: #3b3e43;">
|
2022-05-26 15:18:53 +08:00
|
|
|
<div id="progress"
|
2023-06-08 20:47:56 +08:00
|
|
|
style="position: absolute;height: 1px;background-color: #d23f31;transition: width 50ms cubic-bezier(0, 0, 0.2, 1);bottom: 0;"></div>
|
2022-05-26 15:18:53 +08:00
|
|
|
<div style="position: absolute;bottom: -26px;left: 16px;display: flex;align-items: center;right: 16px;">
|
2023-06-08 20:47:56 +08:00
|
|
|
<span id="details" style="color: #9aa0a6;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;"></span>
|
2022-05-26 15:18:53 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
const sleep = (ms) => {
|
|
|
|
|
return new Promise(resolve => setTimeout(resolve, ms))
|
|
|
|
|
}
|
|
|
|
|
const redirect = () => {
|
2022-10-29 21:47:10 +08:00
|
|
|
const uri = 'http://127.0.0.1:' + location.port
|
2022-05-26 15:18:53 +08:00
|
|
|
if (navigator.userAgent.match(/Android/i))
|
|
|
|
|
document.location = uri
|
|
|
|
|
else
|
|
|
|
|
window.location.replace(uri)
|
|
|
|
|
}
|
|
|
|
|
(async () => {
|
|
|
|
|
document.getElementById('details').textContent = 'Booting...'
|
|
|
|
|
let progressing = false
|
|
|
|
|
while (!progressing) {
|
|
|
|
|
try {
|
2022-10-29 21:47:10 +08:00
|
|
|
const progressResult = await fetch('http://127.0.0.1:' + location.port + '/api/system/bootProgress')
|
2022-05-26 15:18:53 +08:00
|
|
|
const progressData = await progressResult.json()
|
|
|
|
|
document.getElementById('progress').style.width = progressData.data.progress + '%'
|
|
|
|
|
document.getElementById('details').textContent = progressData.data.details
|
|
|
|
|
if (progressData.data.progress >= 100) {
|
|
|
|
|
progressing = true
|
|
|
|
|
if (navigator.userAgent.indexOf('Electron') === -1) {
|
|
|
|
|
redirect()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
await sleep(100)
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
await sleep(100)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})()
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|