feat(ui): improve the records table, view state and record dialog
Sortable record columns, filters and sort kept in the URL on the zones, zone and audit pages, a Show action that filters the records table to a problem's owner, Save and add another, a highlight of the saved row, an Audit history link on the zone page, and dialogs that keep typed input on a backdrop click.
This commit is contained in:
1 parent
a67183b646
commit
440f78ce9e
9 files changed
+419
-36
No files matched your search
+6
-3
@@ -1,10 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// Copyright (C) 2026 Bryan Joshua Pedini
|
||||
|
||||
import { $, api, appData, busy, clear, clearErrors, handleError, h, openDialog, parseNumber, plural, setupDialogs, showFlash, toast, zoneLink } from "./common.js";
|
||||
import { $, api, appData, busy, clear, clearErrors, handleError, h, openDialog, parseNumber, plural, readQuery, setupDialogs, showFlash, toast, writeQuery, zoneLink } from "./common.js";
|
||||
|
||||
const { isAdmin } = appData();
|
||||
const state = { zones: [], counts: null, countsFailed: false, search: "" };
|
||||
const state = { zones: [], counts: null, countsFailed: false, search: readQuery().get("q") || "" };
|
||||
|
||||
function problemCell(zone) {
|
||||
const cell = h("td");
|
||||
@@ -123,9 +123,12 @@ function setupCreate() {
|
||||
|
||||
setupDialogs();
|
||||
showFlash();
|
||||
$("#zone-search").addEventListener("input", (event) => {
|
||||
const search = $("#zone-search");
|
||||
search.value = state.search;
|
||||
search.addEventListener("input", (event) => {
|
||||
state.search = event.target.value;
|
||||
render();
|
||||
writeQuery({ q: state.search.trim() });
|
||||
});
|
||||
if (isAdmin) setupCreate();
|
||||
load();
|
||||
Reference in new issue
Block a user