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:
@@ -69,8 +69,8 @@ router.get('/instances/stacks', (_req, res) => {
|
||||
|
||||
// GET /api/instances
|
||||
router.get('/instances', (req, res) => {
|
||||
const { search, state, stack } = req.query;
|
||||
res.json(getInstances({ search, state, stack }));
|
||||
const { search, state, stack, sort, order } = req.query;
|
||||
res.json(getInstances({ search, state, stack, sort, order }));
|
||||
});
|
||||
|
||||
// GET /api/instances/:vmid/history
|
||||
|
||||
Reference in New Issue
Block a user