Files
gold_monitor/app/templates/accounts.html
T

58 lines
2.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}账户 · {{ app_name }}{% endblock %}
{% block content %}
<h2 style="margin:0 0 14px">账户{% if can_create %}(仅管理员可创建){% else %}(只读自己的账户){% endif %}</h2>
<div class="grid cols-2">
{% if can_create %}
<div class="card">
<h3>新增账户</h3>
<p class="muted">账户禁止自助注册,创建后在「用户」中绑定给唯一操作员。</p>
<form method="post" action="{{ url_for('accounts_create') }}">
<div class="form-row"><label>名称</label><input name="name" required placeholder="如:模拟盘-A"></div>
<div class="form-row"><label>券商</label><input name="broker" placeholder="MT5 券商名"></div>
<div class="form-row"><label>登录号</label><input name="login_id" placeholder="可选"></div>
<div class="form-row">
<label>类型</label>
<select name="account_type">
<option value="demo">模拟</option>
<option value="cent">美分</option>
<option value="real">实盘</option>
</select>
</div>
<div class="form-row"><label>标注</label><textarea name="note" rows="2" placeholder="用途、纪律备注"></textarea></div>
<button class="btn" type="submit">添加</button>
</form>
</div>
{% endif %}
<div class="card">
<h3>账户列表</h3>
<table>
<thead><tr><th>名称</th><th>类型</th><th>标注</th><th></th></tr></thead>
<tbody>
{% for a in items %}
<tr>
<td>{{ a.name }}<div class="muted">{{ a.broker }} {{ a.login_id }}</div></td>
<td><span class="tag gray">{{ a.account_type }}</span></td>
<td style="min-width:180px">
<form method="post" action="{{ url_for('accounts_note', aid=a.id) }}">
<input name="note" value="{{ a.note or '' }}" placeholder="标注">
<button class="btn secondary" style="margin-top:6px" type="submit">保存</button>
</form>
</td>
<td>
#{{ a.id }}
{% if can_create %}
<form method="post" action="{{ url_for('accounts_delete', aid=a.id) }}" style="margin-top:8px"
onsubmit="return confirm('确认删除账户 #{{ a.id }} {{ a.name }}?');">
<button class="btn secondary" type="submit">删除</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}