typescript changes

This commit is contained in:
2024-12-14 01:24:31 +01:00
parent 8bd2cb72d0
commit 92299665b6
5 changed files with 182 additions and 104 deletions

View File

@@ -0,0 +1,32 @@
import { Controller } from ".";
export class NetworkConfigView {
getConfig(): NetworkConfig {
return {
ap_ssid: this.ap_ssid.value,
ssid: this.ssid.value,
password: this.password.value,
mqtt_url: this.mqtt_url.value,
base_topic: this.base_topic.value
}
}
private readonly ap_ssid: HTMLInputElement;
private readonly ssid: HTMLInputElement;
private readonly password: HTMLInputElement;
private readonly mqtt_url: HTMLInputElement;
private readonly base_topic: HTMLInputElement;
constructor(controller: Controller) {
this.ap_ssid = (document.getElementById("ap_ssid") as HTMLInputElement);
this.ap_ssid.onchange = controller.configChanged
this.ssid = (document.getElementById("ssid") as HTMLInputElement);
this.ssid.onchange = controller.configChanged
this.password = (document.getElementById("password") as HTMLInputElement);
this.password.onchange = controller.configChanged
this.mqtt_url = document.getElementById("mqtt_url") as HTMLInputElement;
this.mqtt_url.onchange = controller.configChanged
this.base_topic = document.getElementById("base_topic") as HTMLInputElement;
this.base_topic.onchange = controller.configChanged
}
}