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
@@ -14,6 +14,10 @@ import Pagination from "../components/Pagination";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { confirmDialog } from "../utils/dialogs";
|
||||
import IntegrationPageTitle from "../components/IntegrationPageTitle";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { toast } from "../utils/toast";
|
||||
import { SearchBox } from "../components/TableToolbar";
|
||||
import { useTableSearch } from "../hooks/useTableSearch";
|
||||
|
||||
function updateBadge(c: DockhandContainer) {
|
||||
if (c.updateAvailable === null) return <span className="text-secondary">—</span>;
|
||||
@@ -91,7 +95,8 @@ export default function Docker({ user }: { user: CurrentUser }) {
|
||||
const hosts = [...new Set((data?.containers ?? []).map((c) => c.environmentName))].sort();
|
||||
const filteredContainers = (data?.containers ?? []).filter((c) => !hostFilter || c.environmentName === hostFilter);
|
||||
|
||||
const { sorted, sortKey, sortDir, requestSort } = useSortable(filteredContainers);
|
||||
const tableSearch = useTableSearch(filteredContainers);
|
||||
const { sorted, sortKey, sortDir, requestSort } = useSortable(tableSearch.filtered);
|
||||
const { pageItems, page, setPage, pageCount, totalCount } = usePagination(sorted);
|
||||
|
||||
function exportCsv() {
|
||||
@@ -131,6 +136,7 @@ export default function Docker({ user }: { user: CurrentUser }) {
|
||||
setError(null);
|
||||
try {
|
||||
await api.integrations.dockhand[action](selectedId, c.environmentId, c.id);
|
||||
toast.success(`${action === "start" ? "Started" : action === "stop" ? "Stopped" : "Restarted"} ${c.name}.`);
|
||||
loadContainers(selectedId);
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : String(err));
|
||||
@@ -142,7 +148,7 @@ export default function Docker({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<IntegrationPageTitle title="Docker" adminName="Dockhand" integration={selected} />
|
||||
{error && <div className="alert alert-danger">{error}</div>}
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{integrations?.length === 0 ? (
|
||||
<div className="card">
|
||||
@@ -193,6 +199,7 @@ export default function Docker({ user }: { user: CurrentUser }) {
|
||||
</span>
|
||||
)}
|
||||
</h3>
|
||||
<SearchBox value={tableSearch.query} onChange={tableSearch.setQuery} className="ms-3" />
|
||||
<div className="card-actions d-flex gap-2">
|
||||
{hosts.length > 1 && (
|
||||
<select
|
||||
|
||||
Reference in new issue
Block a user