chore: migrate frontend assets to OSS and same-origin APIs

This commit is contained in:
2026-06-04 16:03:49 +08:00
parent 7c6129555b
commit c7c52c1467
55 changed files with 728 additions and 292 deletions
+5 -2
View File
@@ -28,6 +28,7 @@ import {
SERVER_SESSION_REPLACED_EVENT,
SERVER_SESSION_EXPIRED_EVENT,
checkServerHealth,
clearAllUserStorage,
getErrorMessage,
type ServerSessionReplacedDetail,
} from "./api/serverConnection";
@@ -143,7 +144,9 @@ function normalizeViewKey(rawView: string): WebViewKey {
}
function readViewFromHash(): WebViewKey {
return normalizeViewKey(window.location.hash.replace(/^#\/?/, ""));
const raw = window.location.hash.replace(/^#\/?/, "");
if (!raw) return "home";
return normalizeViewKey(raw);
}
function isWorkspaceView(view: WebViewKey): boolean {
@@ -375,7 +378,7 @@ function App() {
}, [setView, setWorkspaceExpanded]);
const clearAuthenticatedState = useCallback((options?: { resetView?: boolean }) => {
keyServerClient.clearSession();
clearAllUserStorage();
clearSessionState();
setProjects([]);
setProjectsLoaded(true);