ui+server: per-job bandwidth override on Run-now
P2R-13b. POST /hosts/{id}/source-groups/{gid}/run accepts optional
bandwidth_up_kbps / bandwidth_down_kbps form fields, plumbs them onto
CommandRunPayload. Agent dispatcher already prefers per-job override
over host-wide caps (T1). UI wraps the Run-now button in a form with
a <details> 'Limit bandwidth for this run' disclosure containing two
KB/s inputs.
This commit is contained in:
@@ -53,12 +53,27 @@
|
||||
{{if gt $row.SnapshotCount 0}} · <span class="mono">{{$row.SnapshotCount}}</span> snapshot{{if ne $row.SnapshotCount 1}}s{{end}}{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end row-action" style="gap: 6px;">
|
||||
<div class="flex flex-col items-end row-action" style="gap: 6px;">
|
||||
{{if and (gt (len $g.Includes) 0) (eq $host.Status "online")}}
|
||||
<button class="btn btn-primary"
|
||||
hx-post="/hosts/{{$host.ID}}/source-groups/{{$g.ID}}/run"
|
||||
hx-swap="none"
|
||||
hx-disabled-elt="this">Run now</button>
|
||||
<form id="run-{{$g.ID}}" class="flex flex-col items-end" style="gap: 4px;">
|
||||
<button class="btn btn-primary"
|
||||
hx-post="/hosts/{{$host.ID}}/source-groups/{{$g.ID}}/run"
|
||||
hx-include="#run-{{$g.ID}}"
|
||||
hx-swap="none"
|
||||
hx-disabled-elt="this">Run now</button>
|
||||
<details class="text-[11px] text-ink-fade" style="text-align: right;">
|
||||
<summary class="cursor-pointer hover:text-ink-mid select-none">Limit bandwidth for this run</summary>
|
||||
<div class="flex items-center mt-2" style="gap: 6px; font-family: var(--font-mono);">
|
||||
<label class="text-[10.5px] text-ink-mute">↑</label>
|
||||
<input type="number" min="0" name="bandwidth_up_kbps" placeholder="—" class="input mono"
|
||||
style="width: 70px; height: 22px; padding: 0 6px; font-size: 11px;">
|
||||
<label class="text-[10.5px] text-ink-mute">↓</label>
|
||||
<input type="number" min="0" name="bandwidth_down_kbps" placeholder="—" class="input mono"
|
||||
style="width: 70px; height: 22px; padding: 0 6px; font-size: 11px;">
|
||||
<span class="text-[10.5px] text-ink-fade">KB/s</span>
|
||||
</div>
|
||||
</details>
|
||||
</form>
|
||||
{{else}}
|
||||
<button class="btn" disabled
|
||||
title="{{if eq (len $g.Includes) 0}}add at least one include path before running{{else}}host is offline{{end}}">Run now</button>
|
||||
|
||||
Reference in New Issue
Block a user