Files
lingniu-vehicle-ingest/vehicle-data-platform/apps/web/index.html
2026-07-16 09:19:05 +08:00

61 lines
3.4 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/brand-mark.svg" />
<title>羚牛车辆数据中台</title>
<style>
#platform-boot{display:grid;min-height:100vh;place-items:center;background:#f3f6fa;color:#1d2a3d;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}#platform-boot>div{display:grid;width:min(360px,calc(100vw - 40px));justify-items:center;border:1px solid #e1e8f1;border-radius:16px;background:#fff;padding:34px 28px;box-shadow:0 18px 55px rgba(22,43,75,.1);text-align:center}.platform-boot-logo{display:block;width:150px;height:auto}#platform-boot strong{margin-top:18px;font-size:18px}#platform-boot small{margin-top:8px;color:#758399;font-size:12px;line-height:1.6}#platform-boot button{height:40px;margin-top:20px;border:0;border-radius:8px;background:#1268f3;padding:0 18px;color:#fff;font-weight:700;cursor:pointer}#platform-boot.is-error .platform-boot-logo{opacity:.45}
</style>
</head>
<body>
<div id="root"><div id="platform-boot" role="status" aria-live="polite"><div><img class="platform-boot-logo" src="/brand-logo.svg" alt="灵牛智能" /><strong>车辆数据中台</strong><small>正在加载工作台…</small></div></div></div>
<script>
(() => {
const readyEvent = 'vehicle-platform:ready';
let settled = false;
const cleanup = () => {
window.clearTimeout(timer);
window.removeEventListener('error', fail, true);
window.removeEventListener('unhandledrejection', fail);
window.removeEventListener(readyEvent, ready);
};
const ready = () => { if (!settled) { settled = true; cleanup(); } };
const fail = () => {
if (settled) return;
const boot = document.getElementById('platform-boot');
if (!boot) { ready(); return; }
settled = true;
cleanup();
boot.classList.add('is-error');
boot.setAttribute('role', 'alert');
const title = boot.querySelector('strong');
const detail = boot.querySelector('small');
const card = boot.querySelector('div');
if (title) title.textContent = '平台启动失败';
if (detail) detail.textContent = '页面资源未能正常加载,请检查网络后重新获取最新版本。';
if (card) {
const retry = document.createElement('button');
retry.type = 'button';
retry.textContent = '重新加载最新版本';
retry.addEventListener('click', () => {
const target = new URL(window.location.href);
target.searchParams.set('__reload', String(Date.now()));
window.location.replace(target);
}, { once: true });
card.appendChild(retry);
}
};
window.addEventListener('error', fail, true);
window.addEventListener('unhandledrejection', fail);
window.addEventListener(readyEvent, ready, { once: true });
const timer = window.setTimeout(fail, 10_000);
})();
</script>
<noscript><div style="padding:24px;font-family:sans-serif">车辆数据中台需要启用 JavaScript 后访问。</div></noscript>
<script src="/app-config.js"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>