Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clean-all/clean-all-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ESPHomeCleanAllDialog extends LitElement {
protected render() {
return html`
<esphome-process-dialog
heading="Clean All"
heading="Clean All Files"
.type=${"clean-all"}
.spawnParams=${{ clean_build_dir: true }}
@closed=${this._handleClose}
Expand Down
18 changes: 17 additions & 1 deletion src/clean-all/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { showConfirmationDialog } from "../dialogs";

const preload = () => import("./clean-all-dialog");

export const openCleanAllDialog = () => {
export const openCleanAllDialog = async () => {
if (
!(await showConfirmationDialog({
title: "Clean All Files",
text:
"Do you want to clean all build and platform files? " +
"This will remove all cached files and dependencies, " +
"which may take a while to download again and reinstall.",
confirmText: "Clean All Files",
dismissText: "Cancel",
destructive: true,
}))
) {
return;
}
preload();
const dialog = document.createElement("esphome-clean-all-dialog");
document.body.append(dialog);
Expand Down
20 changes: 3 additions & 17 deletions src/components/esphome-header-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ESPHomeHeaderMenu extends LitElement {
label="Update All"
@click=${this._handleUpdateAll}
></mwc-button>
<mwc-button label="Clean All" @click=${this._handleCleanAll}>
<mwc-button label="Clean All Files" @click=${this._handleCleanAll}>
<esphome-svg-icon
slot="icon"
.path=${mdiBroom}
Expand Down Expand Up @@ -84,7 +84,7 @@ export class ESPHomeHeaderMenu extends LitElement {
slot="graphic"
.path=${mdiBroom}
></esphome-svg-icon
>Clean All</mwc-list-item
>Clean All Files</mwc-list-item
>
<mwc-list-item graphic="icon"
><mwc-icon slot="graphic">lock</mwc-icon>Secrets
Expand Down Expand Up @@ -135,21 +135,7 @@ export class ESPHomeHeaderMenu extends LitElement {
openUpdateAllDialog();
}

private async _handleCleanAll() {
if (
!(await showConfirmationDialog({
title: "Clean All",
text:
"Do you want to clean all build and platform files? " +
"This will remove all cached files and dependencies, " +
"which may take a while to download again and reinstall.",
confirmText: "Clean All",
dismissText: "Cancel",
destructive: true,
}))
) {
return;
}
private _handleCleanAll() {
openCleanAllDialog();
}

Expand Down
15 changes: 13 additions & 2 deletions src/devices/configured-device-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "../components/esphome-svg-icon";
import "@polymer/paper-tooltip/paper-tooltip.js";
import { openCleanMQTTDialog } from "../clean-mqtt";
import { openCleanDialog } from "../clean";
import { openCleanAllDialog } from "../clean-all";
import { openValidateDialog } from "../validate";
import { openInstallChooseDialog } from "../install-choose";
import { openLogsTargetDialog } from "../logs-target";
Expand Down Expand Up @@ -181,6 +182,13 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
.path=${mdiBroom}
></esphome-svg-icon>
</mwc-list-item>
<mwc-list-item graphic="icon">
Clean All Files
<esphome-svg-icon
slot="graphic"
.path=${mdiBroom}
></esphome-svg-icon>
</mwc-list-item>
<mwc-list-item graphic="icon">
Download ELF file
<esphome-svg-icon
Expand Down Expand Up @@ -272,6 +280,9 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
openCleanDialog(this.device.configuration);
break;
case 6:
openCleanAllDialog();
break;
case 7:
const type: DownloadType = {
title: "ELF File",
description: "ELF File",
Expand All @@ -285,14 +296,14 @@ class ESPHomeConfiguredDeviceCard extends LitElement {
link.click();
link.remove();
break;
case 7:
case 8:
openDeleteDeviceDialog(
this.device.name,
this.device.configuration,
() => fireEvent(this, "deleted"),
);
break;
case 7:
case 9:
openCleanMQTTDialog(this.device.configuration);
break;
}
Expand Down