mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Replace confirm with confirmation dialogs in snapshots (#6690)
This commit is contained in:
parent
47e9531972
commit
6599351d45
@ -7,9 +7,9 @@ import {
|
|||||||
CSSResult,
|
CSSResult,
|
||||||
customElement,
|
customElement,
|
||||||
html,
|
html,
|
||||||
|
internalProperty,
|
||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
internalProperty,
|
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
import { createCloseHeading } from "../../../../src/components/ha-dialog";
|
||||||
@ -19,6 +19,7 @@ import {
|
|||||||
fetchHassioSnapshotInfo,
|
fetchHassioSnapshotInfo,
|
||||||
HassioSnapshotDetail,
|
HassioSnapshotDetail,
|
||||||
} from "../../../../src/data/hassio/snapshot";
|
} from "../../../../src/data/hassio/snapshot";
|
||||||
|
import { showConfirmationDialog } from "../../../../src/dialogs/generic/show-dialog-box";
|
||||||
import { PolymerChangedEvent } from "../../../../src/polymer-types";
|
import { PolymerChangedEvent } from "../../../../src/polymer-types";
|
||||||
import { haStyleDialog } from "../../../../src/resources/styles";
|
import { haStyleDialog } from "../../../../src/resources/styles";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
@ -266,8 +267,12 @@ class HassioSnapshotDialog extends LitElement {
|
|||||||
this._snapshotPassword = ev.detail.value;
|
this._snapshotPassword = ev.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _partialRestoreClicked() {
|
private async _partialRestoreClicked() {
|
||||||
if (!confirm("Are you sure you want to restore this snapshot?")) {
|
if (
|
||||||
|
!(await showConfirmationDialog(this, {
|
||||||
|
title: "Are you sure you want partially to restore this snapshot?",
|
||||||
|
}))
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,8 +317,13 @@ class HassioSnapshotDialog extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _fullRestoreClicked() {
|
private async _fullRestoreClicked() {
|
||||||
if (!confirm("Are you sure you want to restore this snapshot?")) {
|
if (
|
||||||
|
!(await showConfirmationDialog(this, {
|
||||||
|
title:
|
||||||
|
"Are you sure you want to wipe your system and restore this snapshot?",
|
||||||
|
}))
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,8 +348,12 @@ class HassioSnapshotDialog extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _deleteClicked() {
|
private async _deleteClicked() {
|
||||||
if (!confirm("Are you sure you want to delete this snapshot?")) {
|
if (
|
||||||
|
!(await showConfirmationDialog(this, {
|
||||||
|
title: "Are you sure you want to delete this snapshot?",
|
||||||
|
}))
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user