mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-28 21:46:36 +08:00
35 lines
742 B
Go
35 lines
742 B
Go
package locations
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/webutils"
|
|
)
|
|
|
|
type IndexAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *IndexAction) Init() {
|
|
this.Nav("", "setting", "index")
|
|
this.SecondMenu("locations")
|
|
}
|
|
|
|
func (this *IndexAction) RunGet(params struct {
|
|
ServerId int64
|
|
}) {
|
|
webConfig, err := webutils.FindWebConfigWithServerId(this.Parent(), params.ServerId)
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
this.Data["webId"] = webConfig.Id
|
|
|
|
if webConfig.Locations != nil {
|
|
this.Data["locations"] = webConfig.Locations
|
|
} else {
|
|
this.Data["locations"] = []interface{}{}
|
|
}
|
|
|
|
this.Show()
|
|
}
|