部分中文转换为多语言代号

This commit is contained in:
刘祥超
2023-06-30 18:08:30 +08:00
parent 65555e1fe3
commit 5e38b1fbca
322 changed files with 884 additions and 733 deletions

View File

@@ -1,9 +1,9 @@
package grants
import (
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/grants/grantutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"golang.org/x/crypto/ssh"
@@ -84,7 +84,7 @@ func (this *CreateAction) RunPost(params struct {
}
// 创建日志
defer this.CreateLog(oplogs.LevelInfo, "创建SSH认证 %d", createResp.NodeGrantId)
defer this.CreateLogInfo(codes.NodeGrant_LogCreateSSHGrant, createResp.NodeGrantId)
this.Success()
}

View File

@@ -1,9 +1,9 @@
package grants
import (
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/grants/grantutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
@@ -93,7 +93,7 @@ func (this *CreatePopupAction) RunPost(params struct {
}
// 创建日志
defer this.CreateLog(oplogs.LevelInfo, "创建SSH认证 %d", createResp.NodeGrantId)
defer this.CreateLogInfo(codes.NodeGrant_LogCreateSSHGrant, createResp.NodeGrantId)
this.Success()
}

View File

@@ -1,8 +1,7 @@
package grants
import (
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
@@ -14,7 +13,7 @@ func (this *DeleteAction) RunPost(params struct {
GrantId int64
}) {
// 创建日志
defer this.CreateLog(oplogs.LevelInfo, "删除SSH认证 %d", params.GrantId)
defer this.CreateLogInfo(codes.NodeGrant_LogDeleteSSHGrant, params.GrantId)
// 检查是否有别的集群或节点正在使用
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithNodeGrantId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithNodeGrantIdRequest{

View File

@@ -10,11 +10,11 @@ import (
func AllGrantMethods(langCode langs.LangCode) []maps.Map {
return []maps.Map{
{
"name": langs.Message(langCode, codes.AdminNodeGrantMethodUserPassword),
"name": langs.Message(langCode, codes.NodeGrant_MethodUserPassword),
"value": "user",
},
{
"name": langs.Message(langCode, codes.AdminNodeGrantMethodPrivateKey),
"name": langs.Message(langCode, codes.NodeGrant_MethodPrivateKey),
"value": "privateKey",
},
}

View File

@@ -1,9 +1,8 @@
package grants
import (
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/grants/grantutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
@@ -66,7 +65,7 @@ func (this *UpdateAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
defer this.CreateLog(oplogs.LevelInfo, "修改SSH认证 %d", params.GrantId)
defer this.CreateLogInfo(codes.NodeGrant_LogUpdateSSHGrant, params.GrantId)
params.Must.
Field("name", params.Name).

View File

@@ -1,9 +1,8 @@
package grants
import (
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/grants/grantutils"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
@@ -66,7 +65,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
defer this.CreateLog(oplogs.LevelInfo, "修改SSH认证 %d", params.GrantId)
defer this.CreateLogInfo(codes.NodeGrant_LogUpdateSSHGrant, params.GrantId)
params.Must.
Field("name", params.Name).