Skip to content

Commit

Permalink
refactor(audit log): adapt sso api
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon committed Oct 10, 2024
1 parent 8e30da1 commit 91fae43
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/views/General/AuditLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</el-table-column>
<el-table-column :label="tl('opSource')">
<template #default="{ row }">
{{ getLabelFromOpts(row.from, sourceTypeOpt) }}
{{ getSourceType(row.from) }}
<br />
{{ getSourceData(row) }}
</template>
Expand Down Expand Up @@ -206,7 +206,7 @@ import {
GetAuditParams,
} from '@/types/typeAlias'
import { ArrowDown, ArrowUp, RefreshLeft, Search, Setting } from '@element-plus/icons-vue'
import { pickBy } from 'lodash'
import { pickBy, toUpper } from 'lodash'
import moment from 'moment'
import { Ref, computed, reactive, ref } from 'vue'
import { useStore } from 'vuex'
Expand Down Expand Up @@ -366,6 +366,17 @@ const init = async () => {
}
const formatDate = (ipt: string) => moment(ipt).format('YYYY-MM-DD HH:mm:ss')
const isFromSSO = (from: string) => ['oidc', 'saml'].includes(from)
const getSourceType = (value: string) => {
if (isFromSSO(value)) {
return toUpper(value)
}
if (value === 'unknown') {
return t('RuleEngine.unknown')
}
return getLabelFromOpts(value, sourceTypeOpt)
}
const typesUseNodeAsInfo: Array<string> = [AuditLogFrom.cli, AuditLogFrom.erlang_console]
const getSourceData = (row: AuditLogItem) => {
const { from, node, source } = row
Expand Down
12 changes: 12 additions & 0 deletions src/views/General/resource_dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,18 @@
"zh": "单点登录发起登录"
}
},
{
"method": "get",
"path": "/sso/oidc/callback",
"operation_label": {
"en": "Dashboard Single Sign-On",
"zh": "Dashboard 单点登录"
},
"operation_name_label": {
"en": "OIDC authorization server callback request",
"zh": "OIDC 授权服务器回调请求"
}
},
{
"method": "post",
"path": "/api_key",
Expand Down

0 comments on commit 91fae43

Please sign in to comment.