优化命名

This commit is contained in:
GoEdgeLab
2021-11-24 11:58:01 +08:00
parent e0d517639a
commit c1b8df4710
57 changed files with 91 additions and 91 deletions

View File

@@ -364,7 +364,7 @@ func (this *CreateAction) RunPost(params struct {
this.ErrorPage(err) this.ErrorPage(err)
return return
} }
webId = webResp.WebId webId = webResp.HttpWebId
} }
// 包含条件 // 包含条件
@@ -462,7 +462,7 @@ func (this *CreateAction) RunPost(params struct {
// 访问日志 // 访问日志
if params.AccessLogIsOn { if params.AccessLogIsOn {
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
WebId: webConfig.Id, HttpWebId: webConfig.Id,
AccessLogJSON: []byte(`{ AccessLogJSON: []byte(`{
"isPrior": false, "isPrior": false,
"isOn": true, "isOn": true,
@@ -501,7 +501,7 @@ func (this *CreateAction) RunPost(params struct {
} else { } else {
websocketId := createWebSocketResp.WebsocketId websocketId := createWebSocketResp.WebsocketId
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
WebId: webConfig.Id, HttpWebId: webConfig.Id,
WebsocketJSON: []byte(` { WebsocketJSON: []byte(` {
"isPrior": false, "isPrior": false,
"isOn": true, "isOn": true,
@@ -530,7 +530,7 @@ func (this *CreateAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
WebId: webConfig.Id, HttpWebId: webConfig.Id,
CacheJSON: cacheConfigJSON, CacheJSON: cacheConfigJSON,
}) })
if err != nil { if err != nil {
@@ -552,7 +552,7 @@ func (this *CreateAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
WebId: webConfig.Id, HttpWebId: webConfig.Id,
FirewallJSON: firewallRefJSON, FirewallJSON: firewallRefJSON,
}) })
if err != nil { if err != nil {
@@ -575,7 +575,7 @@ func (this *CreateAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
WebId: webConfig.Id, HttpWebId: webConfig.Id,
RemoteAddrJSON: remoteAddrConfigJSON, RemoteAddrJSON: remoteAddrConfigJSON,
}) })
if err != nil { if err != nil {

View File

@@ -56,7 +56,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查参数 // TODO 检查参数
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
WebId: params.WebId, HttpWebId: params.WebId,
AccessLogJSON: params.AccessLogJSON, AccessLogJSON: params.AccessLogJSON,
}) })
if err != nil { if err != nil {

View File

@@ -76,7 +76,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CacheJSON: cacheJSON, CacheJSON: cacheJSON,
}) })
if err != nil { if err != nil {

View File

@@ -52,7 +52,7 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId) defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CharsetJSON: params.CharsetJSON, CharsetJSON: params.CharsetJSON,
}) })
if err != nil { if err != nil {

View File

@@ -66,7 +66,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CompressionJSON: params.CompressionJSON, CompressionJSON: params.CompressionJSON,
}) })
if err != nil { if err != nil {

View File

@@ -55,7 +55,7 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
WebId: webId, HttpWebId: webId,
HeaderJSON: refJSON, HeaderJSON: refJSON,
}) })
if err != nil { if err != nil {
@@ -82,7 +82,7 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
WebId: webId, HttpWebId: webId,
HeaderJSON: refJSON, HeaderJSON: refJSON,
}) })
if err != nil { if err != nil {
@@ -129,7 +129,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
WebId: params.WebId, HttpWebId: params.WebId,
HeaderJSON: params.RequestHeaderJSON, HeaderJSON: params.RequestHeaderJSON,
}) })
if err != nil { if err != nil {
@@ -145,7 +145,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
WebId: params.WebId, HttpWebId: params.WebId,
HeaderJSON: params.ResponseHeaderJSON, HeaderJSON: params.ResponseHeaderJSON,
}) })
if err != nil { if err != nil {

View File

@@ -52,7 +52,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查配置 // TODO 检查配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
WebId: params.WebId, HttpWebId: params.WebId,
PagesJSON: []byte(params.PagesJSON), PagesJSON: []byte(params.PagesJSON),
}) })
if err != nil { if err != nil {
@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
WebId: params.WebId, HttpWebId: params.WebId,
ShutdownJSON: []byte(params.ShutdownJSON), ShutdownJSON: []byte(params.ShutdownJSON),
}) })
if err != nil { if err != nil {

View File

@@ -56,7 +56,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RemoteAddrJSON: params.RemoteAddrJSON, RemoteAddrJSON: params.RemoteAddrJSON,
}) })
if err != nil { if err != nil {

View File

@@ -49,8 +49,8 @@ func (this *IndexAction) RunPost(params struct {
// TODO 校验配置 // TODO 校验配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
WebId: params.WebId, HttpWebId: params.WebId,
StatJSON: params.StatJSON, StatJSON: params.StatJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -64,7 +64,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查配置 // TODO 检查配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
WebId: params.WebId, HttpWebId: params.WebId,
FirewallJSON: params.FirewallJSON, FirewallJSON: params.FirewallJSON,
}) })
if err != nil { if err != nil {

View File

@@ -47,8 +47,8 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId) defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RootJSON: params.RootJSON, RootJSON: params.RootJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -56,8 +56,8 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
WebId: params.WebId, HttpWebId: params.WebId,
WebpJSON: params.WebpJSON, WebpJSON: params.WebpJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -110,7 +110,7 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
WebId: params.WebId, HttpWebId: params.WebId,
WebsocketJSON: websocketRefJSON, WebsocketJSON: websocketRefJSON,
}) })
if err != nil { if err != nil {

View File

@@ -64,8 +64,8 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{
WebId: params.WebId, HttpWebId: params.WebId,
AuthJSON: configJSON, AuthJSON: configJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查参数 // TODO 检查参数
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
WebId: params.WebId, HttpWebId: params.WebId,
AccessLogJSON: params.AccessLogJSON, AccessLogJSON: params.AccessLogJSON,
}) })
if err != nil { if err != nil {

View File

@@ -97,7 +97,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CacheJSON: cacheJSON, CacheJSON: cacheJSON,
}) })
if err != nil { if err != nil {

View File

@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId) defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CharsetJSON: params.CharsetJSON, CharsetJSON: params.CharsetJSON,
}) })
if err != nil { if err != nil {

View File

@@ -71,7 +71,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CompressionJSON: params.CompressionJSON, CompressionJSON: params.CompressionJSON,
}) })
if err != nil { if err != nil {

View File

@@ -58,7 +58,7 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{
WebId: params.WebId, HttpWebId: params.WebId,
FastcgiJSON: fastcgiRefJSON, FastcgiJSON: fastcgiRefJSON,
}) })
if err != nil { if err != nil {

View File

@@ -59,7 +59,7 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
WebId: webId, HttpWebId: webId,
HeaderJSON: refJSON, HeaderJSON: refJSON,
}) })
if err != nil { if err != nil {
@@ -86,7 +86,7 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
WebId: webId, HttpWebId: webId,
HeaderJSON: refJSON, HeaderJSON: refJSON,
}) })
if err != nil { if err != nil {

View File

@@ -129,7 +129,7 @@ func (this *IndexAction) RunPost(params struct {
// 设置跳转到HTTPS // 设置跳转到HTTPS
// TODO 校验设置 // TODO 校验设置
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON, RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
}) })
if err != nil { if err != nil {

View File

@@ -64,8 +64,8 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{
WebId: params.WebId, HttpWebId: params.WebId,
AuthJSON: configJSON, AuthJSON: configJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -45,7 +45,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查参数 // TODO 检查参数
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
WebId: params.WebId, HttpWebId: params.WebId,
AccessLogJSON: params.AccessLogJSON, AccessLogJSON: params.AccessLogJSON,
}) })
if err != nil { if err != nil {

View File

@@ -81,7 +81,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CacheJSON: cacheJSON, CacheJSON: cacheJSON,
}) })
if err != nil { if err != nil {

View File

@@ -42,7 +42,7 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLogInfo("修改Web %d 的字符集设置", params.WebId) defer this.CreateLogInfo("修改Web %d 的字符集设置", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CharsetJSON: params.CharsetJSON, CharsetJSON: params.CharsetJSON,
}) })
if err != nil { if err != nil {

View File

@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
WebId: params.WebId, HttpWebId: params.WebId,
CompressionJSON: params.CompressionJSON, CompressionJSON: params.CompressionJSON,
}) })
if err != nil { if err != nil {

View File

@@ -123,7 +123,7 @@ func (this *CreateAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
WebId: params.WebId, HttpWebId: params.WebId,
LocationsJSON: refJSON, LocationsJSON: refJSON,
}) })
if err != nil { if err != nil {

View File

@@ -28,7 +28,7 @@ func (this *DeleteAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
WebId: params.WebId, HttpWebId: params.WebId,
LocationsJSON: refJSON, LocationsJSON: refJSON,
}) })
if err != nil { if err != nil {

View File

@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{
WebId: params.WebId, HttpWebId: params.WebId,
FastcgiJSON: fastcgiRefJSON, FastcgiJSON: fastcgiRefJSON,
}) })
if err != nil { if err != nil {

View File

@@ -48,7 +48,7 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
WebId: webId, HttpWebId: webId,
HeaderJSON: refJSON, HeaderJSON: refJSON,
}) })
isChanged = true isChanged = true
@@ -71,7 +71,7 @@ func (this *IndexAction) RunGet(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
WebId: webId, HttpWebId: webId,
HeaderJSON: refJSON, HeaderJSON: refJSON,
}) })
isChanged = true isChanged = true
@@ -109,7 +109,7 @@ func (this *IndexAction) RunPost(params struct {
switch params.Type { switch params.Type {
case "request": case "request":
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
WebId: params.WebId, HttpWebId: params.WebId,
HeaderJSON: params.RequestHeaderJSON, HeaderJSON: params.RequestHeaderJSON,
}) })
if err != nil { if err != nil {
@@ -118,7 +118,7 @@ func (this *IndexAction) RunPost(params struct {
} }
case "response": case "response":
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
WebId: params.WebId, HttpWebId: params.WebId,
HeaderJSON: params.ResponseHeaderJSON, HeaderJSON: params.ResponseHeaderJSON,
}) })
if err != nil { if err != nil {

View File

@@ -40,7 +40,7 @@ func (this *IndexAction) RunPost(params struct {
// 设置跳转到HTTPS // 设置跳转到HTTPS
// TODO 校验设置 // TODO 校验设置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON, RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
}) })
if err != nil { if err != nil {

View File

@@ -41,7 +41,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查配置 // TODO 检查配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
WebId: params.WebId, HttpWebId: params.WebId,
PagesJSON: []byte(params.PagesJSON), PagesJSON: []byte(params.PagesJSON),
}) })
if err != nil { if err != nil {
@@ -50,7 +50,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
WebId: params.WebId, HttpWebId: params.WebId,
ShutdownJSON: []byte(params.ShutdownJSON), ShutdownJSON: []byte(params.ShutdownJSON),
}) })
if err != nil { if err != nil {

View File

@@ -48,7 +48,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RemoteAddrJSON: params.RemoteAddrJSON, RemoteAddrJSON: params.RemoteAddrJSON,
}) })
if err != nil { if err != nil {

View File

@@ -47,7 +47,7 @@ func (this *SortAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
WebId: params.WebId, HttpWebId: params.WebId,
LocationsJSON: newRefsJSON, LocationsJSON: newRefsJSON,
}) })
if err != nil { if err != nil {

View File

@@ -40,8 +40,8 @@ func (this *IndexAction) RunPost(params struct {
// TODO 校验配置 // TODO 校验配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
WebId: params.WebId, HttpWebId: params.WebId,
StatJSON: params.StatJSON, StatJSON: params.StatJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查配置 // TODO 检查配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
WebId: params.WebId, HttpWebId: params.WebId,
FirewallJSON: params.FirewallJSON, FirewallJSON: params.FirewallJSON,
}) })
if err != nil { if err != nil {

View File

@@ -38,8 +38,8 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLogInfo("修改Web %d 的根目录等设置", params.WebId) defer this.CreateLogInfo("修改Web %d 的根目录等设置", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RootJSON: params.RootJSON, RootJSON: params.RootJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -48,8 +48,8 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
WebId: params.WebId, HttpWebId: params.WebId,
WebpJSON: params.WebpJSON, WebpJSON: params.WebpJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -102,7 +102,7 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
WebId: params.WebId, HttpWebId: params.WebId,
WebsocketJSON: websocketRefJSON, WebsocketJSON: websocketRefJSON,
}) })
if err != nil { if err != nil {

View File

@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查配置 // TODO 检查配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
WebId: params.WebId, HttpWebId: params.WebId,
PagesJSON: []byte(params.PagesJSON), PagesJSON: []byte(params.PagesJSON),
}) })
if err != nil { if err != nil {
@@ -66,7 +66,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
WebId: params.WebId, HttpWebId: params.WebId,
ShutdownJSON: []byte(params.ShutdownJSON), ShutdownJSON: []byte(params.ShutdownJSON),
}) })
if err != nil { if err != nil {

View File

@@ -42,7 +42,7 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLogInfo("修改Web %d 的URL跳转设置", params.WebId) defer this.CreateLogInfo("修改Web %d 的URL跳转设置", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebHostRedirects(this.AdminContext(), &pb.UpdateHTTPWebHostRedirectsRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebHostRedirects(this.AdminContext(), &pb.UpdateHTTPWebHostRedirectsRequest{
WebId: params.WebId, HttpWebId: params.WebId,
HostRedirectsJSON: params.HostRedirectsJSON, HostRedirectsJSON: params.HostRedirectsJSON,
}) })
if err != nil { if err != nil {

View File

@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RemoteAddrJSON: params.RemoteAddrJSON, RemoteAddrJSON: params.RemoteAddrJSON,
}) })
if err != nil { if err != nil {

View File

@@ -108,7 +108,7 @@ func (this *CreatePopupAction) RunPost(params struct {
// 设置Web中的重写规则 // 设置Web中的重写规则
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RewriteRulesJSON: refsJSON, RewriteRulesJSON: refsJSON,
}) })
if err != nil { if err != nil {

View File

@@ -38,7 +38,7 @@ func (this *DeleteAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RewriteRulesJSON: refsJSON, RewriteRulesJSON: refsJSON,
}) })
if err != nil { if err != nil {

View File

@@ -40,7 +40,7 @@ func (this *SortAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RewriteRulesJSON: refsJSON, RewriteRulesJSON: refsJSON,
}) })
if err != nil { if err != nil {

View File

@@ -54,8 +54,8 @@ func (this *IndexAction) RunPost(params struct {
// TODO 校验配置 // TODO 校验配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
WebId: params.WebId, HttpWebId: params.WebId,
StatJSON: params.StatJSON, StatJSON: params.StatJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -86,7 +86,7 @@ func (this *IndexAction) RunPost(params struct {
// TODO 检查配置 // TODO 检查配置
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
WebId: params.WebId, HttpWebId: params.WebId,
FirewallJSON: params.FirewallJSON, FirewallJSON: params.FirewallJSON,
}) })
if err != nil { if err != nil {

View File

@@ -53,8 +53,8 @@ func (this *IndexAction) RunPost(params struct {
defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId) defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId)
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{ _, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
WebId: params.WebId, HttpWebId: params.WebId,
RootJSON: params.RootJSON, RootJSON: params.RootJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -61,8 +61,8 @@ func (this *IndexAction) RunPost(params struct {
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
WebId: params.WebId, HttpWebId: params.WebId,
WebpJSON: params.WebpJSON, WebpJSON: params.WebpJSON,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -115,7 +115,7 @@ func (this *IndexAction) RunPost(params struct {
return return
} }
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{ _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
WebId: params.WebId, HttpWebId: params.WebId,
WebsocketJSON: websocketRefJSON, WebsocketJSON: websocketRefJSON,
}) })
if err != nil { if err != nil {

View File

@@ -15,7 +15,7 @@ func (this *DeleteAction) RunPost(params struct {
}) { }) {
// TODO 检查权限 // TODO 检查权限
_, err := this.RPC().AuthorityNodeRPC().DeleteAuthorityNode(this.AdminContext(), &pb.DeleteAuthorityNodeRequest{NodeId: params.NodeId}) _, err := this.RPC().AuthorityNodeRPC().DeleteAuthorityNode(this.AdminContext(), &pb.DeleteAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
return return

View File

@@ -40,7 +40,7 @@ func (this *IndexAction) RunGet(params struct{}) {
return return
} }
for _, node := range nodesResp.Nodes { for _, node := range nodesResp.AuthorityNodes {
// 状态 // 状态
status := &nodeconfigs.NodeStatus{} status := &nodeconfigs.NodeStatus{}
if len(node.StatusJSON) > 0 { if len(node.StatusJSON) > 0 {

View File

@@ -41,7 +41,7 @@ func (this *CreatePopupAction) RunPost(params struct {
} }
// 创建日志 // 创建日志
defer this.CreateLog(oplogs.LevelInfo, "创建认证节点 %d", createResp.NodeId) defer this.CreateLog(oplogs.LevelInfo, "创建认证节点 %d", createResp.AuthorityNodeId)
this.Success() this.Success()
} }

View File

@@ -17,12 +17,12 @@ func (this *IndexAction) Init() {
func (this *IndexAction) RunGet(params struct { func (this *IndexAction) RunGet(params struct {
NodeId int64 NodeId int64
}) { }) {
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{NodeId: params.NodeId}) nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
return return
} }
node := nodeResp.Node node := nodeResp.AuthorityNode
if node == nil { if node == nil {
this.NotFound("authorityNode", params.NodeId) this.NotFound("authorityNode", params.NodeId)
return return

View File

@@ -19,12 +19,12 @@ func (this *InstallAction) RunGet(params struct {
NodeId int64 NodeId int64
}) { }) {
// 认证节点信息 // 认证节点信息
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{NodeId: params.NodeId}) nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
return return
} }
node := nodeResp.Node node := nodeResp.AuthorityNode
if node == nil { if node == nil {
this.NotFound("authorityNode", params.NodeId) this.NotFound("authorityNode", params.NodeId)
return return

View File

@@ -31,12 +31,12 @@ func (this *LogsAction) RunGet(params struct {
this.Data["keyword"] = params.Keyword this.Data["keyword"] = params.Keyword
this.Data["level"] = params.Level this.Data["level"] = params.Level
authorityNodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{NodeId: params.NodeId}) authorityNodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
return return
} }
authorityNode := authorityNodeResp.Node authorityNode := authorityNodeResp.AuthorityNode
if authorityNode == nil { if authorityNode == nil {
this.NotFound("authorityNode", params.NodeId) this.NotFound("authorityNode", params.NodeId)
return return

View File

@@ -20,13 +20,13 @@ func (this *UpdateAction) RunGet(params struct {
NodeId int64 NodeId int64
}) { }) {
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{ nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{
NodeId: params.NodeId, AuthorityNodeId: params.NodeId,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
return return
} }
node := nodeResp.Node node := nodeResp.AuthorityNode
if node == nil { if node == nil {
this.WriteString("要操作的节点不存在") this.WriteString("要操作的节点不存在")
return return
@@ -56,10 +56,10 @@ func (this *UpdateAction) RunPost(params struct {
Require("请输入认证节点名称") Require("请输入认证节点名称")
_, err := this.RPC().AuthorityNodeRPC().UpdateAuthorityNode(this.AdminContext(), &pb.UpdateAuthorityNodeRequest{ _, err := this.RPC().AuthorityNodeRPC().UpdateAuthorityNode(this.AdminContext(), &pb.UpdateAuthorityNodeRequest{
NodeId: params.NodeId, AuthorityNodeId: params.NodeId,
Name: params.Name, Name: params.Name,
Description: params.Description, Description: params.Description,
IsOn: params.IsOn, IsOn: params.IsOn,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)