mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 09:20:25 +08:00
优化证书数量很多时的页面加载速度
This commit is contained in:
@@ -48,7 +48,10 @@ func (this *UpdateCNAMEPopupAction) RunPost(params struct {
|
|||||||
this.FailField("dnsName", "CNAME中只能包含数字、英文字母")
|
this.FailField("dnsName", "CNAME中只能包含数字、英文字母")
|
||||||
}
|
}
|
||||||
|
|
||||||
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(this.AdminContext(), &pb.FindEnabledServerRequest{ServerId: params.ServerId})
|
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(this.AdminContext(), &pb.FindEnabledServerRequest{
|
||||||
|
ServerId: params.ServerId,
|
||||||
|
IgnoreSSLCertData: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
if !isOk {
|
if !isOk {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
httpsConfig := &serverconfigs.HTTPSProtocolConfig{}
|
var httpsConfig = &serverconfigs.HTTPSProtocolConfig{}
|
||||||
if len(server.HttpsJSON) > 0 {
|
if len(server.HttpsJSON) > 0 {
|
||||||
err := json.Unmarshal(server.HttpsJSON, httpsConfig)
|
err := json.Unmarshal(server.HttpsJSON, httpsConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -44,12 +44,15 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
|
|
||||||
var sslPolicy *sslconfigs.SSLPolicy
|
var sslPolicy *sslconfigs.SSLPolicy
|
||||||
if httpsConfig.SSLPolicyRef != nil && httpsConfig.SSLPolicyRef.SSLPolicyId > 0 {
|
if httpsConfig.SSLPolicyRef != nil && httpsConfig.SSLPolicyRef.SSLPolicyId > 0 {
|
||||||
sslPolicyConfigResp, err := this.RPC().SSLPolicyRPC().FindEnabledSSLPolicyConfig(this.AdminContext(), &pb.FindEnabledSSLPolicyConfigRequest{SslPolicyId: httpsConfig.SSLPolicyRef.SSLPolicyId})
|
sslPolicyConfigResp, err := this.RPC().SSLPolicyRPC().FindEnabledSSLPolicyConfig(this.AdminContext(), &pb.FindEnabledSSLPolicyConfigRequest{
|
||||||
|
SslPolicyId: httpsConfig.SSLPolicyRef.SSLPolicyId,
|
||||||
|
IgnoreData: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sslPolicyConfigJSON := sslPolicyConfigResp.SslPolicyJSON
|
var sslPolicyConfigJSON = sslPolicyConfigResp.SslPolicyJSON
|
||||||
if len(sslPolicyConfigJSON) > 0 {
|
if len(sslPolicyConfigJSON) > 0 {
|
||||||
sslPolicy = &sslconfigs.SSLPolicy{}
|
sslPolicy = &sslconfigs.SSLPolicy{}
|
||||||
err = json.Unmarshal(sslPolicyConfigJSON, sslPolicy)
|
err = json.Unmarshal(sslPolicyConfigJSON, sslPolicy)
|
||||||
|
|||||||
@@ -42,7 +42,10 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
this.Data["clusters"] = clusterMaps
|
this.Data["clusters"] = clusterMaps
|
||||||
|
|
||||||
// 当前服务信息
|
// 当前服务信息
|
||||||
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(this.AdminContext(), &pb.FindEnabledServerRequest{ServerId: params.ServerId})
|
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(this.AdminContext(), &pb.FindEnabledServerRequest{
|
||||||
|
ServerId: params.ServerId,
|
||||||
|
IgnoreSSLCertData: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ func (this *ServerHelper) createLeftMenu(action *actions.ActionObject) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
serverResp, err := rpcClient.ServerRPC().FindEnabledServer(rpcClient.Context(action.Context.GetInt64("adminId")), &pb.FindEnabledServerRequest{ServerId: serverId})
|
serverResp, err := rpcClient.ServerRPC().FindEnabledServer(rpcClient.Context(action.Context.GetInt64("adminId")), &pb.FindEnabledServerRequest{
|
||||||
|
ServerId: serverId,
|
||||||
|
IgnoreSSLCertData: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logs.Error(err)
|
logs.Error(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -8,14 +8,17 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 查找Server
|
// FindServer 查找服务信息
|
||||||
func FindServer(p *actionutils.ParentAction, serverId int64) (*pb.Server, *serverconfigs.ServerConfig, bool) {
|
func FindServer(p *actionutils.ParentAction, serverId int64) (*pb.Server, *serverconfigs.ServerConfig, bool) {
|
||||||
serverResp, err := p.RPC().ServerRPC().FindEnabledServer(p.AdminContext(), &pb.FindEnabledServerRequest{ServerId: serverId})
|
serverResp, err := p.RPC().ServerRPC().FindEnabledServer(p.AdminContext(), &pb.FindEnabledServerRequest{
|
||||||
|
ServerId: serverId,
|
||||||
|
IgnoreSSLCertData: true,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.ErrorPage(err)
|
p.ErrorPage(err)
|
||||||
return nil, nil, false
|
return nil, nil, false
|
||||||
}
|
}
|
||||||
server := serverResp.Server
|
var server = serverResp.Server
|
||||||
if server == nil {
|
if server == nil {
|
||||||
p.ErrorPage(errors.New("not found server with id '" + strconv.FormatInt(serverId, 10) + "'"))
|
p.ErrorPage(errors.New("not found server with id '" + strconv.FormatInt(serverId, 10) + "'"))
|
||||||
return nil, nil, false
|
return nil, nil, false
|
||||||
|
|||||||
Reference in New Issue
Block a user