Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
173 lines (156 loc) · 4.71 KB
/
Copy pathindex.html
File metadata and controls
173 lines (156 loc) · 4.71 KB
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
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cockpit Tools</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap"
media="print"
onload="this.media='all'"
/>
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
background: #0b1220;
color: #e2e8f0;
}
@media (prefers-color-scheme: light) {
html,
body {
background: #f4f7fb;
color: #0f172a;
}
}
#app-boot-splash {
position: fixed;
inset: 0;
z-index: 2147483000;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 18px;
background: inherit;
color: inherit;
font-family: "Segoe UI", system-ui, sans-serif;
transition: opacity 0.22s ease;
}
#app-boot-splash.is-hidden {
opacity: 0;
pointer-events: none;
}
#app-boot-failure {
max-width: min(340px, 85vw);
text-align: center;
}
#app-boot-failure button {
padding: 8px 16px;
border: 1px solid currentColor;
border-radius: 8px;
background: transparent;
color: inherit;
font: inherit;
cursor: pointer;
}
.app-boot-mark {
font-size: 18px;
font-weight: 700;
letter-spacing: 0.02em;
}
.app-boot-progress {
width: min(220px, 56vw);
height: 4px;
overflow: hidden;
border-radius: 999px;
background: rgba(148, 163, 184, 0.28);
}
.app-boot-bar {
height: 100%;
width: 28%;
border-radius: inherit;
background: #38bdf8;
}
.app-boot-progress[data-mode="indeterminate"] .app-boot-bar {
animation: app-boot-sweep 1.15s ease-in-out infinite;
}
.app-boot-progress[data-mode="determinate"] .app-boot-bar {
width: 0;
transform: none;
animation: none;
transition: width 0.28s ease;
}
@keyframes app-boot-sweep {
0% {
transform: translateX(-130%);
}
100% {
transform: translateX(380%);
}
}
@media (prefers-reduced-motion: reduce) {
.app-boot-progress[data-mode="indeterminate"] .app-boot-bar {
width: 42%;
animation: none;
}
.app-boot-progress[data-mode="determinate"] .app-boot-bar {
transition: none;
}
#app-boot-splash {
transition: none;
}
}
@media (max-width: 400px) {
#app-boot-splash:not([data-failed]) {
display: none !important;
}
}
</style>
<script>
function showCockpitBootFailure() {
var splash = document.getElementById('app-boot-splash');
var failure = document.getElementById('app-boot-failure');
if (!splash || !failure || !failure.hidden) return;
var retry = failure.querySelector('button');
if (/^zh\b/i.test(navigator.language)) {
failure.querySelector('p').textContent = 'Cockpit Tools 启动失败。';
retry.textContent = '重新加载';
}
splash.querySelector('.app-boot-progress').hidden = true;
splash.setAttribute('data-failed', '');
splash.removeAttribute('aria-hidden');
retry.onclick = function () { window.location.reload(); };
failure.hidden = false;
retry.focus();
}
window.addEventListener('cockpit:boot-failed', showCockpitBootFailure);
window.addEventListener('error', function (event) {
var target = event.target;
if (target instanceof HTMLScriptElement && target.type === 'module') {
showCockpitBootFailure();
}
}, true);
</script>
</head>
<body>
<div id="app-boot-splash" aria-hidden="true">
<div class="app-boot-mark">Cockpit Tools</div>
<div class="app-boot-progress" data-mode="indeterminate">
<div class="app-boot-bar" id="app-boot-bar"></div>
</div>
<div id="app-boot-failure" hidden>
<p role="alert">Cockpit Tools failed to start.</p>
<button type="button">Reload</button>
</div>
</div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>