mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 14:56:37 +00:00
20241031.0 (#22613)
This commit is contained in:
commit
deb077b5e9
@ -374,6 +374,9 @@ export class HassioBackups extends LitElement {
|
||||
haStyle,
|
||||
hassioStyle,
|
||||
css`
|
||||
:host {
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
.table-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
@ -120,9 +120,6 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
</div>
|
||||
<div class="delete" slot="end">
|
||||
<ha-icon-button
|
||||
.label=${this._dialogParams!.supervisor.localize(
|
||||
"dialog.repositories.remove"
|
||||
)}
|
||||
.disabled=${usedRepositories.includes(repo.slug)}
|
||||
.slug=${repo.slug}
|
||||
.path=${usedRepositories.includes(repo.slug)
|
||||
@ -146,7 +143,11 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
</ha-md-list-item>
|
||||
`
|
||||
)
|
||||
: html`<ha-md-list-item> No repositories </ha-md-list-item>`}
|
||||
: html`<ha-md-list-item
|
||||
>${this._dialogParams!.supervisor.localize(
|
||||
"dialog.repositories.no_repositories"
|
||||
)}</ha-md-list-item
|
||||
>`}
|
||||
</ha-md-list>
|
||||
<div class="layout horizontal bottom">
|
||||
<ha-textfield
|
||||
@ -212,6 +213,7 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
}
|
||||
ha-md-list-item {
|
||||
position: relative;
|
||||
--md-item-overflow: visible;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
@ -98,7 +98,7 @@
|
||||
"@webcomponents/scoped-custom-element-registry": "0.0.9",
|
||||
"@webcomponents/webcomponentsjs": "2.8.0",
|
||||
"app-datepicker": "5.1.1",
|
||||
"chart.js": "4.4.5",
|
||||
"chart.js": "4.4.6",
|
||||
"color-name": "2.0.0",
|
||||
"comlink": "4.4.1",
|
||||
"core-js": "3.38.1",
|
||||
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20241030.0"
|
||||
version = "20241031.0"
|
||||
license = {text = "Apache-2.0"}
|
||||
description = "The Home Assistant frontend"
|
||||
readme = "README.md"
|
||||
|
@ -25,7 +25,6 @@ export class HaBadge extends LitElement {
|
||||
static get styles(): CSSResultGroup {
|
||||
return css`
|
||||
:host {
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
@ -36,11 +35,10 @@ export class HaBadge extends LitElement {
|
||||
white-space: nowrap;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
font-family: Roboto;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
color: var(--ha-heading-badge-text-color, var(--secondary-text-color));
|
||||
font-size: var(--ha-heading-badge-font-size, 14px);
|
||||
font-weight: var(--ha-heading-badge-font-weight, 400);
|
||||
line-height: var(--ha-heading-badge-line-height, 20px);
|
||||
letter-spacing: 0.1px;
|
||||
--mdc-icon-size: 14px;
|
||||
}
|
||||
|
@ -15,6 +15,9 @@ export class HaMdListItem extends MdListItem {
|
||||
--md-sys-color-on-surface: var(--primary-text-color);
|
||||
--md-sys-color-on-surface-variant: var(--secondary-text-color);
|
||||
}
|
||||
md-item {
|
||||
overflow: var(--md-item-overflow, hidden);
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
@ -203,6 +203,20 @@ export const fetchHassioLogs = async (
|
||||
);
|
||||
|
||||
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 fetchHassioLogsBootFollow = async (
|
||||
hass: HomeAssistant,
|
||||
provider: string,
|
||||
signal: AbortSignal,
|
||||
@ -222,7 +236,12 @@ export const getHassioLogDownloadUrl = (provider: string) =>
|
||||
provider.includes("_") ? `addons/${provider}` : provider
|
||||
}/logs`;
|
||||
|
||||
export const getHassioLogDownloadLinesUrl = (
|
||||
export const getHassioLogDownloadLinesUrl = (provider: string, lines: number) =>
|
||||
`/api/hassio/${
|
||||
provider.includes("_") ? `addons/${provider}` : provider
|
||||
}/logs?lines=${lines}`;
|
||||
|
||||
export const getHassioLogBootDownloadLinesUrl = (
|
||||
provider: string,
|
||||
lines: number,
|
||||
boot = 0
|
||||
|
@ -28,7 +28,7 @@ export interface UrlActionConfig extends BaseActionConfig {
|
||||
|
||||
export interface MoreInfoActionConfig extends BaseActionConfig {
|
||||
action: "more-info";
|
||||
entity_id?: string;
|
||||
entity?: string;
|
||||
}
|
||||
|
||||
export interface AssistActionConfig extends BaseActionConfig {
|
||||
|
@ -371,11 +371,13 @@ export class HaTabsSubpageDataTable extends LitElement {
|
||||
</div>
|
||||
</ha-md-menu-item>
|
||||
</ha-md-button-menu>
|
||||
<p>
|
||||
${localize("ui.components.subpage-data-table.selected", {
|
||||
selected: this.selected || "0",
|
||||
})}
|
||||
</p>
|
||||
${this.selected !== undefined
|
||||
? html`<p>
|
||||
${localize("ui.components.subpage-data-table.selected", {
|
||||
selected: this.selected || "0",
|
||||
})}
|
||||
</p>`
|
||||
: nothing}
|
||||
</div>
|
||||
<div class="center-vertical">
|
||||
<slot name="selection-bar"></slot>
|
||||
|
@ -14,7 +14,10 @@ import type { DownloadLogsDialogParams } from "./show-dialog-download-logs";
|
||||
import "../../../components/ha-select";
|
||||
import "../../../components/ha-list-item";
|
||||
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
||||
import { getHassioLogDownloadLinesUrl } from "../../../data/hassio/supervisor";
|
||||
import {
|
||||
getHassioLogDownloadLinesUrl,
|
||||
getHassioLogBootDownloadLinesUrl,
|
||||
} from "../../../data/hassio/supervisor";
|
||||
import { getSignedPath } from "../../../data/auth";
|
||||
import { fileDownload } from "../../../util/file_download";
|
||||
|
||||
@ -112,7 +115,7 @@ class DownloadLogsDialog extends LitElement {
|
||||
const boot = this._dialogParams!.boot;
|
||||
|
||||
const timeString = new Date().toISOString().replace(/:/g, "-");
|
||||
const downloadUrl = getHassioLogDownloadLinesUrl(
|
||||
const downloadUrl = this._getDownloadUrlFunction()(
|
||||
provider,
|
||||
this._lineCount,
|
||||
boot
|
||||
@ -126,6 +129,13 @@ class DownloadLogsDialog extends LitElement {
|
||||
this.closeDialog();
|
||||
}
|
||||
|
||||
private _getDownloadUrlFunction() {
|
||||
if (this._dialogParams!.boot === 0) {
|
||||
return getHassioLogDownloadLinesUrl;
|
||||
}
|
||||
return getHassioLogBootDownloadLinesUrl;
|
||||
}
|
||||
|
||||
private _setNumberOfLogs(ev) {
|
||||
this._lineCount = Number(ev.target.value);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import { extractApiErrorMessage } from "../../../data/hassio/common";
|
||||
import {
|
||||
fetchHassioBoots,
|
||||
fetchHassioLogs,
|
||||
fetchHassioLogsBootFollow,
|
||||
fetchHassioLogsFollow,
|
||||
getHassioLogDownloadUrl,
|
||||
} from "../../../data/hassio/supervisor";
|
||||
@ -378,7 +379,7 @@ class ErrorLogCard extends LitElement {
|
||||
isComponentLoaded(this.hass, "hassio") &&
|
||||
this.provider
|
||||
) {
|
||||
const response = await fetchHassioLogsFollow(
|
||||
const response = await this._fetchLogsFunction()(
|
||||
this.hass,
|
||||
this.provider,
|
||||
this._logStreamAborter.signal,
|
||||
@ -468,6 +469,13 @@ class ErrorLogCard extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
private _fetchLogsFunction = () => {
|
||||
if (this._boot === 0) {
|
||||
return fetchHassioLogsFollow;
|
||||
}
|
||||
return fetchHassioLogsBootFollow;
|
||||
};
|
||||
|
||||
private _debounceSearch = debounce(() => {
|
||||
this._noSearchResults = !this._ansiToHtmlElement?.filterLines(this.filter);
|
||||
|
||||
@ -570,9 +578,14 @@ class ErrorLogCard extends LitElement {
|
||||
if (this._streamSupported && isComponentLoaded(this.hass, "hassio")) {
|
||||
try {
|
||||
const { data } = await fetchHassioBoots(this.hass);
|
||||
this._boots = Object.keys(data.boots)
|
||||
const boots = Object.keys(data.boots)
|
||||
.map(Number)
|
||||
.sort((a, b) => b - a);
|
||||
|
||||
// only show boots select when there are more than one boot
|
||||
if (boots.length > 1) {
|
||||
this._boots = boots;
|
||||
}
|
||||
} catch (err: any) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
|
@ -86,10 +86,11 @@ export class HuiCard extends ReactiveElement {
|
||||
return this._element.getGridOptions();
|
||||
}
|
||||
if (this._element.getLayoutOptions) {
|
||||
// Disabled for now to avoid spamming the console, need to be re-enabled when hui-card performance are fixed
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
`This card (${this.config?.type}) is using "getLayoutOptions" and it is deprecated, contact the developer to suggest to use "getGridOptions" instead`
|
||||
);
|
||||
// console.warn(
|
||||
// `This card (${this.config?.type}) is using "getLayoutOptions" and it is deprecated, contact the developer to suggest to use "getGridOptions" instead`
|
||||
// );
|
||||
const options = migrateLayoutToGridOptions(
|
||||
this._element.getLayoutOptions()
|
||||
);
|
||||
|
@ -95,7 +95,7 @@ export const handleAction = async (
|
||||
switch (actionConfig.action) {
|
||||
case "more-info": {
|
||||
const entityId =
|
||||
actionConfig.entity_id ||
|
||||
actionConfig.entity ||
|
||||
config.entity ||
|
||||
config.camera_image ||
|
||||
config.image_entity;
|
||||
|
@ -63,7 +63,7 @@ const actionConfigStructAssist = type({
|
||||
|
||||
const actionConfigStructMoreInfo = type({
|
||||
action: literal("more-info"),
|
||||
entity_id: optional(string()),
|
||||
entity: optional(string()),
|
||||
});
|
||||
|
||||
export const actionConfigStructType = object({
|
||||
|
@ -7774,7 +7774,8 @@
|
||||
"title": "Manage add-on repositories",
|
||||
"add": "Add",
|
||||
"remove": "Remove",
|
||||
"used": "Repository is in use for installed add-ons and can't be removed."
|
||||
"used": "Repository is in use for installed add-ons and can't be removed.",
|
||||
"no_repositories": "No repositories"
|
||||
},
|
||||
"restart_addon": {
|
||||
"title": "Restart {name}?",
|
||||
@ -7814,6 +7815,37 @@
|
||||
"cancel": "[%key:ui::common::cancel%]",
|
||||
"move": "Move"
|
||||
}
|
||||
},
|
||||
"ui": {
|
||||
"components": {
|
||||
"subpage-data-table": {
|
||||
"filters": "[%key:ui::components::subpage-data-table::filters%]",
|
||||
"show_results": "[%key:ui::components::subpage-data-table::show_results%]",
|
||||
"clear_filter": "[%key:ui::components::subpage-data-table::clear_filter%]",
|
||||
"close_filter": "[%key:ui::components::subpage-data-table::close_filter%]",
|
||||
"exit_selection_mode": "[%key:ui::components::subpage-data-table::exit_selection_mode%]",
|
||||
"enter_selection_mode": "[%key:ui::components::subpage-data-table::enter_selection_mode%]",
|
||||
"sort_by": "[%key:ui::components::subpage-data-table::sort_by%]",
|
||||
"group_by": "[%key:ui::components::subpage-data-table::group_by%]",
|
||||
"dont_group_by": "[%key:ui::components::subpage-data-table::dont_group_by%]",
|
||||
"collapse_all_groups": "[%key:ui::components::subpage-data-table::collapse_all_groups%]",
|
||||
"expand_all_groups": "[%key:ui::components::subpage-data-table::expand_all_groups%]",
|
||||
"select": "[%key:ui::components::subpage-data-table::select%]",
|
||||
"selected": "[%key:ui::components::subpage-data-table::selected%]",
|
||||
"select_all": "[%key:ui::components::subpage-data-table::select_all%]",
|
||||
"select_none": "[%key:ui::components::subpage-data-table::select_none%]",
|
||||
"settings": "[%key:ui::components::subpage-data-table::settings%]"
|
||||
},
|
||||
"data-table": {
|
||||
"settings": {
|
||||
"header": "[%key:ui::components::data-table::settings::header%]",
|
||||
"hide": "[%key:ui::components::data-table::settings::hide%]",
|
||||
"show": "[%key:ui::components::data-table::settings::show%]",
|
||||
"done": "[%key:ui::components::data-table::settings::done%]",
|
||||
"restore": "[%key:ui::components::data-table::settings::restore%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
10
yarn.lock
10
yarn.lock
@ -6099,12 +6099,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"chart.js@npm:4.4.5":
|
||||
version: 4.4.5
|
||||
resolution: "chart.js@npm:4.4.5"
|
||||
"chart.js@npm:4.4.6":
|
||||
version: 4.4.6
|
||||
resolution: "chart.js@npm:4.4.6"
|
||||
dependencies:
|
||||
"@kurkle/color": "npm:^0.3.0"
|
||||
checksum: 10/def643ed3ae898f3f37a0a59b5f1a36ffaf68c8a4f4392dcfebb6e5872534065d04b5b437b25c2b3065c20799403b4436a356bdd1700727267b3b468fec49f84
|
||||
checksum: 10/50d0c13a16fd8c156784ff5e4c79070f09325147b0ee5c64d6d3a17933dd9072027dbc72c561cdd8aa41183d8e5736ef634c9843767f79e8abcf1fa0fd03543b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -8824,7 +8824,7 @@ __metadata:
|
||||
babel-plugin-template-html-minifier: "npm:4.1.0"
|
||||
browserslist-useragent-regexp: "npm:4.1.3"
|
||||
chai: "npm:5.1.2"
|
||||
chart.js: "npm:4.4.5"
|
||||
chart.js: "npm:4.4.6"
|
||||
color-name: "npm:2.0.0"
|
||||
comlink: "npm:4.4.1"
|
||||
core-js: "npm:3.38.1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user