节点自动升级功能之前的版本
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/userconfigs"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/lists"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/xlzd/gotp"
|
||||
)
|
||||
@@ -184,9 +183,6 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
var featureCodes = config.Features
|
||||
if config.HTTPDNSIsOn && !lists.ContainsString(featureCodes, userconfigs.UserFeatureCodeHTTPDNS) {
|
||||
featureCodes = append(featureCodes, userconfigs.UserFeatureCodeHTTPDNS)
|
||||
}
|
||||
|
||||
_, err = this.RPC().UserRPC().UpdateUserFeatures(this.AdminContext(), &pb.UpdateUserFeaturesRequest{
|
||||
UserId: userId,
|
||||
|
||||
@@ -7,6 +7,8 @@ import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/users/userutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/userconfigs"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"github.com/xlzd/gotp"
|
||||
@@ -87,17 +89,13 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
this.Data["clusterId"] = user.NodeCluster.Id
|
||||
}
|
||||
|
||||
// 检查用户是否开通了 HTTPDNS 功能
|
||||
// 检查全局是否启用了 HTTPDNS 功能
|
||||
var hasHTTPDNSFeature = false
|
||||
userFeaturesResp, err := this.RPC().UserRPC().FindUserFeatures(this.AdminContext(), &pb.FindUserFeaturesRequest{UserId: params.UserId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
for _, f := range userFeaturesResp.Features {
|
||||
if f.Code == "httpdns" {
|
||||
hasHTTPDNSFeature = true
|
||||
break
|
||||
sysResp, sysErr := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{Code: systemconfigs.SettingCodeUserRegisterConfig})
|
||||
if sysErr == nil && len(sysResp.ValueJSON) > 0 {
|
||||
var regConfig = userconfigs.DefaultUserRegisterConfig()
|
||||
if json.Unmarshal(sysResp.ValueJSON, regConfig) == nil {
|
||||
hasHTTPDNSFeature = regConfig.HTTPDNSIsOn
|
||||
}
|
||||
}
|
||||
this.Data["hasHTTPDNSFeature"] = hasHTTPDNSFeature
|
||||
|
||||
Reference in New Issue
Block a user