package capture
import (
"gitea.henriburau.de/haw-lan/cod4watcher/views/layouts"
"gitea.henriburau.de/haw-lan/cod4watcher/views/components"
)
type CaptureFormValues struct {
Host string
Port string
Name string
Active bool
ValidateServer bool
}
templ CaptureForm(formValues CaptureFormValues, errors map[string]string) {
@layouts.Base() {
@components.Form(components.FormProps{
Title: "Create new capture",
Action: "/new/capture",
Method: "post",
SubmitText: "Create capture",
}) {
@components.Input(components.InputProps{
Name: "name",
Type: "text",
Value: formValues.Name,
Error: errors["name"],
Placeholder: "Name for the capture",
})
@components.Input(components.InputProps{
Name: "host",
Type: "text",
Value: formValues.Host,
Error: errors["host"],
Placeholder: "Host-Address of the capture",
})
@components.Input(components.InputProps{
Name: "port",
Type: "text",
Value: formValues.Port,
Error: errors["port"],
Placeholder: "Port for the capture",
})
}
}
}