Skip to content

Commit 262fd12

Browse files
feat: 增加LDAP操作日志
1 parent 374b69a commit 262fd12

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

internal/api/v1/v1.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,22 @@ func logHandler() iris.Handler {
141141
log.Operator = profile.Name
142142
log.Operation = method
143143

144+
//handle ldap operate
145+
if strings.Contains(path,"ldap") {
146+
if strings.Contains(path,"import") {
147+
log.Operation = "import"
148+
}
149+
if strings.Contains(path,"sync") {
150+
log.Operation = "sync"
151+
}
152+
if strings.Contains(path,"connect") {
153+
log.Operation = "testConnect"
154+
}
155+
if strings.Contains(path,"login") {
156+
log.Operation = "testLogin"
157+
}
158+
}
159+
144160
pathResource := strings.Split(path, "/")
145161
if strings.HasPrefix(currentPath, "clusters/:name") {
146162
if len(pathResource) < 3 {

web/kubepi/src/i18n/lang/zh-CN.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ const system_logs = {
269269
clusters_repos: "集群仓库",
270270
imagerepos: "镜像仓库",
271271
ldap: "LDAP",
272+
sync: "同步",
273+
import: "导入",
274+
testConnect: "测试",
275+
testLogin: "测试",
272276
}
273277

274278

0 commit comments

Comments
 (0)