Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config logs streaming #22172

Merged
merged 29 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
eaeb17d
Add logs follow for error-log-card WIP
wendevlin Sep 24, 2024
dd160bc
Merge branch 'dev' of github.com:home-assistant/frontend into logs-st…
wendevlin Sep 25, 2024
9dd2583
Add stream config logs
wendevlin Sep 30, 2024
f9a1fc1
Add new logs indicator to error-log-card
wendevlin Oct 1, 2024
28804df
Add number of lines select for error-log-card
wendevlin Oct 1, 2024
77b2105
Add improvements and nr of lines to error-log-card
wendevlin Oct 2, 2024
b9edba1
Merge branch 'dev' of github.com:home-assistant/frontend into logs-st…
wendevlin Oct 2, 2024
4766810
Merge branch 'dev' of github.com:home-assistant/frontend into logs-st…
wendevlin Oct 2, 2024
73c0769
Fix error-log-card linter issue
wendevlin Oct 3, 2024
8bd0dc5
Use error-log-card in addon views
wendevlin Oct 3, 2024
58ef594
Remove unused hassio-addon-logs
wendevlin Oct 3, 2024
ae73ba6
Add backwards compatibility for error-log-card
wendevlin Oct 3, 2024
071a5db
Remove version test flag in error-log-card
wendevlin Oct 3, 2024
910b778
Add recovery mode support to error-log-card
wendevlin Oct 3, 2024
b916064
Add search highlight for error-log-card
wendevlin Oct 3, 2024
d121fed
Merge branch 'dev' of github.com:home-assistant/frontend into logs-st…
wendevlin Oct 9, 2024
cef1b0e
Add search, add additional lines to ha-ansi-to-html
wendevlin Oct 9, 2024
e7ba5c3
Add infinity load older logs in error-log-card
wendevlin Oct 11, 2024
7869a3c
Fix hassio-supervisor-log using fetchHassioLogs
wendevlin Oct 11, 2024
6c92af4
Fix colored lines in ha-ansi-to-html
wendevlin Oct 14, 2024
6132c04
Fix search and prevent empty parts in ha-ansi-to-html
wendevlin Oct 14, 2024
31afa35
Fix load old logs initially in error-log-card
wendevlin Oct 14, 2024
0bf332f
Add download log lines dialog
wendevlin Oct 14, 2024
6bc4a14
Fix load logs without stream in error-log-card
wendevlin Oct 14, 2024
b097e0d
Fix ha-ansi-to-html search
wendevlin Oct 15, 2024
edf3a84
Add debounce scroll for core provider in error-log-card
wendevlin Oct 15, 2024
2eec0de
Add hass.callApiRaw
wendevlin Oct 15, 2024
0653283
Fix variable naming for dialog-download-logs
wendevlin Oct 15, 2024
6e33efc
Improve scroll down wording in error-log-card
wendevlin Oct 21, 2024
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
8 changes: 1 addition & 7 deletions hassio/src/addon-view/hassio-addon-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import "./config/hassio-addon-config";
import "./config/hassio-addon-network";
import "./hassio-addon-router";
import "./info/hassio-addon-info";
import "./log/hassio-addon-logs";

@customElement("hassio-addon-dashboard")
class HassioAddonDashboard extends LitElement {
Expand Down Expand Up @@ -161,16 +160,11 @@ class HassioAddonDashboard extends LitElement {
margin-bottom: 24px;
width: 600px;
}
hassio-addon-logs {
max-width: calc(100% - 8px);
min-width: 600px;
}
@media only screen and (max-width: 600px) {
hassio-addon-info,
hassio-addon-network,
hassio-addon-audio,
hassio-addon-config,
hassio-addon-logs {
hassio-addon-config {
max-width: 100%;
min-width: 100%;
}
Expand Down
47 changes: 40 additions & 7 deletions hassio/src/addon-view/log/hassio-addon-log-tab.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property } from "lit/decorators";
import { customElement, property, state } from "lit/decorators";
import "../../../../src/components/ha-circular-progress";
import { HassioAddonDetails } from "../../../../src/data/hassio/addon";
import { Supervisor } from "../../../../src/data/supervisor/supervisor";
import { haStyle } from "../../../../src/resources/styles";
import { HomeAssistant } from "../../../../src/types";
import { hassioStyle } from "../../resources/hassio-style";
import "./hassio-addon-logs";
import "../../../../src/panels/config/logs/error-log-card";
import "../../../../src/components/search-input";
import { extractSearchParam } from "../../../../src/common/url/search-params";

@customElement("hassio-addon-log-tab")
class HassioAddonLogDashboard extends LitElement {
Expand All @@ -16,23 +18,40 @@ class HassioAddonLogDashboard extends LitElement {

@property({ attribute: false }) public addon?: HassioAddonDetails;

@state() private _filter = extractSearchParam("filter") || "";

protected render(): TemplateResult {
if (!this.addon) {
return html`
<ha-circular-progress indeterminate></ha-circular-progress>
`;
}
return html`
<div class="search">
<search-input
@value-changed=${this._filterChanged}
.hass=${this.hass}
.filter=${this._filter}
.label=${this.hass.localize("ui.panel.config.logs.search")}
></search-input>
</div>
<div class="content">
<hassio-addon-logs
<error-log-card
.hass=${this.hass}
.supervisor=${this.supervisor}
.addon=${this.addon}
></hassio-addon-logs>
.header=${this.addon.name}
.provider=${this.addon.slug}
show
.filter=${this._filter}
>
</error-log-card>
</div>
`;
}

private async _filterChanged(ev) {
this._filter = ev.detail.value;
}

static get styles(): CSSResultGroup {
return [
haStyle,
Expand All @@ -41,7 +60,21 @@ class HassioAddonLogDashboard extends LitElement {
.content {
margin: auto;
padding: 8px;
max-width: 1024px;
}
.search {
position: sticky;
top: 0;
z-index: 2;
}
search-input {
display: block;
--mdc-text-field-fill-color: var(--sidebar-background-color);
--mdc-text-field-idle-line-color: var(--divider-color);
}
@media all and (max-width: 870px) {
:host {
--error-log-card-height: calc(100vh - 304px);
}
}
`,
];
Expand Down
90 changes: 0 additions & 90 deletions hassio/src/addon-view/log/hassio-addon-logs.ts

This file was deleted.

4 changes: 3 additions & 1 deletion hassio/src/system/hassio-supervisor-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ class HassioSupervisorLog extends LitElement {
this._error = undefined;

try {
this._content = await fetchHassioLogs(
const response = await fetchHassioLogs(
this.hass,
this._selectedLogProvider
);

this._content = await response.text();
} catch (err: any) {
this._error = this.supervisor.localize("system.log.get_logs", {
provider: this._selectedLogProvider,
Expand Down
Loading
Loading