{{define "tasks"}}
<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>
        {{else}}
        <tr>
          <td colspan="4" class="muted">还没有批量任务。从设备页选择设备后发起操作，这里会展示执行记录。</td>
        </tr>
        {{end}}
      </tbody>
    </table>
  </div>
</div>
{{end}}
