feat: add sort by vmid, name, last created, last updated on dashboard
- GET /api/instances now accepts ?sort= (name|vmid|created_at|updated_at) and ?order= (asc|desc); invalid sort fields fall back to name asc - Timestamp sorts use id as a tiebreaker (datetime() precision is 1 s) - Toolbar gains a sort-field <select> and a ↑/↓ direction toggle button - toggleSortDir() flips direction and re-fetches; state held in data-dir attr Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,13 @@
|
||||
<select id="filter-stack" onchange="filterInstances()">
|
||||
<option value="">all stacks</option>
|
||||
</select>
|
||||
<select id="sort-field" onchange="filterInstances()">
|
||||
<option value="name">name</option>
|
||||
<option value="vmid">vmid</option>
|
||||
<option value="updated_at">last updated</option>
|
||||
<option value="created_at">last created</option>
|
||||
</select>
|
||||
<button id="sort-dir" class="btn" data-dir="asc" onclick="toggleSortDir()" title="reverse sort">↑</button>
|
||||
<div class="toolbar-right">
|
||||
<button class="btn primary" onclick="openNewModal()">+ new instance</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user