From 96d220468e2ed9acb7b8fc68fd9100f6b4f8d22c Mon Sep 17 00:00:00 2001 From: Zack Arnett Date: Sun, 6 Sep 2020 01:43:05 -0500 Subject: [PATCH] comments --- .../config/dashboard/ha-config-dashboard.ts | 72 ++++++++++++------- src/panels/config/ha-panel-config.ts | 44 ++++++------ src/panels/config/info/ha-config-info.ts | 8 +-- src/panels/config/logs/system-log-card.ts | 10 ++- 4 files changed, 80 insertions(+), 54 deletions(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 95e38fa0d9..2d51fef1de 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -10,6 +10,7 @@ import { property, TemplateResult, } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-card"; import "../../../components/ha-icon-next"; @@ -37,7 +38,7 @@ class HaConfigDashboard extends LitElement { protected render(): TemplateResult { const content = html` - +
${this.hass.localize("ui.panel.config.header")}
@@ -46,36 +47,38 @@ class HaConfigDashboard extends LitElement { ${this.hass.localize("ui.panel.config.introduction")} - ${this.cloudStatus && isComponentLoaded(this.hass, "cloud") - ? html` +
+ ${this.cloudStatus && isComponentLoaded(this.hass, "cloud") + ? html` + + + + ` + : ""} + ${Object.values(configSections).map( + (section) => html` ` - : ""} - ${Object.values(configSections).map( - (section) => html` - - - - ` - )} + )} +
${isComponentLoaded(this.hass, "zha") ? html`
@@ -174,6 +177,27 @@ class HaConfigDashboard extends LitElement { .promo-advanced a { color: var(--secondary-text-color); } + + .content { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + margin: 0; + } + + .content > * { + width: calc(50% - 12px); + margin: 12px 0; + align-self: flex-start; + } + + .cloud { + width: 100%; + } + + .narrow.content > * { + width: 100%; + } `, ]; } diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index 1857338ac7..af1432758c 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -1,10 +1,30 @@ +import { + mdiAccount, + mdiBadgeAccountHorizontal, + mdiDevices, + mdiHomeAssistant, + mdiInformation, + mdiMapMarkerRadius, + mdiMathLog, + mdiNfcVariant, + mdiPalette, + mdiPencil, + mdiPuzzle, + mdiRobot, + mdiScriptText, + mdiServer, + mdiShape, + mdiSofa, + mdiTools, + mdiViewDashboard, +} from "@mdi/js"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { PolymerElement } from "@polymer/polymer"; import { customElement, - property, internalProperty, + property, PropertyValues, } from "lit-element"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; @@ -14,26 +34,6 @@ import "../../layouts/hass-loading-screen"; import { HassRouterPage, RouterOptions } from "../../layouts/hass-router-page"; import { PageNavigation } from "../../layouts/hass-tabs-subpage"; import { HomeAssistant, Route } from "../../types"; -import { - mdiPuzzle, - mdiDevices, - mdiShape, - mdiSofa, - mdiRobot, - mdiPalette, - mdiScriptText, - mdiTools, - mdiViewDashboard, - mdiAccount, - mdiMapMarkerRadius, - mdiBadgeAccountHorizontal, - mdiHomeAssistant, - mdiServer, - mdiInformation, - mdiMathLog, - mdiPencil, - mdiNfcVariant, -} from "@mdi/js"; declare global { // for fire event @@ -167,8 +167,6 @@ export const configSections: { [name: string]: PageNavigation[] } = { iconPath: mdiInformation, core: true, }, - ], - advanced: [ { component: "customize", path: "/config/customize", diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index 178b8ca0ae..ce3156f055 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -6,12 +6,12 @@ import { property, TemplateResult, } from "lit-element"; +import "../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { configSections } from "../ha-panel-config"; import "./integrations-card"; import "./system-health-card"; -import { configSections } from "../ha-panel-config"; -import "../../../layouts/hass-tabs-subpage"; const JS_TYPE = __BUILD__; const JS_VERSION = __VERSION__; @@ -93,10 +93,10 @@ class HaConfigInfo extends LitElement { >Python 3, PolymerLitElement, ${this.hass.localize("ui.panel.config.info.icons_by")}