still working
This commit is contained in:
16
internal/templates/hx_pools.html
Normal file
16
internal/templates/hx_pools.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{define "hx_pools"}}
|
||||
<div>
|
||||
<table class="min-w-full bg-white">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Health</th><th>Capacity</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .}}
|
||||
<tr class="border-t"><td>{{.Name}}</td><td>{{.Health}}</td><td>{{.Capacity}}</td></tr>
|
||||
{{else}}
|
||||
<tr><td colspan="3">No pools</td></tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{end}}
|
||||
6
internal/templates/job_row.html
Normal file
6
internal/templates/job_row.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{define "job_row"}}
|
||||
<div class="p-2 bg-gray-50 rounded border mb-2">
|
||||
<div class="text-sm"><strong>Job:</strong> {{.JobID}} {{if .Name}}— {{.Name}}{{end}}</div>
|
||||
<div class="text-xs text-gray-500">Status: {{.Status}}{{if .Progress}} — {{.Progress}}%{{end}}</div>
|
||||
</div>
|
||||
{{end}}
|
||||
21
internal/templates/storage.html
Normal file
21
internal/templates/storage.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{define "content"}}
|
||||
<div class="bg-white rounded shadow p-4">
|
||||
<h1 class="text-2xl font-bold">Storage</h1>
|
||||
<div class="mt-4">
|
||||
<button class="px-3 py-2 bg-blue-500 text-white rounded" hx-get="/hx/pools" hx-swap="outerHTML" hx-target="#pools">Refresh pools</button>
|
||||
</div>
|
||||
<div id="pools" class="mt-4">
|
||||
{{template "hx_pools.html" .}}
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<h2 class="text-lg font-semibold">Create Pool</h2>
|
||||
<form hx-post="/storage/pool/create" hx-swap="afterbegin" class="mt-2">
|
||||
<div class="flex space-x-2">
|
||||
<input name="name" placeholder="pool name" class="border rounded p-1" />
|
||||
<input name="vdevs" placeholder="/dev/sda,/dev/sdb" class="border rounded p-1" />
|
||||
<button class="px-3 py-1 bg-green-500 text-white rounded" type="submit">Create</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user