Wi-Fi Hotspot UI

This commit is contained in:
Robin Davies
2024-09-12 19:12:07 -04:00
parent 66e46b8d39
commit f34ca1f0da
22 changed files with 1155 additions and 530 deletions
+11 -11
View File
@@ -21,10 +21,12 @@
export default class WifiConfigSettings {
deserialize(input: any) : WifiConfigSettings{
this.autoStartMode = input.autoStartMode;
this.hasSavedPassword = input.hasSavedPassword;
this.homeNetwork = input.homeNetwork;
this.valid = input.valid;
this.wifiWarningGiven = input.wifiWarningGiven;
this.rebootRequired = input.rebootRequired;
this.enable = input.enable;
this.hotspotName = input.hotspotName;
this.hasPassword = input.hasPassword;
this.password = input.password;
@@ -35,29 +37,27 @@ export default class WifiConfigSettings {
clone() : WifiConfigSettings {
return new WifiConfigSettings().deserialize(this);
}
valid: boolean = true;
autoStartMode: number = 0;
hasSavedPassword: boolean = false;
homeNetwork: string = "";
wifiWarningGiven: boolean = false;
enable: boolean = true;
hasPassword: boolean = false;
rebootRequired = false;
valid: boolean = false;
hotspotName: string = "pipedal";
password: string = "";
countryCode: string = "US";
channel: string = "g6";
channel: string = "0";
isEnabled() { return this.autoStartMode !== 0;}
getSummaryText() {
let result: string;
if (!this.valid) {
result = "Not available.";
} else if (!this.enable) {
} else if (this.autoStartMode === 0) {
result = "Disabled.";
} else {
result = this.hotspotName;
}
if (this.rebootRequired)
{
result += " (Restart required)";
}
return result;
}