feat: replace browser confirm with proper key-change warning dialog
When the relay's server key changes (e.g. after restart), show a styled in-app warning dialog instead of the ugly browser confirm(). The dialog shows old vs new fingerprints and lets the user accept the new key or cancel. Accepting updates the saved fingerprint and refreshes the relay button state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -652,6 +652,88 @@ button.primary:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
|
||||
.secondary-btn:hover { border-color: var(--accent); color: var(--text); }
|
||||
|
||||
/* ── Key warning dialog ── */
|
||||
#key-warning {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
backdrop-filter: blur(6px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 300;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.key-warning-card {
|
||||
max-width: 360px;
|
||||
text-align: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.key-warning-icon {
|
||||
font-size: 48px;
|
||||
color: var(--yellow);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.key-warning-card h2 {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.key-warning-text {
|
||||
font-size: 13px;
|
||||
color: var(--text-dim);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.key-warning-fps {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
background: var(--surface);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.key-fp-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.key-fp-label {
|
||||
font-size: 10px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.key-fp {
|
||||
font-family: monospace;
|
||||
font-size: 11px;
|
||||
word-break: break-all;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.key-warning-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.key-warning-actions .primary {
|
||||
flex: 1;
|
||||
background: var(--yellow);
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.key-warning-actions .secondary-btn {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* ── Quality slider ── */
|
||||
.quality-control {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user