From 400c90f7fb81e0797dce6c89691b30695faf6c7f Mon Sep 17 00:00:00 2001 From: Sucukdeluxe <259325684+Sucukdeluxe@users.noreply.github.com> Date: Sat, 26 Sep 2026 10:19:16 +0200 Subject: [PATCH] Clarify online backup key creation and status messages The menu entry opens the key creation section instead of creating a key immediately, the create button shows its progress, and success or error messages appear as toasts. Key entries list creation time, source IP and validity on separate lines, and the backup submenu separates local and online actions. --- renderer/app.js | 36 ++++++++++++++++++++++++++++++------ renderer/index.html | 1 + renderer/styles.css | 12 ++++++++++-- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/renderer/app.js b/renderer/app.js index 90c66fb..d787a23 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -1792,7 +1792,7 @@ async function _handleMenuAction(action) { case 'add-folder': document.getElementById('addFolderBtn')?.click(); break; case 'backup-export': doBackupExport(); break; case 'backup-import': doBackupImport(); break; - case 'online-backup-create': doOnlineBackupCreate(); break; + case 'online-backup-create': openOnlineBackupCreate(); break; case 'online-backup-restore': openOnlineBackupRestore(); break; case 'restart': if (await showAppConfirm({ title: 'Anwendung neu starten?', message: 'Nicht gespeicherte laufende Aktionen werden beendet.', confirmText: 'Neustart', danger: true })) window.api.restartApp(); break; case 'quit': window.api.quitApp(); break; @@ -3780,8 +3780,17 @@ function setOnlineBackupStatus(message, state = '', statusContext = null) { const context = statusContext === null ? beginOnlineBackupStatusContext() : statusContext; if (context !== onlineBackupStatusContextGeneration) return false; const status = document.getElementById('onlineBackupStatus'); + const text = String(message || '').replace(/MHU2-[A-Za-z0-9_-]{70}/gu, localizeUiText('Geschützter Schlüssel')); + if (state === 'success' || state === 'error' || state === 'warning') { + if (status) { + status.textContent = ''; + status.dataset.state = ''; + } + showCopyToast(text, 5000, state); + return true; + } if (!status) return false; - status.textContent = String(message || '').replace(/MHU2-[A-Za-z0-9_-]{70}/gu, localizeUiText('Geschützter Schlüssel')); + status.textContent = text; status.dataset.state = state; return true; } @@ -3904,12 +3913,14 @@ function renderManagedOnlineBackups(focusTarget = undefined) { const created = document.createElement('span'); created.className = 'online-backup-managed-created'; const createdLabel = document.createElement('span'); - createdLabel.textContent = `${localizeUiText('Erstellt')}: ${formatDateTime(entry.createdAt).text} | ${entry.sourceIp ? `IP: ${entry.sourceIp}` : localizeUiText('IP unbekannt')}`; + createdLabel.textContent = `${localizeUiText('Erstellt')}: ${formatDateTime(entry.createdAt).text}`; + const sourceLabel = document.createElement('span'); + sourceLabel.textContent = entry.sourceIp ? `IP: ${entry.sourceIp}` : localizeUiText('IP unbekannt'); const expirationLabel = document.createElement('span'); expirationLabel.textContent = entry.expiresAt ? `${localizeUiText('Gültig bis')}: ${formatDateTime(entry.expiresAt).text}` : localizeUiText('Unbegrenzt gültig'); - created.append(createdLabel, expirationLabel); + created.append(createdLabel, sourceLabel, expirationLabel); const actions = document.createElement('div'); actions.className = 'online-backup-managed-actions'; const copyButton = document.createElement('button'); @@ -4109,7 +4120,10 @@ async function doOnlineBackupCreate() { const createButton = document.getElementById('createOnlineBackupBtn'); const retentionSelect = document.getElementById('onlineBackupRetentionSelect'); const retention = retentionSelect?.value || 'forever'; - if (createButton) createButton.disabled = true; + if (createButton) { + createButton.disabled = true; + createButton.textContent = localizeUiText('Wird erstellt…'); + } if (retentionSelect) retentionSelect.disabled = true; setOnlineBackupStatus('Verschlüssele und speichere Einstellungen…', 'busy', authority.statusContext); try { @@ -4125,12 +4139,22 @@ async function doOnlineBackupCreate() { setOnlineBackupStatus('Online-Sicherung konnte nicht erstellt werden', 'error', authority.statusContext); } finally { endManagedOnlineBackupMutation(); - if (createButton?.isConnected) createButton.disabled = false; + if (createButton?.isConnected) { + createButton.disabled = false; + createButton.textContent = localizeUiText('Neuen Schlüssel erzeugen'); + } if (retentionSelect?.isConnected) retentionSelect.disabled = false; doOnlineBackupCreate.busy = false; } } +function openOnlineBackupCreate() { + openOnlineBackupView(); + const createModule = document.getElementById('onlineBackupCreateHeading')?.closest('.online-backup-module'); + createModule?.scrollIntoView({ block: 'nearest' }); + document.getElementById('createOnlineBackupBtn')?.focus(); +} + function openOnlineBackupView(focusRestore = false) { document.querySelector('.tab[data-view="settings"]')?.click(); const searchInput = document.getElementById('settingsSearchInput'); diff --git a/renderer/index.html b/renderer/index.html index 5887136..2002253 100644 --- a/renderer/index.html +++ b/renderer/index.html @@ -83,6 +83,7 @@
diff --git a/renderer/styles.css b/renderer/styles.css index 333276d..99249c5 100644 --- a/renderer/styles.css +++ b/renderer/styles.css @@ -2180,8 +2180,9 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; } .online-backup-managed-row { display: grid; - grid-template-columns: 168px 238px minmax(0, 1fr); - gap: 10px; + grid-template-columns: minmax(0, 1fr) auto; + grid-template-areas: "key actions" "created actions"; + gap: 6px 16px; align-items: center; min-width: 0; padding: 10px 12px; @@ -2191,6 +2192,7 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; } } .online-backup-managed-key { + grid-area: key; min-width: 0; overflow-wrap: anywhere; color: var(--text); @@ -2199,6 +2201,7 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; } } .online-backup-managed-created { + grid-area: created; display: grid; overflow-wrap: anywhere; gap: 3px; @@ -2209,6 +2212,7 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; } } .online-backup-managed-actions { + grid-area: actions; display: flex; justify-content: flex-end; gap: 8px; @@ -4044,6 +4048,10 @@ input[type="checkbox"] { grid-template-columns: 1fr; } + .online-backup-managed-row { + grid-template-areas: "key" "created" "actions"; + } + .online-backup-managed-actions { width: 100%; }