further components and bootstrap initial
This commit is contained in:
22
rust/src_webpack/src/submitView.ts
Normal file
22
rust/src_webpack/src/submitView.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Controller } from "./main";
|
||||
|
||||
export class SubmitView{
|
||||
json: HTMLInputElement;
|
||||
submitFormBtn: HTMLButtonElement;
|
||||
submit_status: HTMLElement;
|
||||
|
||||
constructor(controller: Controller){
|
||||
this.json = document.getElementById('json') as HTMLInputElement
|
||||
this.submitFormBtn = document.getElementById("submit") as HTMLButtonElement
|
||||
this.submit_status = document.getElementById("submit_status") as HTMLElement
|
||||
this.submitFormBtn.onclick = () => {
|
||||
controller.uploadConfig(this.json.value, (status:string) => {
|
||||
this.submit_status.innerHTML = status;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setJson(pretty: string) {
|
||||
this.json.value = pretty
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user