mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Download core logs via supervisor (#26251)
Use supervisor download dialog for core downloads
This commit is contained in:
parent
77aca59dda
commit
13868478f7
@ -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`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user