Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing page #22598

Merged
merged 34 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0f542fc
Add landing-page project
wendevlin Oct 21, 2024
6ef7e79
Add landing-page-prepare
wendevlin Oct 21, 2024
3e8d7ef
Add landing-page-network
wendevlin Oct 22, 2024
5d12632
Add logs to landing-page
wendevlin Oct 23, 2024
a662728
Improve landing-page build
wendevlin Oct 23, 2024
677956e
Improve landing-page logs and detail dialogs
wendevlin Oct 24, 2024
f221ac0
Add es5 build for landing-page
wendevlin Oct 29, 2024
31905b7
Add download_full_logs at landing-page
wendevlin Oct 30, 2024
7ea448c
Change dev build for landing-page
wendevlin Oct 30, 2024
10997c7
Fix landing-page build, do it like hassio
wendevlin Nov 4, 2024
67cd512
Remove compress from landing-page build
wendevlin Nov 4, 2024
7776534
Migrate landing-page eslint config
wendevlin Nov 19, 2024
88457d1
Add landing-page project
wendevlin Oct 21, 2024
0963ec1
Add landing-page-prepare
wendevlin Oct 21, 2024
487bc8e
Add landing-page-network
wendevlin Oct 22, 2024
16a2ff3
Add logs to landing-page
wendevlin Oct 23, 2024
6f6d188
Improve landing-page build
wendevlin Oct 23, 2024
7d6986b
Improve landing-page logs and detail dialogs
wendevlin Oct 24, 2024
b86e7a4
Add download_full_logs at landing-page
wendevlin Oct 30, 2024
8081d47
Fix landing-page build, do it like hassio
wendevlin Nov 4, 2024
ba1abed
Remove compress from landing-page build
wendevlin Nov 4, 2024
bb1e86e
Remove .eslintrc from landing-page
wendevlin Nov 19, 2024
37f7b42
Merge branch 'dev' of github.com:home-assistant/frontend into landing…
wendevlin Nov 19, 2024
b4ed00e
Fix landing-page CI translation issue
wendevlin Nov 19, 2024
48886c6
Remove landing-page supervisor logs
wendevlin Nov 19, 2024
dc83b6b
Fix onboarding-welcome-links LocalizeFunc type
wendevlin Nov 19, 2024
51978f8
Add landing-page log streaming
wendevlin Nov 20, 2024
5c0dbaf
Fix landing-page-logs error-check regex - github-advanced-security
wendevlin Nov 20, 2024
3b3a32f
Add landing-page dns error alert, improve try catch
wendevlin Nov 20, 2024
9aef546
Fix landing-page keep show installer when _getNetworkInfoError
wendevlin Nov 20, 2024
87ad9fd
Fix landing-page download logs
wendevlin Nov 20, 2024
1989850
Use observer logs for download in landing-page
wendevlin Nov 20, 2024
8ad6873
Add error message to landing-page dns set fail
wendevlin Nov 20, 2024
9106d26
Remove unused _observerFallback
wendevlin Nov 20, 2024
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
45 changes: 26 additions & 19 deletions landing-page/src/components/landing-page-network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
setSupervisorNetworkDns,
} from "../data/supervisor";
import { fireEvent } from "../../../src/common/dom/fire_event";
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";

const SCHEDULE_FETCH_NETWORK_INFO_SECONDS = 5;

Expand Down Expand Up @@ -93,34 +94,36 @@ class LandingPageNetwork extends LitElement {
}

private async _fetchSupervisorInfo() {
let data;
try {
const response = await getSupervisorNetworkInfo();
if (!response.ok) {
throw new Error("Failed to fetch network info");
bramkragten marked this conversation as resolved.
Show resolved Hide resolved
}

const { data } = await response.json();

this._getNetworkInfoError = false;

if (!data.host_internet) {
this._networkIssue = true;
const primaryInterface = data.interfaces.find(
(intf) => intf.primary && intf.enabled
);
if (primaryInterface) {
this._dnsPrimaryInterface = [
...(primaryInterface.ipv4?.nameservers || []),
...(primaryInterface.ipv6?.nameservers || []),
].join(", ");
}
} else {
this._networkIssue = false;
}
({ data } = await response.json());
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
this._getNetworkInfoError = true;
return;
}

this._getNetworkInfoError = false;

if (!data.host_internet) {
this._networkIssue = true;
const primaryInterface = data.interfaces.find(
(intf) => intf.primary && intf.enabled
);
if (primaryInterface) {
this._dnsPrimaryInterface = [
...(primaryInterface.ipv4?.nameservers || []),
...(primaryInterface.ipv6?.nameservers || []),
].join(", ");
}
} else {
this._networkIssue = false;
}

fireEvent(this, "value-changed", {
Expand All @@ -140,7 +143,11 @@ class LandingPageNetwork extends LitElement {
} catch (err) {
// eslint-disable-next-line no-console
console.error(err);
this._getNetworkInfoError = true;
showAlertDialog(this, {
title: this.localize("network_issue.failed"),
text: this.localize("network_issue.set_dns_failed"),
wendevlin marked this conversation as resolved.
Show resolved Hide resolved
confirmText: this.localize("network_issue.close"),
});
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7519,7 +7519,10 @@
"resolve_different": "To resolve this, you can try a different DNS server. Select one of the options below. Alternatively, change your router configuration to use your own custom DNS server.",
"use_cloudflare": "Use Cloudflare DNS",
"use_google": "Use Google DNS",
"no_primary_interface": "Home Assistant OS wasn't able to detect a primary network interface, so you cannot define a DNS server!"
"no_primary_interface": "Home Assistant OS wasn't able to detect a primary network interface, so you cannot define a DNS server!",
"failed": "Failed",
"set_dns_failed": "An error occurred while setting the DNS server. Please check the logs for more information and try again.",
"close": "[%key:ui::common::close%]"
},
"logs": {
"scroll_down_button": "New logs - Click to scroll",
Expand Down