mirror of
https://github.com/Dvorinka/Dash.git
synced 2026-10-28 15:51:27 +00:00
P5a: 24h uptime bar strip + latency chart on monitor detail, iframe
embed widget, generic JSON-path widget, accent/wallpaper/custom CSS
settings, PWA manifest + service worker, demo GIF.
P5b: transport picker + per-transport fields + test button in
settings; per-monitor alert-rule fields in dialogs.
P5c: container cpu/mem columns, SMART/ZFS/GPU sections on system
detail, subdomains section on domain detail.
P5d: login/setup page + auth middleware client handling, board
switcher + /b/:slug routes, full string extraction to typed t() keys
with {param} interpolation, complete cs locale, language select.
Authored By: TDvorak <[email protected]>
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
17 lines
557 B
TypeScript
17 lines
557 B
TypeScript
import { createClient } from "@dash/api-client";
|
|
|
|
/** Same-origin typed client; vite proxies /api in dev. */
|
|
export const api = createClient();
|
|
|
|
api.use({
|
|
onResponse({ request, response }) {
|
|
// A 401 from a real endpoint means auth is enabled and the session is
|
|
// gone — tell the shell to drop back to the login gate. Auth endpoints
|
|
// handle their own 401s (bad password shows inline).
|
|
if (response.status === 401 && !request.url.includes("/api/auth/")) {
|
|
window.dispatchEvent(new Event("dash:unauthorized"));
|
|
}
|
|
return response;
|
|
},
|
|
});
|