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 used for templated <select>
type Select struct { type Select struct {
ID string ID string
Name string
Options []Option Options []Option
} }

View File

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

View File

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