系统设置增加中控企业微信告警,后台巡检离线/故障并冷却推送。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+56
-28
@@ -1,28 +1,56 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}系统设置 · 期权中控{% endblock %}
|
||||
{% block body %}
|
||||
<section class="page-head"><h1>系统设置</h1></section>
|
||||
|
||||
<section class="panel settings-card">
|
||||
<h2>登录账号</h2>
|
||||
<p class="muted">修改后立即生效,并写入服务器 <code>.env</code>(<code>HUB_USERNAME</code> / <code>HUB_PASSWORD</code>).</p>
|
||||
<form method="post" class="stack settings-form" autocomplete="off">
|
||||
<label>当前用户名
|
||||
<input type="text" value="{{ current_username }}" readonly class="readonly">
|
||||
</label>
|
||||
<label>当前密码
|
||||
<input type="password" name="current_password" required autocomplete="current-password" placeholder="验证身份">
|
||||
</label>
|
||||
<label>新用户名
|
||||
<input type="text" name="new_username" value="{{ current_username }}" required autocomplete="username" minlength="2" maxlength="64">
|
||||
</label>
|
||||
<label>新密码
|
||||
<input type="password" name="new_password" autocomplete="new-password" minlength="6" placeholder="至少 6 位;不改密码可留空">
|
||||
</label>
|
||||
<label>确认新密码
|
||||
<input type="password" name="confirm_password" autocomplete="new-password" minlength="6" placeholder="与新密码一致;不改密码可留空">
|
||||
</label>
|
||||
<button type="submit">保存账号</button>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% extends "base.html" %}
|
||||
{% block title %}系统设置 · 期权中控{% endblock %}
|
||||
{% block body %}
|
||||
<section class="page-head"><h1>系统设置</h1></section>
|
||||
|
||||
<div class="settings-grid">
|
||||
<section class="panel settings-card">
|
||||
<h2>登录账号</h2>
|
||||
<p class="muted">修改后立即生效,并写入服务器 <code>.env</code>(<code>HUB_USERNAME</code> / <code>HUB_PASSWORD</code>).</p>
|
||||
<form method="post" class="stack settings-form" autocomplete="off">
|
||||
<input type="hidden" name="form_action" value="account">
|
||||
<label>当前用户名
|
||||
<input type="text" value="{{ current_username }}" readonly class="readonly">
|
||||
</label>
|
||||
<label>当前密码
|
||||
<input type="password" name="current_password" required autocomplete="current-password" placeholder="验证身份">
|
||||
</label>
|
||||
<label>新用户名
|
||||
<input type="text" name="new_username" value="{{ current_username }}" required autocomplete="username" minlength="2" maxlength="64">
|
||||
</label>
|
||||
<label>新密码
|
||||
<input type="password" name="new_password" autocomplete="new-password" minlength="6" placeholder="至少 6 位;不改密码可留空">
|
||||
</label>
|
||||
<label>确认新密码
|
||||
<input type="password" name="confirm_password" autocomplete="new-password" minlength="6" placeholder="与新密码一致;不改密码可留空">
|
||||
</label>
|
||||
<button type="submit">保存账号</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel settings-card">
|
||||
<h2>企业微信告警</h2>
|
||||
<p class="muted">中控专用:客户端离线/故障与恢复时推送。与各交易机自身通知分开配置。</p>
|
||||
<form method="post" class="stack settings-form" autocomplete="off">
|
||||
<label class="check-row">
|
||||
<input type="checkbox" name="wechat_enabled" value="1"{% if wechat.enabled %} checked{% endif %}>
|
||||
启用企业微信推送
|
||||
</label>
|
||||
<label>Webhook 地址
|
||||
<input type="url" name="wechat_webhook" value="{{ wechat.webhook }}" placeholder="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=..." autocomplete="off">
|
||||
</label>
|
||||
<label>告警冷却(秒)
|
||||
<input type="number" name="alert_cooldown_sec" value="{{ wechat.cooldown_sec }}" min="60" max="86400" step="1">
|
||||
</label>
|
||||
<label>连续失败阈值
|
||||
<input type="number" name="health_fail_threshold" value="{{ wechat.fail_threshold }}" min="1" max="20" step="1">
|
||||
<span class="field-hint">连续拉失败达到次数后才告警,默认 2</span>
|
||||
</label>
|
||||
<div class="settings-actions">
|
||||
<button type="submit" name="form_action" value="wechat">保存告警配置</button>
|
||||
<button type="submit" name="form_action" value="wechat_test" class="btn-secondary">发送测试消息</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user