mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-05-02 21:15:19 +08:00
部分中文转换为多语言代号
This commit is contained in:
@@ -3,6 +3,7 @@ package access
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -62,7 +63,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的认证设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerAuth_LogUpdateHTTPAuthSettings, params.WebId)
|
||||
|
||||
var authConfig = &serverconfigs.HTTPAuthConfig{}
|
||||
err := json.Unmarshal(params.AuthJSON, authConfig)
|
||||
|
||||
@@ -2,6 +2,7 @@ package accessLog
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -40,7 +41,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的访问日志设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerAccessLog_LogUpdateAccessLogSetting, params.WebId)
|
||||
|
||||
// TODO 检查参数
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package cache
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -55,7 +56,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的缓存设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerCache_LogUpdateCacheSettings, params.WebId)
|
||||
|
||||
// 校验配置
|
||||
cacheConfig := &serverconfigs.HTTPCacheConfig{}
|
||||
|
||||
@@ -3,6 +3,7 @@ package charset
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -39,7 +40,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的字符集设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerCharset_LogUpdateCharsetSetting, params.WebId)
|
||||
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
||||
HttpWebId: params.WebId,
|
||||
|
||||
@@ -5,6 +5,7 @@ package compression
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -42,7 +43,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的压缩设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerCompression_LogUpdateCompressionSettings, params.WebId)
|
||||
|
||||
// 校验配置
|
||||
var compressionConfig = &serverconfigs.HTTPCompressionConfig{}
|
||||
|
||||
@@ -3,6 +3,7 @@ package locations
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -55,7 +56,7 @@ func (this *CreateAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("创建路由规则:%s", params.Pattern)
|
||||
defer this.CreateLogInfo(codes.HTTPLocation_LogCreateHTTPLocation, params.Pattern)
|
||||
|
||||
params.Must.
|
||||
Field("pattern", params.Pattern).
|
||||
|
||||
@@ -3,6 +3,7 @@ package fastcgi
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -40,7 +41,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的Fastcgi设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerFastcgi_LogUpdateHTTPFastcgi, params.WebId)
|
||||
|
||||
// TODO 检查配置
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package headers
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
@@ -102,7 +103,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的Header设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerHTTPHeader_LogUpdateHTTPHeaders, params.WebId)
|
||||
|
||||
// TODO 检查配置
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -35,7 +36,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的通用设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerRedirect_LogUpdateRedirects, params.WebId)
|
||||
|
||||
// 设置跳转到HTTPS
|
||||
// TODO 校验设置
|
||||
|
||||
@@ -3,6 +3,7 @@ package location
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
@@ -55,7 +56,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改路由规则 %d 设置", params.LocationId)
|
||||
defer this.CreateLogInfo(codes.HTTPLocation_LogUpdateHTTPLocation, params.LocationId)
|
||||
|
||||
params.Must.
|
||||
Field("pattern", params.Pattern).
|
||||
|
||||
@@ -57,19 +57,19 @@ func (this *LocationHelper) BeforeAction(actionPtr actions.ActionWrapper) {
|
||||
func (this *LocationHelper) createMenus(serverIdString string, locationIdString string, secondMenuItem string, locationConfig *serverconfigs.HTTPLocationConfig, actionPtr actions.ActionWrapper) []maps.Map {
|
||||
menuItems := []maps.Map{}
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingBasic),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingBasic),
|
||||
"url": "/servers/server/settings/locations/location?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "basic",
|
||||
"isOff": locationConfig != nil && !locationConfig.IsOn,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingHTTP),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingHTTP),
|
||||
"url": "/servers/server/settings/locations/http?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "http",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.RedirectToHttps != nil && locationConfig.Web.RedirectToHttps.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingOrigins),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingOrigins),
|
||||
"url": "/servers/server/settings/locations/reverseProxy?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "reverseProxy",
|
||||
"isOn": locationConfig != nil && locationConfig.ReverseProxyRef != nil && locationConfig.ReverseProxyRef.IsPrior,
|
||||
@@ -83,97 +83,97 @@ func (this *LocationHelper) createMenus(serverIdString string, locationIdString
|
||||
"isActive": false,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingRewriteRules),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingRewriteRules),
|
||||
"url": "/servers/server/settings/locations/rewrite?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "rewrite",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && len(locationConfig.Web.RewriteRefs) > 0,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingWAF),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingWAF),
|
||||
"url": "/servers/server/settings/locations/waf?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "waf",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.FirewallRef != nil && locationConfig.Web.FirewallRef.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingCache),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingCache),
|
||||
"url": "/servers/server/settings/locations/cache?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "cache",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Cache != nil && locationConfig.Web.Cache.IsPrior && locationConfig.Web.Cache.IsOn,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingAuth),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingAuth),
|
||||
"url": "/servers/server/settings/locations/access?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "access",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Auth != nil && locationConfig.Web.Auth.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingReferers),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingReferers),
|
||||
"url": "/servers/server/settings/locations/referers?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "referer",
|
||||
"isOn": locationConfig.Web != nil && locationConfig.Web.Referers != nil && locationConfig.Web.Referers.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingUserAgents),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingUserAgents),
|
||||
"url": "/servers/server/settings/locations/userAgent?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "userAgent",
|
||||
"isOn": locationConfig.Web != nil && locationConfig.Web.UserAgent != nil && locationConfig.Web.UserAgent.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingCharset),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingCharset),
|
||||
"url": "/servers/server/settings/locations/charset?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "charset",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Charset != nil && locationConfig.Web.Charset.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingAccessLog),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingAccessLog),
|
||||
"url": "/servers/server/settings/locations/accessLog?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "accessLog",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.AccessLogRef != nil && locationConfig.Web.AccessLogRef.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingStat),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingStat),
|
||||
"url": "/servers/server/settings/locations/stat?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "stat",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.StatRef != nil && locationConfig.Web.StatRef.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingCompress),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingCompress),
|
||||
"url": "/servers/server/settings/locations/compression?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "compression",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Compression != nil && locationConfig.Web.Compression.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingPages),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingPages),
|
||||
"url": "/servers/server/settings/locations/pages?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "pages",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && (len(locationConfig.Web.Pages) > 0 || (locationConfig.Web.Shutdown != nil && locationConfig.Web.Shutdown.IsPrior)),
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingHTTPHeaders),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingHTTPHeaders),
|
||||
"url": "/servers/server/settings/locations/headers?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "header",
|
||||
"isOn": locationConfig != nil && this.hasHTTPHeaders(locationConfig.Web),
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingWebsocket),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingWebsocket),
|
||||
"url": "/servers/server/settings/locations/websocket?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "websocket",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.WebsocketRef != nil && locationConfig.Web.WebsocketRef.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingWebP),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingWebP),
|
||||
"url": "/servers/server/settings/locations/webp?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "webp",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.WebP != nil && locationConfig.Web.WebP.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingRoot),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingRoot),
|
||||
"url": "/servers/server/settings/locations/web?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "web",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Root != nil && locationConfig.Web.Root.IsPrior,
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingFastcgi),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingFastcgi),
|
||||
"url": "/servers/server/settings/locations/fastcgi?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "fastcgi",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.FastcgiRef != nil && locationConfig.Web.FastcgiRef.IsPrior,
|
||||
@@ -188,14 +188,14 @@ func (this *LocationHelper) createMenus(serverIdString string, locationIdString
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingClientIP),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingClientIP),
|
||||
"url": "/servers/server/settings/locations/remoteAddr?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "remoteAddr",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.RemoteAddr != nil && locationConfig.Web.RemoteAddr.IsOn,
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": this.Lang(actionPtr, codes.AdminServerMenuSettingRequestLimit),
|
||||
"name": this.Lang(actionPtr, codes.Server_MenuSettingRequestLimit),
|
||||
"url": "/servers/server/settings/locations/requestLimit?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "requestLimit",
|
||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.RequestLimit != nil && locationConfig.Web.RequestLimit.IsOn,
|
||||
|
||||
@@ -2,6 +2,7 @@ package pages
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -36,7 +37,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
ShutdownJSON string
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的自定义页面设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerPage_LogUpdatePages, params.WebId)
|
||||
|
||||
// TODO 检查配置
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package referers
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -54,7 +55,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 防盗链设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerReferer_LogUpdateReferers, params.WebId)
|
||||
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebReferers(this.AdminContext(), &pb.UpdateHTTPWebReferersRequest{
|
||||
HttpWebId: params.WebId,
|
||||
|
||||
@@ -4,6 +4,7 @@ package requestlimit
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -40,7 +41,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 请求限制", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerRequestLimit_LogUpdateRequestLimitSettings, params.WebId)
|
||||
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRequestLimit(this.AdminContext(), &pb.UpdateHTTPWebRequestLimitRequest{
|
||||
HttpWebId: params.WebId,
|
||||
|
||||
@@ -3,6 +3,7 @@ package reverseProxy
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -52,7 +53,7 @@ func (this *SettingAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改路由规则 %d 的反向代理设置", params.LocationId)
|
||||
defer this.CreateLogInfo(codes.ServerReverseProxy_LogUpdateLocationReverseProxySettings, params.LocationId)
|
||||
|
||||
// TODO 校验配置
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package stat
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -35,7 +36,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的统计设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerStat_LogUpdateStatSettings, params.WebId)
|
||||
|
||||
// TODO 校验配置
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package userAgent
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -47,7 +48,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d User-Agent设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerUserAgent_LogUpdateUserAgents, params.WebId)
|
||||
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebUserAgent(this.AdminContext(), &pb.UpdateHTTPWebUserAgentRequest{
|
||||
HttpWebId: params.WebId,
|
||||
|
||||
@@ -2,6 +2,7 @@ package waf
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
||||
@@ -56,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的WAF设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerWAF_LogUpdateWAFSettings, params.WebId)
|
||||
|
||||
// TODO 检查配置
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package web
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -35,7 +36,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的根目录等设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerRoot_LogUpdateRoot, params.WebId)
|
||||
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
||||
HttpWebId: params.WebId,
|
||||
|
||||
@@ -3,6 +3,7 @@ package websocket
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -40,7 +41,7 @@ func (this *IndexAction) RunPost(params struct {
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
defer this.CreateLogInfo("修改Web %d 的Websocket设置", params.WebId)
|
||||
defer this.CreateLogInfo(codes.ServerWebsocket_LogUpdateWebsocketSettings, params.WebId)
|
||||
|
||||
// TODO 检查配置
|
||||
|
||||
|
||||
Reference in New Issue
Block a user