Files
Vetting/internal/web/templates/registration.templ
T
josh 9bb4b09a04
CI / Lint + build + test (push) Has been cancelled
Initial commit: full Phases 1-6 implementation
Post-repair hardware validation pipeline for Proxmox cluster hosts.
Go orchestrator + in-image agent + mkosi live image + bundled dnsmasq
PXE + SQLite + HTMX/SSE UI + notify registry + janitor + full docs.
2026-04-17 21:32:10 -04:00

62 lines
1.6 KiB
Plaintext

package templates
type RegistrationForm struct {
Name string
MAC string
WoLBroadcastIP string
WoLPort string
ExpectedSpecYAML string
Notes string
Error string
}
templ Registration(form RegistrationForm) {
@Layout("Register host") {
<section class="form-wrap">
<h1>Register host</h1>
if form.Error != "" {
<div class="error">{ form.Error }</div>
}
<form method="post" action="/hosts" class="host-form">
<label>
Name
<input type="text" name="name" value={ form.Name } required pattern="[A-Za-z0-9_\-\.]+" placeholder="pve-node-03"/>
</label>
<label>
MAC address
<input type="text" name="mac" value={ form.MAC } required placeholder="aa:bb:cc:dd:ee:ff"/>
</label>
<div class="grid-2">
<label>
WoL broadcast IP
<input type="text" name="wol_broadcast_ip" value={ form.WoLBroadcastIP } required placeholder="10.0.0.255"/>
</label>
<label>
WoL port
<input type="number" name="wol_port" value={ defaultPort(form.WoLPort) } min="1" max="65535"/>
</label>
</div>
<label>
Expected hardware spec (YAML)
<textarea name="expected_spec_yaml" rows="12" required placeholder="cpu:&#10; model_match: ...">{ form.ExpectedSpecYAML }</textarea>
</label>
<label>
Notes
<textarea name="notes" rows="3">{ form.Notes }</textarea>
</label>
<div class="actions">
<button type="submit">Register</button>
<a class="button-secondary" href="/">Cancel</a>
</div>
</form>
</section>
}
}
func defaultPort(v string) string {
if v == "" {
return "9"
}
return v
}