Files
2026-07-13 13:04:19 +08:00

57 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>GenericAgent</title>
<style>
:root{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Microsoft YaHei UI","Helvetica Neue",Helvetica,Arial,sans-serif;background:#fff;color:#111}
@media(prefers-color-scheme:dark){:root{background:#1a1a1a;color:#eee}}
html,body{height:100%;margin:0;display:flex;align-items:center;justify-content:center}
.card{text-align:center;opacity:.85;width:280px}
.spinner{width:28px;height:28px;margin:0 auto 14px;border:3px solid #9994;border-top-color:currentColor;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
#ga-status{font-size:13px;line-height:1.5}
.bar{display:none;width:240px;height:6px;margin:14px auto 0;background:#9993;border-radius:99px;overflow:hidden}
.bar.show{display:block}
#ga-bar{height:100%;width:0;background:currentColor;border-radius:99px;transition:width .3s ease}
#ga-bar.indet{width:35%;animation:indet 1.1s ease-in-out infinite}
@keyframes indet{0%{margin-left:-35%}100%{margin-left:100%}}
</style>
<script>
// Loading window shows before the main UI, on a different origin than the app, so it can't
// read the app's saved language; fall back to the system/browser locale.
var GA_ZH = (navigator.language || '').toLowerCase().indexOf('zh') === 0;
var GA_MSG = {
starting_app: GA_ZH ? '正在启动 GenericAgent…' : 'Starting GenericAgent…',
start: GA_ZH ? '首次启动,正在准备运行环境…' : 'First run: preparing the runtime…',
venv: GA_ZH ? '正在创建运行环境…' : 'Creating the runtime environment…',
deps: GA_ZH ? '正在安装依赖…' : 'Installing dependencies…',
done: GA_ZH ? '依赖安装完成' : 'Dependencies installed',
starting: GA_ZH ? '正在启动服务…' : 'Starting services…'
};
window.gaProgress = function(pct, key){
var s = document.getElementById('ga-status');
if (s) s.textContent = GA_MSG[key] || key;
var bar = document.querySelector('.bar');
var fill = document.getElementById('ga-bar');
if (bar) bar.classList.add('show');
if (fill){
if (pct < 0){ fill.classList.add('indet'); }
else { fill.classList.remove('indet'); fill.style.width = Math.max(0, Math.min(100, pct)) + '%'; }
}
};
document.addEventListener('DOMContentLoaded', function(){
var s = document.getElementById('ga-status');
if (s) s.textContent = GA_MSG.starting_app;
});
</script>
</head>
<body>
<div class="card">
<div class="spinner"></div>
<div id="ga-status">正在启动 GenericAgent…</div>
<div class="bar"><div id="ga-bar"></div></div>
</div>
</body>
</html>