Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 47 additions & 17 deletions src/panels/developer-tools/info/developer-tools-info.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ class HaPanelDevInfo extends LitElement {

const nonDefaultLinkText =
localStorage.defaultPage === OPT_IN_PANEL && OPT_IN_PANEL === "states"
? "Go to the Lovelace UI"
: "Go to the states UI";

const defaultPageText = `${
localStorage.defaultPage === OPT_IN_PANEL ? "Remove" : "Set"
} ${OPT_IN_PANEL} as default page on this device`;
? this.hass.localize("ui.panel.developer-tools.tabs.info.lovelace_ui")
: this.hass.localize("ui.panel.developer-tools.tabs.info.states_ui");

const defaultPageText = `${this.hass.localize(
"ui.panel.developer-tools.tabs.info.default_ui",
"action",
localStorage.defaultPage === OPT_IN_PANEL
? this.hass.localize("ui.panel.developer-tools.tabs.info.remove")
: this.hass.localize("ui.panel.developer-tools.tabs.info.set"),
"name",
OPT_IN_PANEL
)}`;

return html`
<div class="about">
Expand All @@ -45,42 +51,58 @@ class HaPanelDevInfo extends LitElement {
><img
src="/static/icons/favicon-192x192.png"
height="192"
alt="Home Assistant logo"
alt="${this.hass.localize(
"ui.panel.developer-tools.tabs.info.home_assistant_logo"
)}"
/></a>
<br />
<h2>Home Assistant ${hass.config.version}</h2>
</p>
<p>
Path to configuration.yaml: ${hass.config.config_dir}
${this.hass.localize(
"ui.panel.developer-tools.tabs.info.path_configuration",
"path",
hass.config.config_dir
)}
</p>
<p class="develop">
<a
href="https://www.home-assistant.io/developers/credits/"
target="_blank"
>
Developed by a bunch of awesome people.
${this.hass.localize(
"ui.panel.developer-tools.tabs.info.developed_by"
)}
</a>
</p>
<p>
Published under the Apache 2.0 license<br />
Source:
${this.hass.localize(
"ui.panel.developer-tools.tabs.info.license"
)}<br />
${this.hass.localize("ui.panel.developer-tools.tabs.info.source")}
<a
href="https://github.com/home-assistant/home-assistant"
target="_blank"
>server</a
>${this.hass.localize(
"ui.panel.developer-tools.tabs.info.server"
)}</a
>
&mdash;
<a
href="https://github.com/home-assistant/home-assistant-polymer"
target="_blank"
>frontend-ui</a
>${this.hass.localize(
"ui.panel.developer-tools.tabs.info.frontend"
)}</a
>
</p>
<p>
Built using
${this.hass.localize(
"ui.panel.developer-tools.tabs.info.built_using"
)}
<a href="https://www.python.org">Python 3</a>,
<a href="https://www.polymer-project.org" target="_blank">Polymer</a>,
Icons by
${this.hass.localize("ui.panel.developer-tools.tabs.info.icons_by")}
<a href="https://www.google.com/design/icons/" target="_blank"
>Google</a
>
Expand All @@ -90,12 +112,20 @@ class HaPanelDevInfo extends LitElement {
>.
</p>
<p>
Frontend version: ${JS_VERSION} - ${JS_TYPE}
${this.hass.localize(
"ui.panel.developer-tools.tabs.info.frontend_version",
"version",
JS_VERSION,
"type",
JS_TYPE
)}
${
customUiList.length > 0
? html`
<div>
Custom UIs:
${this.hass.localize(
"ui.panel.developer-tools.tabs.info.custom_uis"
)}
${customUiList.map(
(item) => html`
<div>
Expand Down
9 changes: 5 additions & 4 deletions src/panels/developer-tools/info/system-health-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const sortKeys = (a: string, b: string) => {
};

class SystemHealthCard extends LitElement {
@property() public hass?: HomeAssistant;
@property() public hass!: HomeAssistant;
@property() private _info?: SystemHealthInfo;

protected render(): TemplateResult | void {
Expand Down Expand Up @@ -78,7 +78,7 @@ class SystemHealthCard extends LitElement {
}

return html`
<ha-card header="System Health">
<ha-card header="${this.hass.localize("domain.system_health")}">
<div class="card-content">${sections}</div>
</ha-card>
`;
Expand All @@ -98,8 +98,9 @@ class SystemHealthCard extends LitElement {
} catch (err) {
this._info = {
system_health: {
error:
"System Health component is not loaded. Add 'system_health:' to configuration.yaml",
error: this.hass.localize(
"ui.panel.developer-tools.tabs.info.system_health_error"
),
},
};
}
Expand Down
19 changes: 18 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,24 @@
"developer-tools": {
"tabs": {
"info": {
"title": "Info"
"title": "Info",
"remove": "Remove",
"set": "Set",
"default_ui": "{action} {name} as default page on this device",
"lovelace_ui": "Go to the Lovelace UI",
"states_ui": "Go to the states UI",
"home_assistant_logo": "Home Assistant logo",
"path_configuration": "Path to configuration.yaml: {path}",
"developed_by": "Developed by a bunch of awesome people.",
"license": "Published under the Apache 2.0 license",
"source": "Source:",
"server": "server",
"frontend": "frontend-ui",
"built_using": "Built using",
"icons_by": "Icons by",
"frontend_version": "Frontend version: {version} - {type}",
"custom_uis": "Custom UIs:",
"system_health_error": "System Health component is not loaded. Add 'system_health:' to configuration.yaml"
},
"logs": {
"title": "Logs",
Expand Down