Files
geMoldInsight/static/index.html
T
2026-06-01 10:44:08 +08:00

78 lines
2.7 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gemold - 模具制造管理系统</title>
<script>
(function () {
var params = new URLSearchParams(location.search);
var uiParam = params.get('ui');
var themeParam = params.get('theme');
var storedUi = null;
try { storedUi = localStorage.getItem('gemold_ui_version'); } catch (e) {}
var storedPercent = null;
try { storedPercent = localStorage.getItem('gemold_ui_rollout_percent'); } catch (e) {}
var percent = storedPercent ? Number(storedPercent) : 0;
if (!Number.isFinite(percent) || percent < 0) percent = 0;
if (percent > 100) percent = 100;
var uid = null;
try { uid = localStorage.getItem('gemold_uid'); } catch (e) {}
if (!uid) {
uid = 'u_' + Math.random().toString(36).slice(2, 10) + Date.now().toString(36);
try { localStorage.setItem('gemold_uid', uid); } catch (e) {}
}
function hash32(str) {
var h = 2166136261;
for (var i = 0; i < str.length; i++) {
h ^= str.charCodeAt(i);
h = Math.imul(h, 16777619);
}
return h >>> 0;
}
function chooseUiVersion() {
if (uiParam === 'v1' || uiParam === 'v2') return uiParam;
if (storedUi === 'v1' || storedUi === 'v2') return storedUi;
if (percent <= 0) return 'v1';
var bucket = hash32(uid) % 100;
return bucket < percent ? 'v2' : 'v1';
}
function chooseTheme() {
var storedTheme = null;
try { storedTheme = localStorage.getItem('gemold_theme'); } catch (e) {}
if (themeParam === 'light' || themeParam === 'dark') return themeParam;
if (storedTheme === 'light' || storedTheme === 'dark') return storedTheme;
return 'light';
}
var ui = chooseUiVersion();
var theme = chooseTheme();
document.documentElement.dataset.ui = ui;
document.documentElement.dataset.theme = theme;
try {
if (uiParam === 'v1' || uiParam === 'v2') localStorage.setItem('gemold_ui_version', uiParam);
if (themeParam === 'light' || themeParam === 'dark') localStorage.setItem('gemold_theme', themeParam);
} catch (e) {}
})();
</script>
<script type="module" crossorigin src="/static/assets/index-B-OcU2wj.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-CpCSYLtb.css">
</head>
<body>
<div id="app">
<div class="loading-overlay">
<div class="loading-content">
<div class="loading-spinner"></div>
<p style="margin-top: 16px; color: var(--text-secondary);">加载中...</p>
</div>
</div>
</div>
</body>
</html>