Files
gold_monitor/app/templates/machines.html
T

39 lines
1.5 KiB
HTML

{% extends "base.html" %}
{% block title %}机器 · {{ app_name }}{% endblock %}
{% block content %}
<h2 style="margin:0 0 14px">机器标注</h2>
<div class="grid cols-2">
<div class="card">
<h3>预登记机器</h3>
<p class="muted">也可不预登记:激活时自动创建机器并绑定指纹。</p>
<form method="post" action="{{ url_for('machines_create') }}">
<div class="form-row"><label>名称</label><input name="name" placeholder="如:书房台式机"></div>
<div class="form-row"><label>标注</label><textarea name="note" rows="2"></textarea></div>
<button class="btn" type="submit">添加</button>
</form>
</div>
<div class="card">
<h3>已有机器</h3>
<table>
<thead><tr><th>名称 / 指纹</th><th>最近在线</th><th>标注</th></tr></thead>
<tbody>
{% for m in items %}
<tr>
<td>
<form method="post" action="{{ url_for('machines_note', mid=m.id) }}">
<input name="name" value="{{ m.name }}" style="margin-bottom:6px">
<div class="muted">{{ m.device_fingerprint or '未绑定' }}</div>
<textarea name="note" rows="2" style="margin-top:6px">{{ m.note or '' }}</textarea>
<button class="btn secondary" style="margin-top:6px" type="submit">保存</button>
</form>
</td>
<td class="muted">{{ m.last_seen_at or '—' }}</td>
<td>#{{ m.id }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}