typescript changes
This commit is contained in:
32
rust/src_webpack/src/network.ts
Normal file
32
rust/src_webpack/src/network.ts
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user