系统设置增加「系统更新」Tab:中控本机更新与客户端远程更新,实例页入口移除。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 07:24:36 +08:00
parent f2b29870ae
commit bce446178d
8 changed files with 497 additions and 199 deletions
+47 -3
View File
@@ -2,12 +2,12 @@
{% block title %}系统设置 · 期权中控{% endblock %}
{% block body %}
{% set _tab = (request.args.get('tab') or 'account').strip() %}
{% if _tab not in ('account', 'wechat', 'backup') %}{% set _tab = 'account' %}{% endif %}
{% if _tab not in ('account', 'wechat', 'backup', 'update') %}{% set _tab = 'account' %}{% endif %}
<section class="page-head settings-head">
<div>
<p class="settings-eyebrow">Hub Settings</p>
<h1>系统设置</h1>
<p class="muted settings-lead">账号、告警与备份在此维护;保存后立即生效。</p>
<p class="muted settings-lead">账号、告警、备份与系统更新在此维护;保存后立即生效。</p>
</div>
</section>
@@ -15,11 +15,13 @@
<input type="radio" name="hub-settings-tab" id="hub-set-account" class="settings-tab-radio"{% if _tab == 'account' %} checked{% endif %}>
<input type="radio" name="hub-settings-tab" id="hub-set-wechat" class="settings-tab-radio"{% if _tab == 'wechat' %} checked{% endif %}>
<input type="radio" name="hub-settings-tab" id="hub-set-backup" class="settings-tab-radio"{% if _tab == 'backup' %} checked{% endif %}>
<input type="radio" name="hub-settings-tab" id="hub-set-update" class="settings-tab-radio"{% if _tab == 'update' %} checked{% endif %}>
<div class="settings-tabs" role="tablist" aria-label="系统设置分类">
<label for="hub-set-account" class="settings-tab-btn" role="tab">登录账号</label>
<label for="hub-set-wechat" class="settings-tab-btn" role="tab">企业微信</label>
<label for="hub-set-backup" class="settings-tab-btn" role="tab">备份恢复</label>
<label for="hub-set-update" class="settings-tab-btn" role="tab">系统更新</label>
</div>
<div class="settings-panels">
@@ -138,10 +140,52 @@
</div>
</div>
</section>
<section class="settings-panel settings-panel--update" role="tabpanel">
<div class="settings-card-head">
<span class="settings-badge">Update</span>
<h2>系统更新</h2>
<p class="muted">快速更新 = git pull + pm2 restart。中控本机更新;客户端经 Bridge 远程下发。有持仓时慎用。</p>
</div>
<div class="settings-backup-body">
<div class="backup-block">
<div class="backup-block-head">
<h3>中控更新</h3>
<p class="muted field-hint">当前版本 <code id="hub-update-version" class="update-version">—</code></p>
<div class="settings-actions">
<button type="button" class="settings-primary" id="hub-update-btn">更新中控</button>
<button type="button" class="btn-secondary" id="hub-update-refresh">刷新版本</button>
<span class="update-status muted" id="hub-update-status"></span>
</div>
</div>
</div>
<div class="backup-block">
<div class="backup-block-head">
<h3>客户端远程更新</h3>
<p class="muted field-hint">经 Bridge 探测版本并下发更新;客户端需已具备 <code>/api/hub/update</code></p>
<div class="settings-actions">
<button type="button" class="btn-secondary" id="client-update-refresh">刷新列表</button>
</div>
</div>
<div class="table-wrap">
<table class="backup-table update-table">
<thead><tr><th>实例</th><th>版本</th><th>状态</th><th>操作</th></tr></thead>
<tbody id="client-update-body"><tr><td colspan="4" class="muted">加载中…</td></tr></tbody>
</table>
</div>
</div>
</div>
</section>
</div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='settings_backup.js') }}?v=2"></script>
<script>HubSettingsBackup.boot();</script>
<script src="{{ url_for('static', filename='settings_update.js') }}?v=1"></script>
<script>
HubSettingsBackup.boot();
HubSettingsUpdate.boot();
</script>
{% endblock %}