Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
"use client";
import { useCallback, useEffect } from "react";
import { setCloseGuard } from "@/features/appshell";
export function useUnsavedWorkflow(dirty: boolean, winId?: string) {
const confirmDiscard = useCallback(() => !dirty || window.confirm("Discard unsaved workflow changes?"), [dirty]);
useEffect(() => {
if (winId) setCloseGuard(winId, dirty ? confirmDiscard : null);
const beforeUnload = (event: BeforeUnloadEvent) => { event.preventDefault(); event.returnValue = ""; };
if (dirty) window.addEventListener("beforeunload", beforeUnload);
return () => {
if (winId) setCloseGuard(winId, null);
window.removeEventListener("beforeunload", beforeUnload);
};
}, [dirty, winId, confirmDiscard]);
return confirmDiscard;
}