mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-13 13:00:24 +00:00
Compare commits
2 Commits
copilot/fi
...
supervisor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b77ce9fc0e | ||
|
|
bc14d6dfcb |
@@ -1,3 +1,4 @@
|
|||||||
|
import "../components/supervisor-connectivity";
|
||||||
import "@material/mwc-icon-button/mwc-icon-button";
|
import "@material/mwc-icon-button/mwc-icon-button";
|
||||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
import "@material/mwc-list/mwc-list-item";
|
||||||
@@ -133,6 +134,8 @@ class HassioAddonStore extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
<supervisor-connectivity .supervisor=${this.supervisor}>
|
||||||
|
</supervisor-connectivity>
|
||||||
</hass-tabs-subpage>
|
</hass-tabs-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "../components/supervisor-connectivity";
|
||||||
import {
|
import {
|
||||||
mdiCogs,
|
mdiCogs,
|
||||||
mdiFileDocument,
|
mdiFileDocument,
|
||||||
@@ -129,6 +130,8 @@ class HassioAddonDashboard extends LitElement {
|
|||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
.addon=${this.addon}
|
.addon=${this.addon}
|
||||||
></hassio-addon-router>
|
></hassio-addon-router>
|
||||||
|
<supervisor-connectivity .supervisor=${this.supervisor}>
|
||||||
|
</supervisor-connectivity>
|
||||||
</hass-tabs-subpage>
|
</hass-tabs-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -177,8 +180,9 @@ class HassioAddonDashboard extends LitElement {
|
|||||||
const requestedAddon = extractSearchParam("addon");
|
const requestedAddon = extractSearchParam("addon");
|
||||||
if (requestedAddon) {
|
if (requestedAddon) {
|
||||||
const addonsInfo = await fetchHassioAddonsInfo(this.hass);
|
const addonsInfo = await fetchHassioAddonsInfo(this.hass);
|
||||||
const validAddon = addonsInfo.addons
|
const validAddon = addonsInfo.addons.some(
|
||||||
.some((addon) => addon.slug === requestedAddon);
|
(addon) => addon.slug === requestedAddon
|
||||||
|
);
|
||||||
if (!validAddon) {
|
if (!validAddon) {
|
||||||
this._error = this.supervisor.localize("my.error_addon_not_found");
|
this._error = this.supervisor.localize("my.error_addon_not_found");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
54
hassio/src/components/supervisor-connectivity.ts
Normal file
54
hassio/src/components/supervisor-connectivity.ts
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import {
|
||||||
|
css,
|
||||||
|
CSSResult,
|
||||||
|
customElement,
|
||||||
|
html,
|
||||||
|
LitElement,
|
||||||
|
property,
|
||||||
|
TemplateResult,
|
||||||
|
} from "lit-element";
|
||||||
|
import { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||||
|
import { haStyle } from "../../../src/resources/styles";
|
||||||
|
|
||||||
|
@customElement("supervisor-connectivity")
|
||||||
|
class SupervisorConnectivity extends LitElement {
|
||||||
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
if (this.supervisor.network.supervisor_internet) {
|
||||||
|
return html``;
|
||||||
|
}
|
||||||
|
|
||||||
|
return html`<div class="connectivity">
|
||||||
|
<span>${this.supervisor.localize("common.error.lost_connectivity")}</span>
|
||||||
|
</div>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get styles(): CSSResult[] {
|
||||||
|
return [
|
||||||
|
haStyle,
|
||||||
|
css`
|
||||||
|
.connectivity {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
height: 32px;
|
||||||
|
width: 100vw;
|
||||||
|
background-color: var(--error-color);
|
||||||
|
color: var(--primary-text-color);
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"supervisor-connectivity": SupervisorConnectivity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "../components/supervisor-connectivity";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -49,6 +50,8 @@ class HassioDashboard extends LitElement {
|
|||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
></hassio-addons>
|
></hassio-addons>
|
||||||
</div>
|
</div>
|
||||||
|
<supervisor-connectivity .supervisor=${this.supervisor}>
|
||||||
|
</supervisor-connectivity>
|
||||||
</hass-tabs-subpage>
|
</hass-tabs-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "../components/supervisor-connectivity";
|
||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@material/mwc-icon-button";
|
import "@material/mwc-icon-button";
|
||||||
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
import { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||||
@@ -269,6 +270,8 @@ class HassioSnapshots extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<supervisor-connectivity .supervisor=${this.supervisor}>
|
||||||
|
</supervisor-connectivity>
|
||||||
</hass-tabs-subpage>
|
</hass-tabs-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "../components/supervisor-connectivity";
|
||||||
import {
|
import {
|
||||||
css,
|
css,
|
||||||
CSSResult,
|
CSSResult,
|
||||||
@@ -62,6 +63,8 @@ class HassioSystem extends LitElement {
|
|||||||
.supervisor=${this.supervisor}
|
.supervisor=${this.supervisor}
|
||||||
></hassio-supervisor-log>
|
></hassio-supervisor-log>
|
||||||
</div>
|
</div>
|
||||||
|
<supervisor-connectivity .supervisor=${this.supervisor}>
|
||||||
|
</supervisor-connectivity>
|
||||||
</hass-tabs-subpage>
|
</hass-tabs-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ export interface WifiConfiguration {
|
|||||||
export interface NetworkInfo {
|
export interface NetworkInfo {
|
||||||
interfaces: NetworkInterface[];
|
interfaces: NetworkInterface[];
|
||||||
docker: DockerNetwork;
|
docker: DockerNetwork;
|
||||||
|
supervisor_internet: boolean;
|
||||||
|
host_internet: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetchNetworkInfo = async (
|
export const fetchNetworkInfo = async (
|
||||||
|
|||||||
@@ -3618,7 +3618,8 @@
|
|||||||
|
|
||||||
"error": {
|
"error": {
|
||||||
"unknown": "Unknown error",
|
"unknown": "Unknown error",
|
||||||
"update_failed": "Update failed"
|
"update_failed": "Update failed",
|
||||||
|
"lost_connectivity": "The Supervisor has lost connectivity, check the Supervisor logs and your network settings."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"confirm": {
|
"confirm": {
|
||||||
|
|||||||
Reference in New Issue
Block a user