remove commented code,

remove Name field from select using ID instead
This commit is contained in:
2025-04-07 23:17:23 +00:00
parent 13339cc56d
commit 455ed353c6
3 changed files with 3 additions and 7 deletions

View File

@@ -16,7 +16,6 @@ type StaticFile struct {
// type used for templated <select>
type Select struct {
ID string
Name string
Options []Option
}

View File

@@ -30,12 +30,10 @@ func GetLoginRealms() ([]Realm, error) {
}
res, code, err := common.RequestGetAPI("/proxmox/access/domains", ctx)
if err != nil {
//HandleNonFatalError(c, err)
return realms, err
}
if code != 200 { // we expect /access/domains to always be avaliable
//HandleNonFatalError(c, err)
return realms, fmt.Errorf("request to /proxmox/access/do9mains resulted in %+v", res)
return realms, fmt.Errorf("request to /proxmox/access/domains resulted in %+v", res)
}
for _, v := range ctx.Body["data"].([]any) {
@@ -59,7 +57,6 @@ func HandleGETLogin(c *gin.Context) {
sel := common.Select{
ID: "realm",
Name: "realm",
}
for _, realm := range realms {

View File

@@ -1,5 +1,5 @@
{{define "select"}}
<select class="w3-select w3-border" id="{{.ID}}" name="{{.Name}}">
<select class="w3-select w3-border" id="{{.ID}}" name="{{.ID}}">
{{range .Options}}
{{if .Selected}}
<option value="{{.Value}}" selected>{{.Display}}</option>