feat #14740: link to the euvino admin backend

- Settings section "Backend": backend URL, login status checked live
  (logged in as / until, not logged in, backend unreachable), Anmelden /
  Neu anmelden, Abmelden and the link to the key management page
- login window "backend-login": the backend's own login page in an
  incognito webview without any Tauri capability; after a page load
  behind the login, its cookies create a key (one request, never stored
  or logged), the key goes to the keyring, the window closes; closing it
  cancels; one login at a time, later requests wait for the same result
- call detail: "Transkript hochladen" / "Erneut hochladen" (with a
  confirmation), "wird hochgeladen…", "Hochgeladen am … (ID …)" and
  inline errors; logs in first when there is no usable key
- saving a different backend URL discards the key of the old backend

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-06 14:54:38 +01:00
co-authored by Claude Opus 5.5
parent 58e96a2954
commit f045424e97
10 changed files with 990 additions and 29 deletions
+37 -1
View File
@@ -15,6 +15,24 @@ export interface Settings {
autostart: boolean
start_after_secs: number
end_after_secs: number
/** The euvino admin backend, e.g. "https://test.euvinopro.eu". */
backend_url: string
/** Whose backend key is stored; set by the app at login. */
backend_username: string | null
/** When the stored backend key expires (RFC 3339); set by the app. */
backend_key_expires_at: string | null
}
/** Login status for the settings, checked with the backend. */
export interface BackendStatus {
logged_in: boolean
username: string | null
/** RFC 3339. */
expires_at: string | null
/** `false` if the key could not be checked; username and expiry are then the stored ones. */
reachable: boolean
/** Where the admin manages their keys. */
keys_url: string
}
export type Service = 'deepscript'
@@ -67,6 +85,10 @@ export interface CallListItem {
interrupted: boolean
/** The name the user gave the call, if any. */
title: string | null
/** The CRM's id of the transcript, from its last upload. */
crm_transcript_id: string | null
/** When the transcript was last uploaded (RFC 3339). */
uploaded_at: string | null
}
/** A transcript line; `speaker_key` is "me" or "remote:<n>". */
@@ -87,7 +109,7 @@ export interface SpeakerMerge {
}
export interface CallDetail {
call: CallListItem & { error: string | null }
call: CallListItem & { error: string | null; transcribed_at: string | null }
/** The transcript with speaker merges applied. */
segments: SegmentView[]
/** Renamed speakers by key. */
@@ -144,6 +166,14 @@ export const unmergeSpeaker = (id: CallId, fromKey: string) =>
/** `null` or an empty title restores the default heading. */
export const renameCall = (id: CallId, title: string | null) =>
invoke<void>('rename_call', { id, title })
export const backendStatus = () => invoke<BackendStatus>('backend_status')
/** Resolves once the login window created a key; rejects if it was closed or failed. */
export const backendLogin = () => invoke<void>('backend_login')
export const backendLogout = () => invoke<void>('backend_logout')
/** Opens the backend's key management page in the system browser. */
export const openBackendKeysPage = () => invoke<void>('open_backend_keys_page')
/** Logs in first if needed; resolves once the CRM has the transcript. */
export const uploadTranscript = (id: CallId) => invoke<void>('upload_transcript', { id })
export const getUpdate = () => invoke<UpdateInfo | null>('get_update')
/** Resolves only on failure: on success the app restarts. */
export const installUpdate = () => invoke<void>('install_update')
@@ -158,6 +188,12 @@ export const onPromptChanged = (handler: () => void): Promise<UnlistenFn> =>
/** A call's status changed (processing started, done or failed). */
export const onCallUpdated = (handler: (id: CallId) => void): Promise<UnlistenFn> =>
listen<{ id: CallId }>('call-updated', (event) => handler(event.payload.id))
/** The backend login changed (logged in, logged out, key discarded). */
export const onBackendChanged = (handler: () => void): Promise<UnlistenFn> =>
listen<null>('backend-changed', () => handler())
/** Creating the key failed; the login window stays open for another try. */
export const onBackendLoginError = (handler: (message: string) => void): Promise<UnlistenFn> =>
listen<{ message: string }>('backend-login-error', (event) => handler(event.payload.message))
export const onUpdateAvailable = (handler: (info: UpdateInfo) => void): Promise<UnlistenFn> =>
listen<UpdateInfo>('update-available', (event) => handler(event.payload))
export const onUpdateProgress = (