@@ -0,0 +1,102 @@
|
||||
{{define "content"}}
|
||||
<div class="page narrow">
|
||||
<header class="page-head">
|
||||
<div>
|
||||
<h1>设置</h1>
|
||||
<p class="muted">预警天数、备份、账户与数据导出</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="section card">
|
||||
<h2>基础设置</h2>
|
||||
<form method="post" action="/settings" class="form">
|
||||
<div class="grid-2">
|
||||
<label class="field"><span>到期预警(天)</span>
|
||||
<input type="number" name="warn_days" min="0" max="60" value="{{.D.WarnDays}}">
|
||||
</label>
|
||||
<label class="field"><span>大屏自动刷新(秒)</span>
|
||||
<input type="number" name="screen_refresh" min="5" max="600" value="{{.D.ScreenRefresh}}">
|
||||
</label>
|
||||
</div>
|
||||
<p class="muted small">监听地址、端口、数据库、备份、日志、时区等部署参数在 <code>daili.ini</code> 里配置,改完重启生效。</p>
|
||||
<div class="actions"><button class="btn btn-primary" type="submit">保存设置</button></div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="section card">
|
||||
<h2>管理员</h2>
|
||||
<p class="muted small">所有账户权限相同,任何操作都会记在日志里。</p>
|
||||
<div class="table-wrap">
|
||||
<table class="table tight">
|
||||
<thead><tr><th>用户名</th><th>显示名称</th><th>状态</th><th>创建时间</th><th>最近登录</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{{$me := .User}}
|
||||
{{range .D.Users}}
|
||||
<tr>
|
||||
<td class="mono">{{.Username}}</td>
|
||||
<td>{{.DisplayName}}</td>
|
||||
<td>{{if .IsActive}}<span class="chip chip-active">启用</span>{{else}}<span class="chip chip-closed">停用</span>{{end}}</td>
|
||||
<td class="mono small">{{.CreatedAt}}</td>
|
||||
<td class="mono small">{{if .LastLoginAt}}{{.LastLoginAt}}{{else}}—{{end}}</td>
|
||||
<td class="actions-cell">
|
||||
{{if eq .ID $me.ID}}
|
||||
<span class="muted small">当前账户</span>
|
||||
{{else}}
|
||||
<form method="post" action="/settings/users/{{.ID}}/toggle">
|
||||
<button class="btn btn-sm btn-ghost">{{if .IsActive}}停用{{else}}启用{{end}}</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form method="post" action="/settings/users" class="inline-form">
|
||||
<label class="inline-field">用户名 <input name="username" required minlength="3" maxlength="32" autocomplete="off"></label>
|
||||
<label class="inline-field">显示名称 <input name="display_name" maxlength="32"></label>
|
||||
<label class="inline-field">初始密码 <input type="password" name="password" required minlength="6" autocomplete="new-password"></label>
|
||||
<button class="btn btn-primary" type="submit">新增管理员</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="section card">
|
||||
<h2>修改我的密码</h2>
|
||||
<form method="post" action="/settings/password" class="form">
|
||||
<div class="grid-3">
|
||||
<label class="field"><span>原密码</span><input type="password" name="old_password" required autocomplete="current-password"></label>
|
||||
<label class="field"><span>新密码(≥6 位)</span><input type="password" name="password" required minlength="6" autocomplete="new-password"></label>
|
||||
<label class="field"><span>再输一次</span><input type="password" name="password2" required minlength="6" autocomplete="new-password"></label>
|
||||
</div>
|
||||
<div class="actions"><button class="btn btn-primary" type="submit">更新密码</button></div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="section card">
|
||||
<h2>数据</h2>
|
||||
<dl class="kv">
|
||||
<div><dt>配置文件</dt><dd class="mono small">{{.D.ConfigPath}} <span class="muted">(修改后重启生效)</span></dd></div>
|
||||
<div><dt>数据库</dt><dd class="mono small">{{.D.DBPath}}</dd></div>
|
||||
<div><dt>备份</dt><dd class="mono small">{{.D.BackupDir}} · 保留 {{.D.BackupKeep}} 份 · {{if .D.BackupEnabled}}自动备份已开启{{else}}自动备份已关闭{{end}}</dd></div>
|
||||
<div><dt>大屏</dt><dd class="mono small">/screen {{if .D.ScreenPublic}}免登录{{else}}需登录{{end}}</dd></div>
|
||||
<div><dt>局域网地址</dt><dd class="mono small">http://{{if .D.Addrs}}{{index .D.Addrs 0}}{{else}}127.0.0.1{{end}}:{{.D.Port}}/screen</dd></div>
|
||||
<div><dt>已运行</dt><dd class="mono">{{.D.Uptime}}</dd></div>
|
||||
<div><dt>数据量</dt><dd>{{.D.CustomerCount}} 位客户 · {{.D.PackageCount}} 个套餐 · {{.D.LogCount}} 条日志</dd></div>
|
||||
</dl>
|
||||
<div class="actions wrap">
|
||||
<form method="post" action="/settings/backup"><button class="btn" type="submit">立即备份</button></form>
|
||||
<a class="btn" href="/export/customers.csv">导出客户 CSV</a>
|
||||
<a class="btn" href="/export/subscriptions.csv">导出订阅 CSV</a>
|
||||
<a class="btn" href="/export/logs.csv">导出日志 CSV</a>
|
||||
</div>
|
||||
{{if .D.Backups}}
|
||||
<details class="backups">
|
||||
<summary>最近备份({{len .D.Backups}} 份)</summary>
|
||||
<ul class="mono small">
|
||||
{{range .D.Backups}}<li>{{.}}</li>{{end}}
|
||||
</ul>
|
||||
</details>
|
||||
{{end}}
|
||||
</section>
|
||||
</div>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user