safesight-control/internal/web/ui/templates/tasks.html

71 lines
2.4 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.

{{define "tasks"}}
<div class="card">
<h2>批量操作</h2>
<div class="muted small">任务域负责批量下发、批量重启、批量回滚和执行历史。</div>
<form method="post" action="/ui/tasks" style="margin-top:10px">
<div class="row">
<div>
<div class="muted small">任务类型</div>
<select name="type">
<option value="config_apply">下发识别配置</option>
<option value="reload">重载识别服务</option>
<option value="rollback">回滚识别配置</option>
<option value="media_start">启动视频分析服务</option>
<option value="media_restart">重启视频分析服务</option>
<option value="media_stop">停止视频分析服务</option>
</select>
</div>
<div>
<div class="muted small">目标节点标识(逗号分隔)</div>
<input name="device_ids" value="{{.DeviceIDs}}" placeholder="id1,id2" />
</div>
</div>
<div style="margin-top:10px">
<div class="muted small">高级参数JSON</div>
<textarea name="payload_json" spellcheck="false">{{if .RawJSON}}{{.RawJSON}}{{else}}
{"config":{}}
{{end}}</textarea>
</div>
<div style="margin-top:10px"><button type="submit">创建任务</button></div>
</form>
</div>
<div class="card">
<h2>执行历史</h2>
<div class="table-wrap" style="margin-top:10px">
<table>
<thead>
<tr><th>任务</th><th>类型</th><th>目标设备数</th><th>状态</th></tr>
</thead>
<tbody>
{{range .Tasks}}
<tr>
<td>
<div><a class="mono" href="/ui/tasks/{{.ID}}">{{.ID}}</a></div>
<div class="muted small">{{taskActionLabel .Type}}</div>
</td>
<td>
<span class="{{taskGroupClass .Type}}">{{taskGroupLabel .Type}}</span>
</td>
<td>{{len .DeviceIDs}} 台</td>
<td>
<span class="{{taskStatusClass .Status}}">{{taskStatusLabel .Status}}</span>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
<div class="card">
<h2>常用动作</h2>
<div class="actions" style="margin-top:8px">
<span class="pill">批量下发</span>
<span class="pill">批量重启</span>
<span class="pill">批量回滚</span>
<a class="btn ghost" href="/ui/api">高级调试</a>
</div>
</div>
{{end}}