Update change encryption key dialog (#23551)

This commit is contained in:
Bram Kragten 2025-01-02 15:13:53 +01:00
parent 01bc45c78b
commit 64ad37ed6a

View File

@ -92,7 +92,9 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
? "Save current encryption key" ? "Save current encryption key"
: this._step === "new" : this._step === "new"
? "New encryption key" ? "New encryption key"
: ""; : this._step === "done"
? "Save new encryption key"
: "";
return html` return html`
<ha-md-dialog disable-cancel-action open @closed=${this.closeDialog}> <ha-md-dialog disable-cancel-action open @closed=${this.closeDialog}>
@ -166,10 +168,22 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
case "new": case "new":
return html` return html`
<p> <p>
Keep this encryption key in a safe place, as you will need it to All next backups will use the new encryption key. Encryption keeps
access your backup, allowing it to be restored. Either record the your backups private and secure.
</p>
<div class="encryption-key">
<p>${this._newEncryptionKey}</p>
<ha-icon-button
.path=${mdiContentCopy}
@click=${this._copyKeyToClipboard}
></ha-icon-button>
</div>
`;
case "done":
return html`<p>
Keep this new encryption key in a safe place, as you will need it to
access your backups, allowing it to be restored. Either record the
characters below or download them as an emergency kit file. characters below or download them as an emergency kit file.
Encryption keeps your backups private and secure.
</p> </p>
<div class="encryption-key"> <div class="encryption-key">
<p>${this._newEncryptionKey}</p> <p>${this._newEncryptionKey}</p>
@ -189,18 +203,7 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
Download Download
</ha-button> </ha-button>
</ha-md-list-item> </ha-md-list-item>
</ha-md-list> </ha-md-list>`;
`;
case "done":
return html`
<div class="done">
<img
src="/static/images/voice-assistant/hi.png"
alt="Casita Home Assistant logo"
/>
<p>Encryption key changed</p>
</div>
`;
} }
return nothing; return nothing;
} }
@ -303,13 +306,6 @@ class DialogChangeBackupEncryptionKey extends LitElement implements HassDialog {
p { p {
margin-top: 0; margin-top: 0;
} }
.done {
text-align: center;
font-size: 22px;
font-style: normal;
font-weight: 400;
line-height: 28px;
}
`, `,
]; ];
} }