Files
xTeVe/ts/authentication_ts.ts
T
nathan ddc70e170a
continuous-integration/drone/push Build encountered an error
Phase 3: embed web UI with go:embed, pinned TypeScript toolchain, drop i18n, add /healthz
- html/embed.go embeds html/ (pages, css, img, js, video); src/assets.go
  serves it, with os.DirFS("html") under -dev. Static assets get an ETag
  and Cache-Control: no-cache; HTML pages are still templated (only the
  login error message is substituted now).
- Delete the generated src/webUI.go (783 KB base64), src/html-build.go and
  cmd/webui-gen; Dockerfile no longer runs a generator.
- Language layer removed: 254 {{.x}} placeholders inlined as English
  strings in ts/*.ts and the two auth pages; html/lang/en.json, the
  LanguageUI struct and the 'language' setting are gone.
- ts/tsconfig.json + package.json pin typescript 5.9.3; the seven sources
  compile (ES2020, global scripts) into one committed html/js/app.js.
  Ten unreferenced legacy scripts under html/js/ deleted; all pages load
  js/app.js.
- Fix the six type errors that blocked a clean compile, including a real
  bug: a missing semicolon in the search shortcut handler made the code
  call the result of preventDefault(), so the shortcut threw instead of
  focusing the search box.
- /healthz liveness endpoint; Dockerfile healthcheck and README use it.
- Drone: go vet, and a webui-check step that rebuilds the bundle and fails
  if the committed app.js is stale.
- README-DEV.md documents build, UI toolchain, -dev, versioning, CI.
2026-09-26 12:46:45 +10:00

49 lines
1.0 KiB
TypeScript

function login() {
var err:Boolean = false
var data = new Object()
var div:any = document.getElementById("content")
var form:any = document.getElementById("authentication")
var inputs:any = div.getElementsByTagName("INPUT")
console.log(inputs)
for (var i = inputs.length - 1; i >= 0; i--) {
var key:string = (inputs[i] as HTMLInputElement).name
var value:string = (inputs[i] as HTMLInputElement).value
if (value.length == 0) {
inputs[i].style.borderColor = "red"
err = true
} else {
inputs[i].style.borderColor = ""
}
data[key] = value
}
if (err == true) {
data = new Object()
return
}
if (data.hasOwnProperty("confirm")) {
if (data["confirm"] != data["password"]) {
document.getElementById('password').style.borderColor = "red"
document.getElementById('confirm').style.borderColor = "red"
document.getElementById("err").innerHTML = "Password does not match"
return
}
}
console.log(data)
form.submit();
}