mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-25 19:20:30 +08:00
实现重写规则管理
This commit is contained in:
@@ -2,6 +2,7 @@ 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 {
|
||||
@@ -16,7 +17,18 @@ func (this *IndexAction) Init() {
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user