{{ define "hx_iscsi_luns" }}
<div>
  <table class="w-full">
    <thead><tr><th>LUN ID</th><th>ZVol</th><th>Size</th><th>Action</th></tr></thead>
    <tbody>
    {{ if . }}
      {{ range . }}
        <tr>
          <td>{{ .lun_id }}</td>
          <td>{{ .zvol }}</td>
          <td>{{ .size }}</td>
          <td>
            <div>
            <form hx-post="/api/iscsi/unmap_lun" hx-include="closest form" style="display:inline-block">
              <input type="hidden" name="id" value="{{ .id }}" />
              <button type="submit">Drain</button>
            </form>
            <form hx-post="/api/iscsi/delete_lun" hx-include="closest form" style="display:inline-block">
              <input type="hidden" name="id" value="{{ .id }}" />
              <input type="checkbox" name="force" id="force-{{ .id }}" value="1" />
              <label for="force-{{ .id }}">Force delete</label>
              <button type="submit">Delete</button>
            </form>
          </div>
          </td>
        </tr>
      {{ end }}
    {{ end }}
    </tbody>
  </table>
</div>
{{ end }}
