-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (58 loc) · 2.3 KB
/
Copy pathindex.html
File metadata and controls
65 lines (58 loc) · 2.3 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#f7f8fb" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#0b1220" media="(prefers-color-scheme: dark)" />
<!--
Minimal bootstrap (no flash of wrong theme/language)
We only support English (default) and Czech (browser Czech → Czech).
UI preferences are stored in localStorage as `vpsadmin.uiSettings.v1`.
-->
<script>
(() => {
try {
const storageKey = 'vpsadmin.uiSettings.v1';
const raw = window.localStorage ? window.localStorage.getItem(storageKey) : null;
const html = document.documentElement;
const detectLang = () => {
const langs = navigator.languages || [navigator.language];
const hasCs = (langs || []).some((l) => String(l).toLowerCase().startsWith('cs'));
return hasCs ? 'cs' : 'en';
};
if (raw) {
const s = JSON.parse(raw);
const theme = s && typeof s.theme === 'string' ? s.theme : 'system';
if (theme === 'light' || theme === 'dark') {
html.setAttribute('data-theme', theme);
html.style.colorScheme = '';
} else {
html.removeAttribute('data-theme');
html.style.colorScheme = 'light dark';
}
const prefLang = s && typeof s.language === 'string' ? s.language : 'system';
const lang = prefLang === 'cs' || prefLang === 'en' ? prefLang : detectLang();
html.lang = lang;
} else {
html.lang = detectLang();
html.style.colorScheme = 'light dark';
}
} catch {
// ignore
}
})();
</script>
<title>vpsAdmin</title>
</head>
<body>
<div id="root"></div>
<!--
Optional runtime bootstrap.
The module entry loads /config.js before React mounts so legacy/BFF runtime config
is available during app startup without keeping a classic script in index.html.
On localhost/dev it also tries /config.local.js afterwards for local overrides.
-->
<script type="module" src="/src/bootstrap.ts"></script>
</body>
</html>