remove commented code,
remove Name field from select using ID instead
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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 {
|
||||||
|
@@ -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>
|
||||||
|
Reference in New Issue
Block a user