ebe139555b
Co-authored-by: Cursor <cursoragent@cursor.com>
79 lines
3.9 KiB
HTML
79 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}系统设置 · 期权中控{% endblock %}
|
|
{% block body %}
|
|
<section class="page-head settings-head">
|
|
<div>
|
|
<p class="settings-eyebrow">Hub Settings</p>
|
|
<h1>系统设置</h1>
|
|
<p class="muted settings-lead">账号与中控告警在此维护,保存后立即生效。</p>
|
|
</div>
|
|
</section>
|
|
|
|
<div class="settings-grid">
|
|
<section class="panel settings-card settings-card--account">
|
|
<div class="settings-card-head">
|
|
<span class="settings-badge">Account</span>
|
|
<h2>登录账号</h2>
|
|
<p class="muted">修改后立即写入 <code>.env</code>,无需重启。</p>
|
|
</div>
|
|
<form method="post" class="stack settings-form" autocomplete="off" data-lpignore="true" data-1p-ignore="true">
|
|
<input type="hidden" name="form_action" value="account">
|
|
<div class="settings-field">
|
|
<span class="settings-label">当前用户名</span>
|
|
<div class="settings-readonly">{{ current_username }}</div>
|
|
</div>
|
|
<label class="settings-field">当前密码
|
|
<input type="password" name="current_password" required autocomplete="new-password" placeholder="验证身份后才能保存">
|
|
</label>
|
|
<div class="settings-divider"></div>
|
|
<label class="settings-field">新用户名
|
|
<input type="text" name="new_username" value="{{ current_username }}" required autocomplete="off" minlength="2" maxlength="64">
|
|
</label>
|
|
<div class="settings-row-2">
|
|
<label class="settings-field">新密码
|
|
<input type="password" name="new_password" autocomplete="new-password" minlength="6" placeholder="至少 6 位,不改可留空">
|
|
</label>
|
|
<label class="settings-field">确认新密码
|
|
<input type="password" name="confirm_password" autocomplete="new-password" minlength="6" placeholder="再次输入">
|
|
</label>
|
|
</div>
|
|
<button type="submit" class="settings-primary">保存账号</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="panel settings-card settings-card--wechat">
|
|
<div class="settings-card-head">
|
|
<span class="settings-badge settings-badge--alert">Notify</span>
|
|
<h2>企业微信告警</h2>
|
|
<p class="muted">中控专用:客户端离线 / 故障 / 恢复时推送,与交易机通知分开。</p>
|
|
</div>
|
|
<form method="post" class="stack settings-form" autocomplete="off">
|
|
<label class="settings-switch">
|
|
<input type="checkbox" name="wechat_enabled" value="1"{% if wechat.enabled %} checked{% endif %}>
|
|
<span class="settings-switch-ui" aria-hidden="true"></span>
|
|
<span class="settings-switch-text">
|
|
<strong>启用企业微信推送</strong>
|
|
<small>关闭后后台仍巡检,但不发消息</small>
|
|
</span>
|
|
</label>
|
|
<div class="settings-row-2">
|
|
<label class="settings-field">告警冷却(秒)
|
|
<input type="number" name="alert_cooldown_sec" value="{{ wechat.cooldown_sec }}" min="60" max="86400" step="1">
|
|
</label>
|
|
<label class="settings-field">连续失败阈值
|
|
<input type="number" name="health_fail_threshold" value="{{ wechat.fail_threshold }}" min="1" max="20" step="1">
|
|
</label>
|
|
</div>
|
|
<p class="field-hint settings-hint">连续拉取失败达到阈值后才告警,默认 2 次;同一机器在冷却期内不重复推送。</p>
|
|
<label class="settings-field">Webhook 地址
|
|
<input type="url" name="wechat_webhook" value="{{ wechat.webhook }}" placeholder="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=..." autocomplete="off">
|
|
</label>
|
|
<div class="settings-actions">
|
|
<button type="submit" name="form_action" value="wechat" class="settings-primary">保存告警配置</button>
|
|
<button type="submit" name="form_action" value="wechat_test" class="btn-secondary">发送测试消息</button>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
</div>
|
|
{% endblock %}
|