diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index bef4875a12..0cd7215010 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -2,6 +2,7 @@ import { mdiDotsVertical, mdiDownload, mdiRefresh, mdiText } from "@mdi/js"; import { css, html, LitElement, nothing } from "lit"; import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; +import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { fireEvent } from "../../../common/dom/fire_event"; import type { LocalizeFunc } from "../../../common/translations/localize"; import "../../../components/buttons/ha-call-service-button"; @@ -23,6 +24,7 @@ import { } from "../../../data/system_log"; import type { HomeAssistant } from "../../../types"; import { fileDownload } from "../../../util/file_download"; +import { showDownloadLogsDialog } from "./show-dialog-download-logs"; import { showSystemLogDetailDialog } from "./show-dialog-system-log-detail"; import { formatSystemLogTime } from "./util"; @@ -228,6 +230,18 @@ export class SystemLogCard extends LitElement { } private async _downloadLogs() { + // download logs via supervisor + if (isComponentLoaded(this.hass, "hassio")) { + showDownloadLogsDialog(this, { + header: this.header, + provider: "core", + defaultLineCount: 100, + boot: 0, + }); + return; + } + + // download logs from core const timeString = new Date().toISOString().replace(/:/g, "-"); const downloadUrl = getErrorLogDownloadUrl; const logFileName = `home-assistant_${timeString}.log`;