mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-17 23:54:28 +01:00
Config logs streaming (#22172)
* Add logs follow for error-log-card WIP * Add stream config logs * Add new logs indicator to error-log-card * Add number of lines select for error-log-card * Add improvements and nr of lines to error-log-card * Fix error-log-card linter issue * Use error-log-card in addon views * Remove unused hassio-addon-logs * Add backwards compatibility for error-log-card * Remove version test flag in error-log-card * Add recovery mode support to error-log-card * Add search highlight for error-log-card * Add search, add additional lines to ha-ansi-to-html * Add infinity load older logs in error-log-card * Fix hassio-supervisor-log using fetchHassioLogs * Fix colored lines in ha-ansi-to-html * Fix search and prevent empty parts in ha-ansi-to-html * Fix load old logs initially in error-log-card * Add download log lines dialog * Fix load logs without stream in error-log-card * Fix ha-ansi-to-html search * Add debounce scroll for core provider in error-log-card * Add hass.callApiRaw * Fix variable naming for dialog-download-logs * Improve scroll down wording in error-log-card
This commit is contained in:
@@ -177,10 +177,34 @@ export const fetchHassioInfo = async (
|
||||
);
|
||||
};
|
||||
|
||||
export const fetchHassioLogs = async (hass: HomeAssistant, provider: string) =>
|
||||
hass.callApi<string>(
|
||||
export const fetchHassioLogs = async (
|
||||
hass: HomeAssistant,
|
||||
provider: string,
|
||||
range?: string
|
||||
) =>
|
||||
hass.callApiRaw(
|
||||
"GET",
|
||||
`hassio/${provider.includes("_") ? `addons/${provider}` : provider}/logs`
|
||||
`hassio/${provider.includes("_") ? `addons/${provider}` : provider}/logs`,
|
||||
undefined,
|
||||
range
|
||||
? {
|
||||
Range: range,
|
||||
}
|
||||
: undefined
|
||||
);
|
||||
|
||||
export const fetchHassioLogsFollow = async (
|
||||
hass: HomeAssistant,
|
||||
provider: string,
|
||||
signal: AbortSignal,
|
||||
lines = 100
|
||||
) =>
|
||||
hass.callApiRaw(
|
||||
"GET",
|
||||
`hassio/${provider.includes("_") ? `addons/${provider}` : provider}/logs/follow?lines=${lines}`,
|
||||
undefined,
|
||||
undefined,
|
||||
signal
|
||||
);
|
||||
|
||||
export const getHassioLogDownloadUrl = (provider: string) =>
|
||||
@@ -188,6 +212,11 @@ export const getHassioLogDownloadUrl = (provider: string) =>
|
||||
provider.includes("_") ? `addons/${provider}` : provider
|
||||
}/logs`;
|
||||
|
||||
export const getHassioLogDownloadLinesUrl = (provider: string, lines: number) =>
|
||||
`/api/hassio/${
|
||||
provider.includes("_") ? `addons/${provider}` : provider
|
||||
}/logs?lines=${lines}`;
|
||||
|
||||
export const setSupervisorOption = async (
|
||||
hass: HomeAssistant,
|
||||
data: SupervisorOptions
|
||||
|
||||
Reference in New Issue
Block a user