Skip to content

Commit

Permalink
feat: 增加LDAP操作日志
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 committed Jun 15, 2022
1 parent 374b69a commit 262fd12
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/api/v1/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@ func logHandler() iris.Handler {
log.Operator = profile.Name
log.Operation = method

//handle ldap operate
if strings.Contains(path,"ldap") {
if strings.Contains(path,"import") {
log.Operation = "import"
}
if strings.Contains(path,"sync") {
log.Operation = "sync"
}
if strings.Contains(path,"connect") {
log.Operation = "testConnect"
}
if strings.Contains(path,"login") {
log.Operation = "testLogin"
}
}

pathResource := strings.Split(path, "/")
if strings.HasPrefix(currentPath, "clusters/:name") {
if len(pathResource) < 3 {
Expand Down
4 changes: 4 additions & 0 deletions web/kubepi/src/i18n/lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ const system_logs = {
clusters_repos: "集群仓库",
imagerepos: "镜像仓库",
ldap: "LDAP",
sync: "同步",
import: "导入",
testConnect: "测试",
testLogin: "测试",
}


Expand Down

0 comments on commit 262fd12

Please sign in to comment.