Toasts, logo icons, shared table toolbar with search, and a density toggle
Feedback: toasts confirm common actions, and a page's error or success message that appears out of view is also shown as a toast. Icons: the tab, app and home-screen icons are the house from the logo; a dev instance gets a coloured dot on its tab icon. Tables: Secrets, Admin Links, IP Addresses and Alerts share one toolbar (search, filters, row count, actions, Export CSV); twelve more tables get a multi-word search box; long tables keep their column headings in view on wide screens. Density: Compact / Normal / Roomy in the user menu, remembered per browser. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7d56ad18b7
commit
617dc1ea2f
56 files changed
+757
-158
No files matched your search
@@ -8,6 +8,9 @@ import Pagination from "../components/Pagination";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { readableError } from "../utils/errors";
|
||||
import IntegrationPageTitle from "../components/IntegrationPageTitle";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { SearchBox } from "../components/TableToolbar";
|
||||
import { useTableSearch } from "../hooks/useTableSearch";
|
||||
|
||||
function statusBadge(monitor: UptimeKumaMonitor) {
|
||||
switch (monitor.status) {
|
||||
@@ -74,7 +77,8 @@ export default function UptimeKuma({ user: _user }: { user: CurrentUser }) {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [selectedId]);
|
||||
|
||||
const { sorted, sortKey, sortDir, requestSort } = useSortable(data?.monitors, "name");
|
||||
const tableSearch = useTableSearch(data?.monitors);
|
||||
const { sorted, sortKey, sortDir, requestSort } = useSortable(tableSearch.filtered, "name");
|
||||
const { pageItems, page, setPage, pageCount, totalCount } = usePagination(sorted);
|
||||
|
||||
function exportCsv() {
|
||||
@@ -99,7 +103,7 @@ export default function UptimeKuma({ user: _user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<IntegrationPageTitle title="Uptime Kuma" integration={selected} />
|
||||
{error && <div className="alert alert-danger">{error}</div>}
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{integrations?.length === 0 ? (
|
||||
<div className="card">
|
||||
@@ -138,6 +142,7 @@ export default function UptimeKuma({ user: _user }: { user: CurrentUser }) {
|
||||
<span className="text-yellow fw-normal ms-2">{data.summary.pending} pending</span>
|
||||
)}
|
||||
</h3>
|
||||
<SearchBox value={tableSearch.query} onChange={tableSearch.setQuery} className="ms-3" />
|
||||
<div className="card-actions">
|
||||
<button className="btn btn-sm btn-outline-secondary" onClick={exportCsv} disabled={!sorted || sorted.length === 0}>
|
||||
Export CSV
|
||||
|
||||
Reference in new issue
Block a user