{{define "device_config"}}
<div class="card">
  <div class="section-title">
    <div>
      <h2>单设备配置已并入设备详情</h2>
      <div class="muted small">配置查看、服务控制和回滚，都已经收敛到设备详情工作台。</div>
    </div>
    <a class="btn ghost" href="/ui/devices">去设备列表</a>
  </div>
</div>

<div class="card">
  <h2>设备入口</h2>
  <div class="device-selector-grid" style="margin-top:12px">
    {{range .Devices}}
    <a class="selector-card" href="/ui/devices/{{.DeviceID}}#device-config">
      <div class="selector-head">
        <div>
          <div class="selector-title">{{if .DeviceName}}{{.DeviceName}}{{else}}{{.DeviceID}}{{end}}</div>
          <div class="muted small mono">{{.DeviceID}}</div>
        </div>
        {{if .Online}}<span class="pill ok">在线</span>{{else}}<span class="pill bad">离线</span>{{end}}
      </div>
      <div class="muted small mono">{{.IP}}:{{.AgentPort}}</div>
      <div class="actions" style="margin-top:12px">
        <span class="btn secondary">打开设备详情</span>
      </div>
    </a>
    {{else}}
    <div class="empty-state">
      <div class="empty-title">暂无设备</div>
      <div class="muted">请先去设备页扫描或新增设备。</div>
    </div>
    {{end}}
  </div>
</div>
{{end}}
