Config menu updates to get it ready for nightly (#12368)

This commit is contained in:
Zack Barett 2022-04-20 17:38:35 -05:00 committed by GitHub
parent cabe10ffdb
commit d290c11219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 126 additions and 117 deletions

View File

@ -55,7 +55,6 @@ export class HaClickableListItem extends ListItemBase {
align-items: center; align-items: center;
padding-left: var(--mdc-list-side-padding, 20px); padding-left: var(--mdc-list-side-padding, 20px);
padding-right: var(--mdc-list-side-padding, 20px); padding-right: var(--mdc-list-side-padding, 20px);
font-weight: 500;
} }
`, `,
]; ];

View File

@ -254,7 +254,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
}, },
{ {
component: "zone", component: "zone",
path: "/config/location", path: "/config/zone",
translationKey: "ui.panel.config.zone.caption", translationKey: "ui.panel.config.zone.caption",
iconPath: mdiMapMarkerRadius, iconPath: mdiMapMarkerRadius,
iconColor: "#E48629", iconColor: "#E48629",
@ -436,6 +436,10 @@ class HaPanelConfig extends HassRouterPage {
tag: "ha-config-helpers", tag: "ha-config-helpers",
load: () => import("./helpers/ha-config-helpers"), load: () => import("./helpers/ha-config-helpers"),
}, },
server_control: {
tag: "ha-config-server-control",
load: () => import("./server_control/ha-config-server-control"),
},
storage: { storage: {
tag: "ha-config-section-storage", tag: "ha-config-section-storage",
load: () => import("./core/ha-config-section-storage"), load: () => import("./core/ha-config-section-storage"),
@ -444,7 +448,7 @@ class HaPanelConfig extends HassRouterPage {
tag: "ha-config-users", tag: "ha-config-users",
load: () => import("./users/ha-config-users"), load: () => import("./users/ha-config-users"),
}, },
location: { zone: {
tag: "ha-config-zone", tag: "ha-config-zone",
load: () => import("./zone/ha-config-zone"), load: () => import("./zone/ha-config-zone"),
}, },

View File

@ -1,11 +1,10 @@
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { property } from "lit/decorators"; import { property } from "lit/decorators";
import "../../../components/ha-logo-svg"; import "../../../components/ha-logo-svg";
import "../../../layouts/hass-tabs-subpage"; import "../../../layouts/hass-subpage";
import { haStyle } from "../../../resources/styles"; import { haStyle } from "../../../resources/styles";
import { HomeAssistant, Route } from "../../../types"; import { HomeAssistant, Route } from "../../../types";
import { documentationUrl } from "../../../util/documentation-url"; import { documentationUrl } from "../../../util/documentation-url";
import { configSections } from "../ha-panel-config";
import "./integrations-card"; import "./integrations-card";
import "./system-health-card"; import "./system-health-card";
@ -29,12 +28,11 @@ class HaConfigInfo extends LitElement {
(window as any).CUSTOM_UI_LIST || []; (window as any).CUSTOM_UI_LIST || [];
return html` return html`
<hass-tabs-subpage <hass-subpage
.hass=${this.hass} .hass=${this.hass}
.narrow=${this.narrow} .narrow=${this.narrow}
back-path="/config" back-path="/config"
.route=${this.route} .header=${this.hass.localize("ui.panel.config.info.caption")}
.tabs=${configSections.about}
> >
<div class="about"> <div class="about">
<a <a
@ -113,21 +111,23 @@ class HaConfigInfo extends LitElement {
"type", "type",
JS_TYPE JS_TYPE
)} )}
${customUiList.length > 0 ${
customUiList.length > 0
? html` ? html`
<div> <div>
${this.hass.localize("ui.panel.config.info.custom_uis")} ${this.hass.localize("ui.panel.config.info.custom_uis")}
${customUiList.map( ${customUiList.map(
(item) => html` (item) => html`
<div> <div>
<a href=${item.url} target="_blank"> ${item.name}</a>: <a href=${item.url} target="_blank"> ${item.name}</a
${item.version} >: ${item.version}
</div> </div>
` `
)} )}
</div> </div>
` `
: ""} : ""
}
</p> </p>
</div> </div>
<div> <div>

View File

@ -18,13 +18,13 @@ import "../ha-config-section";
export class HaConfigServerControl extends LitElement { export class HaConfigServerControl extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@property() public isWide!: boolean; @property({ type: Boolean }) public isWide!: boolean;
@property() public narrow!: boolean; @property({ type: Boolean }) public narrow!: boolean;
@property() public route!: Route; @property({ attribute: false }) public route!: Route;
@property() public showAdvanced!: boolean; @property({ type: Boolean }) public showAdvanced!: boolean;
@state() private _validating = false; @state() private _validating = false;
@ -54,21 +54,12 @@ export class HaConfigServerControl extends LitElement {
.narrow=${this.narrow} .narrow=${this.narrow}
back-path="/config/system" back-path="/config/system"
.showAdvanced=${this.showAdvanced} .showAdvanced=${this.showAdvanced}
.header=${this.hass.localize("ui.panel.config.server_control.caption")}
> >
<ha-config-section .isWide=${this.isWide}> <div class="content">
<span slot="header"
>${this.hass.localize(
"ui.panel.config.server_control.caption"
)}</span
>
<span slot="introduction"
>${this.hass.localize(
"ui.panel.config.server_control.description"
)}</span
>
${this.showAdvanced ${this.showAdvanced
? html` <ha-card ? html`
<ha-card
header=${this.hass.localize( header=${this.hass.localize(
"ui.panel.config.server_control.section.validation.heading" "ui.panel.config.server_control.section.validation.heading"
)} )}
@ -128,7 +119,8 @@ export class HaConfigServerControl extends LitElement {
</div> </div>
`} `}
</div> </div>
</ha-card>` </ha-card>
`
: ""} : ""}
<ha-card <ha-card
@ -181,7 +173,8 @@ export class HaConfigServerControl extends LitElement {
</div> </div>
${this._reloadableDomains.map( ${this._reloadableDomains.map(
(domain) => (domain) =>
html`<div class="card-actions"> html`
<div class="card-actions">
<ha-call-service-button <ha-call-service-button
.hass=${this.hass} .hass=${this.hass}
.domain=${domain} .domain=${domain}
@ -195,12 +188,13 @@ export class HaConfigServerControl extends LitElement {
domainToName(this.hass.localize, domain) domainToName(this.hass.localize, domain)
)} )}
</ha-call-service-button> </ha-call-service-button>
</div>` </div>
`
)} )}
</ha-card> </ha-card>
` `
: ""} : ""}
</ha-config-section> </div>
</hass-subpage> </hass-subpage>
`; `;
} }
@ -251,10 +245,22 @@ export class HaConfigServerControl extends LitElement {
direction: ltr; direction: ltr;
} }
ha-config-section { .content {
padding-bottom: 24px; padding: 28px 20px 0;
max-width: 1040px;
margin: 0 auto;
}
ha-card {
margin-top: 24px;
} }
`, `,
]; ];
} }
} }
declare global {
interface HTMLElementTagNameMap {
"ha-config-server-control": HaConfigServerControl;
}
}