diff --git a/src/panels/developer-tools/info/developer-tools-info.ts b/src/panels/developer-tools/info/developer-tools-info.ts index 7141d4b132..dc9b45ec53 100644 --- a/src/panels/developer-tools/info/developer-tools-info.ts +++ b/src/panels/developer-tools/info/developer-tools-info.ts @@ -11,6 +11,7 @@ import { HomeAssistant } from "../../../types"; import { haStyle } from "../../../resources/styles"; import "./system-health-card"; +import "./integrations-card"; const JS_TYPE = __BUILD__; const JS_VERSION = __VERSION__; @@ -149,6 +150,7 @@ class HaPanelDevInfo extends LitElement {
+
`; } @@ -205,7 +207,8 @@ class HaPanelDevInfo extends LitElement { color: var(--dark-primary-color); } - system-health-card { + system-health-card, + integrations-card { display: block; max-width: 600px; margin: 0 auto; diff --git a/src/panels/developer-tools/info/integrations-card.ts b/src/panels/developer-tools/info/integrations-card.ts new file mode 100644 index 0000000000..e51f73366a --- /dev/null +++ b/src/panels/developer-tools/info/integrations-card.ts @@ -0,0 +1,75 @@ +import { + LitElement, + property, + TemplateResult, + html, + customElement, + CSSResult, + css, +} from "lit-element"; +import { HomeAssistant } from "../../../types"; +import memoizeOne from "memoize-one"; + +@customElement("integrations-card") +class IntegrationsCard extends LitElement { + @property() public hass!: HomeAssistant; + + private _sortedIntegrations = memoizeOne((components: string[]) => { + return components.filter((comp) => !comp.includes(".")).sort(); + }); + + protected render(): TemplateResult { + return html` + + + + ${this._sortedIntegrations(this.hass!.config.components).map( + (domain) => html` + + + + + + ` + )} + +
${domain} + + Documentation + + + + Issues + +
+
+ `; + } + + static get styles(): CSSResult { + return css` + td { + line-height: 2em; + padding: 0 8px; + } + td:first-child { + padding-left: 0; + } + a { + color: var(--primary-color); + } + `; + } +} + +declare global { + interface HTMLElementTagNameMap { + "integrations-card": IntegrationsCard; + } +} diff --git a/src/panels/developer-tools/info/system-health-card.ts b/src/panels/developer-tools/info/system-health-card.ts index 35e1976d9e..92bef82cf6 100644 --- a/src/panels/developer-tools/info/system-health-card.ts +++ b/src/panels/developer-tools/info/system-health-card.ts @@ -78,7 +78,7 @@ class SystemHealthCard extends LitElement { } return html` - +
${sections}
`;