mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 14:56:37 +00:00
Move refresh logs button to top (#15382)
This commit is contained in:
parent
7e92d62936
commit
1550895d86
@ -36,6 +36,8 @@ class ErrorLogCard extends LitElement {
|
|||||||
|
|
||||||
@property() public filter = "";
|
@property() public filter = "";
|
||||||
|
|
||||||
|
@property() public header?: string;
|
||||||
|
|
||||||
@property() public provider!: string;
|
@property() public provider!: string;
|
||||||
|
|
||||||
@property({ type: Boolean, attribute: true }) public show = false;
|
@property({ type: Boolean, attribute: true }) public show = false;
|
||||||
@ -56,9 +58,10 @@ class ErrorLogCard extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<ha-card outlined>
|
<ha-card outlined>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2>
|
<h1 class="card-header">
|
||||||
${this.hass.localize("ui.panel.config.logs.show_full_logs")}
|
${this.header ||
|
||||||
</h2>
|
this.hass.localize("ui.panel.config.logs.show_full_logs")}
|
||||||
|
</h1>
|
||||||
<div>
|
<div>
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
.path=${mdiRefresh}
|
.path=${mdiRefresh}
|
||||||
@ -225,10 +228,26 @@ class ErrorLogCard extends LitElement {
|
|||||||
margin: 16px;
|
margin: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ha-card {
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 16px;
|
padding: 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
color: var(--ha-card-header-color, --primary-text-color);
|
||||||
|
font-family: var(--ha-card-header-font-family, inherit);
|
||||||
|
font-size: var(--ha-card-header-font-size, 24px);
|
||||||
|
letter-spacing: -0.012em;
|
||||||
|
line-height: 48px;
|
||||||
|
display: block;
|
||||||
|
margin-block-start: 0px;
|
||||||
|
margin-block-end: 0px;
|
||||||
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-select {
|
ha-select {
|
||||||
|
@ -147,12 +147,18 @@ export class HaConfigLogs extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<system-log-card
|
<system-log-card
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
.header=${this._logProviders.find(
|
||||||
|
(p) => p.key === this._selectedLogProvider
|
||||||
|
)!.name}
|
||||||
.filter=${this._filter}
|
.filter=${this._filter}
|
||||||
></system-log-card>
|
></system-log-card>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
<error-log-card
|
<error-log-card
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
.header=${this._logProviders.find(
|
||||||
|
(p) => p.key === this._selectedLogProvider
|
||||||
|
)!.name}
|
||||||
.filter=${this._filter}
|
.filter=${this._filter}
|
||||||
.provider=${this._selectedLogProvider}
|
.provider=${this._selectedLogProvider}
|
||||||
.show=${this._selectedLogProvider !== "core"}
|
.show=${this._selectedLogProvider !== "core"}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { mdiRefresh } from "@mdi/js";
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
@ -25,6 +26,8 @@ export class SystemLogCard extends LitElement {
|
|||||||
|
|
||||||
@property() public filter = "";
|
@property() public filter = "";
|
||||||
|
|
||||||
|
@property() public header?: string;
|
||||||
|
|
||||||
public loaded = false;
|
public loaded = false;
|
||||||
|
|
||||||
@state() private _items?: LoggedError[];
|
@state() private _items?: LoggedError[];
|
||||||
@ -83,6 +86,14 @@ export class SystemLogCard extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
|
<div class="header">
|
||||||
|
<h1 class="card-header">${this.header || "Logs"}</h1>
|
||||||
|
<ha-icon-button
|
||||||
|
.path=${mdiRefresh}
|
||||||
|
@click=${this.fetchData}
|
||||||
|
.label=${this.hass.localize("ui.common.refresh")}
|
||||||
|
></ha-icon-button>
|
||||||
|
</div>
|
||||||
${this._items.length === 0
|
${this._items.length === 0
|
||||||
? html`
|
? html`
|
||||||
<div class="card-content empty-content">
|
<div class="card-content empty-content">
|
||||||
@ -139,11 +150,6 @@ export class SystemLogCard extends LitElement {
|
|||||||
"ui.panel.config.logs.clear"
|
"ui.panel.config.logs.clear"
|
||||||
)}</ha-call-service-button
|
)}</ha-call-service-button
|
||||||
>
|
>
|
||||||
<ha-progress-button @click=${this.fetchData}
|
|
||||||
>${this.hass.localize(
|
|
||||||
"ui.panel.config.logs.refresh"
|
|
||||||
)}</ha-progress-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
</ha-card>
|
</ha-card>
|
||||||
@ -181,6 +187,24 @@ export class SystemLogCard extends LitElement {
|
|||||||
padding-top: 16px;
|
padding-top: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
color: var(--ha-card-header-color, --primary-text-color);
|
||||||
|
font-family: var(--ha-card-header-font-family, inherit);
|
||||||
|
font-size: var(--ha-card-header-font-size, 24px);
|
||||||
|
letter-spacing: -0.012em;
|
||||||
|
line-height: 48px;
|
||||||
|
display: block;
|
||||||
|
margin-block-start: 0px;
|
||||||
|
margin-block-end: 0px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
paper-item {
|
paper-item {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user