fix #14740: fixed backend url per build, key bound to its server

- the backend URL is no longer a setting: one constant per build
  (release/dev) in src-tauri/src/backend.rs; Settings shows the server
  read-only; an old backend_url in settings.json is ignored
- the stored key records the backend it was created for; a key of
  another backend is discarded before any use and never stored
- a refused key is discarded only if it still is the stored one
- the keyring is never called while the settings are locked
- one upload per call at a time, also visible after a view switch
- opener plugin without its link-click script (it also ran in the
  remote login page); a login error says to reload the login page

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
hauke
2026-11-06 15:18:05 +01:00
co-authored by Claude Opus 5.5
parent f045424e97
commit 3358de7888
10 changed files with 399 additions and 217 deletions
+8 -2
View File
@@ -273,6 +273,12 @@
return parts.join(' · ')
}
// Also while an upload started elsewhere (e.g. before switching views)
// still runs in the app.
let isUploading = $derived(
detail !== null && (uploading.includes(detail.call.id) || detail.uploading),
)
// A failed start (e.g. missing key) also marks the call failed; its
// error is then shown once, in the failure box.
let shownActionError = $derived(actionError !== detail?.call.error ? actionError : '')
@@ -361,11 +367,11 @@
{:else if call.status === 'done'}
<button
class="btn primary"
disabled={!call.transcribed_at || uploading.includes(call.id)}
disabled={!call.transcribed_at || isUploading}
title={call.transcribed_at ? 'Transkript ins CRM hochladen' : 'Noch kein Transkript'}
onclick={uploadClick}
>
{uploading.includes(call.id)
{isUploading
? 'wird hochgeladen…'
: call.uploaded_at
? 'Erneut hochladen'
+10 -15
View File
@@ -4,6 +4,7 @@
import {
backendLogin,
backendLogout,
backendServer,
backendStatus,
errorText,
getSettings,
@@ -16,6 +17,7 @@
saveSettings,
setApiKey,
testDevices,
type BackendServer,
type BackendStatus,
type DeviceInfo,
type DeviceLevels,
@@ -38,6 +40,7 @@
let message = $state('')
let error = $state('')
let server = $state<BackendServer | null>(null)
let backend = $state<BackendStatus | null>(null)
let backendBusy = $state(false)
let backendError = $state('')
@@ -47,6 +50,9 @@
onMount(() => {
load()
backendServer()
.then((s) => (server = s))
.catch((err) => (backendError = errorText(err)))
refreshBackend()
const unlisten = [
onBackendChanged(refreshBackend),
@@ -66,12 +72,10 @@
}
}
/** Saves the settings (the login goes to the saved backend URL), then logs in. */
async function login() {
backendBusy = true
backendError = ''
try {
await persist()
await backendLogin()
} catch (err) {
backendError = errorText(err)
@@ -219,13 +223,8 @@
<section class="card">
<h2>Backend</h2>
<div class="grid">
<label for="backend-url">Backend-URL</label>
<input
id="backend-url"
type="url"
placeholder="https://test.euvinopro.eu"
bind:value={settings.backend_url}
/>
<span>Server</span>
<span>{server ? new URL(server.base_url).host : '…'}</span>
<span>Status</span>
<span class="backend-status">
{#if backend === null}
@@ -253,10 +252,10 @@
{#if backendError}
<p class="error">{backendError}</p>
{/if}
{#if backend}
{#if server}
<p class="muted keys-hint">
Schlüssel auf dem Server verwalten:
<a href={backend.keys_url} onclick={openKeysPage}>{backend.keys_url}</a>
<a href={server.keys_url} onclick={openKeysPage}>{server.keys_url}</a>
</p>
{/if}
</section>
@@ -492,10 +491,6 @@
gap: 8px;
}
.grid input[type='url'] {
max-width: 380px;
}
.backend-actions {
display: flex;
gap: 8px;