diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index eb2d48cc8..85f15b740 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -247,6 +247,7 @@ export function renderApp(state: AppViewState) { state.applySettings({ ...state.settings, sessionKey: next }); }, onRefresh: () => state.loadOverview(), + onReconnect: () => state.connect(), }) : nothing} diff --git a/ui/src/ui/app.ts b/ui/src/ui/app.ts index 660fe5ec4..18e109fc7 100644 --- a/ui/src/ui/app.ts +++ b/ui/src/ui/app.ts @@ -664,11 +664,19 @@ export class ClawdbotApp extends LitElement { if (!window.location.search) return; const params = new URLSearchParams(window.location.search); const token = params.get("token")?.trim(); - if (!token) return; - if (!this.settings.token) { + const password = params.get("password")?.trim(); + let changed = false; + if (token && !this.settings.token) { this.applySettings({ ...this.settings, token }); + params.delete("token"); + changed = true; } - params.delete("token"); + if (password) { + this.password = password; + params.delete("password"); + changed = true; + } + if (!changed) return; const url = new URL(window.location.href); url.search = params.toString(); window.history.replaceState({}, "", url.toString()); diff --git a/ui/src/ui/views/overview.ts b/ui/src/ui/views/overview.ts index 6a728808a..39f348ec2 100644 --- a/ui/src/ui/views/overview.ts +++ b/ui/src/ui/views/overview.ts @@ -20,6 +20,7 @@ export type OverviewProps = { onPasswordChange: (next: string) => void; onSessionKeyChange: (next: string) => void; onRefresh: () => void; + onReconnect: () => void; }; export function renderOverview(props: OverviewProps) { @@ -84,7 +85,8 @@ export function renderOverview(props: OverviewProps) {
- Reconnect to apply changes. + + Reconnect to apply URL/password changes.