mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
35 lines
753 B
Go
35 lines
753 B
Go
package rewrite
|
|
|
|
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("rewrite")
|
|
}
|
|
|
|
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 len(webConfig.RewriteRules) == 0 {
|
|
this.Data["rewriteRules"] = []interface{}{}
|
|
} else {
|
|
this.Data["rewriteRules"] = webConfig.RewriteRules
|
|
}
|
|
|
|
this.Show()
|
|
}
|