Skip to content

Commit

Permalink
Merge pull request #2777 from TencentBlueKing/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nannan00 authored Aug 14, 2024
2 parents 0275f21 + e91c837 commit 2c298d4
Show file tree
Hide file tree
Showing 85 changed files with 3,034 additions and 2,240 deletions.
3 changes: 1 addition & 2 deletions frontend/build/paas-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ const GLOBAL_VAR = {
BK_DOCS_URL_PREFIX: process.env.BK_DOCS_URL_PREFIX || '',
BK_DOMAIN: process.env.BK_DOMAIN || '',
BK_SHARED_RES_URL: process.env.BK_SHARED_RES_URL || '',
BK_APP_CODE: process.env.BK_APP_CODE || '',
VERSION: process.env.VERSION || ''
BK_APP_CODE: process.env.BK_APP_CODE || ''
};

// APA 重定向回首页,由首页Route响应处理
Expand Down
8 changes: 3 additions & 5 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" href="{{ STATIC_URL }}/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" type="image/x-icon" />
<meta charset="utf-8">
<title>权限中心 | 腾讯蓝鲸智云</title>
<title>权限中心 | 蓝鲸智云</title>
</head>
<body>
<div id="app"></div>
Expand All @@ -33,7 +33,6 @@
const BK_COMPONENT_API_URL = '{{ BK_COMPONENT_API_URL }}' || ''
const BK_SHARED_RES_URL = '{{ BK_SHARED_RES_URL }}' || ''
const BK_APP_CODE = '{{ BK_APP_CODE }}' || ''
const VERSION = '{{ VERSION }}' || ''
document.domain = '{{ SESSION_COOKIE_DOMAIN }}'
window.LOGIN_SERVICE_URL = LOGIN_SERVICE_URL
window.AJAX_URL_PREFIX = AJAX_URL_PREFIX
Expand All @@ -57,7 +56,6 @@
window.BK_COMPONENT_API_URL = BK_COMPONENT_API_URL
window.BK_SHARED_RES_URL = BK_SHARED_RES_URL
window.BK_APP_CODE = BK_APP_CODE
window.VERSION = VERSION
})()

function getLanguage () {
Expand All @@ -77,9 +75,9 @@
CUR_LANGUAGE = 'zh-cn'
}
if (CUR_LANGUAGE === 'en') {
document.title = 'BKIAM | Tencent Blueking'
document.title = 'lAM | Tencent BlueKing'
} else {
document.title = '权限中心 | 腾讯蓝鲸智云'
document.title = '权限中心 | 蓝鲸智云'
}

return CUR_LANGUAGE
Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"@blueking/functional-dependency": "0.0.1-beta.12",
"@blueking/login-modal": "^1.0.0",
"@blueking/notice-component-vue2": "^2.0.3",
"@blueking/platform-config": "^1.0.2",
"@blueking/platform-config": "^1.0.5",
"@blueking/sub-saas": "0.0.0-beta.7",
"@blueking/user-selector": "^1.0.14",
"@commitlint/cli": "~13.1.0",
Expand All @@ -111,7 +111,7 @@
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^4.0.1",
"better-npm-run": "~0.1.1",
"bk-magic-vue": "^2.5.9-beta.17",
"bk-magic-vue": "^2.5.9-beta.37",
"body-parser": "~1.19.0",
"chalk": "~2.4.2",
"cheerio": "~1.0.0-rc.3",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
return {
reload: this.reload,
reloadCurPage: this.reloadCurPage,
showNoticeAlert: this.isShowNoticeAlert
// 基本类型不具备响应式,这里需要根据异步操作动态计算所以这里返回function
showNoticeAlert: () => this.isShowNoticeAlert
};
},
components: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/IframeEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
return {
reload: this.reload,
reloadCurPage: this.reloadCurPage,
showNoticeAlert: this.isShowNoticeAlert
showNoticeAlert: () => this.isShowNoticeAlert
};
},
components: {
Expand Down
183 changes: 183 additions & 0 deletions frontend/src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,109 @@ export const NEED_CONFIRM_DIALOG_ROUTER = [
'secondaryManageSpaceCreate'
];

// 不同导航栏下的路由模块分类
export const ALL_ROUTES_LIST = new Map([
// 权限模板
[
['permTemplate', 'permTemplateDetail', 'permTemplateCreate', 'permTemplateEdit', 'permTemplateDiff'],
'permTemplateNav'
],
// 首页
[['', 'index'], 'indexNav'],
// 用户组
[
['userGroup', 'userGroupDetail', 'createUserGroup', 'cloneUserGroup', 'userGroupPermDetail', 'groupPermRenewal', 'addGroupPerm'],
'userGroupNav'
],
// 系统接入
[
[
'systemAccess',
'systemAccessCreate',
'systemAccessAccess',
'systemAccessRegistry',
'systemAccessOptimize',
'systemAccessComplete'
],
'systemAccessNav'
],
// 我的申请
[['apply'], 'applyNav'],
// 权限申请 'permApply'
[['applyCustomPerm', 'applyJoinUserGroup'], 'permApplyNav'],
// 临时权限申请 'provisionPermApply'
[['applyProvisionPerm'], 'provisionPermApplyNav'],
// 我的权限
[
[
'myPerm',
'templatePermDetail',
'groupPermDetail',
'permRenewal',
'groupPermRenewal',
'permTransfer',
'permTransferHistory',
'applyPerm'
],
'myPermNav'
],
// 我的管理空间
[['myManageSpace', 'myManageSpaceCreate', 'gradingAdminDetail', 'gradingAdminEdit', 'gradingAdminCreate', 'myManageSpaceSubDetail', 'secondaryManageSpaceEdit'], 'myManageSpaceNav'],
// 分级管理员
[['ratingManager', 'gradingAdminDetail', 'gradingAdminCreate', 'gradingAdminEdit'], 'gradingAdminNav'],
// 二级管理空间
[['secondaryManageSpace', 'secondaryManageSpaceCreate', 'secondaryManageSpaceDetail'], 'secondaryManageSpaceNav'],
// 授权边界
[['authorBoundary', 'authorBoundaryEditFirstLevel', 'authorBoundaryEditSecondLevel'], 'authorBoundaryNav'],
// 最大可授权人员边界
[['addMemberBoundary'], 'addMemberBoundaryNav'],
// 资源权限
[['resourcePermiss'], 'resourcePermissNav'],
// 管理员
[['administrator'], 'settingNav'],
// 审批流程
[['approvalProcess'], 'approvalProcessNav'],
// 用户
[['user'], 'userNav'],
// 审计
[['audit'], 'auditNav'],
// 用户组设置
[['userGroupSetting'], 'userGroupSettingNav'],
// 敏感等级
[['sensitivityLevel'], 'sensitivityLevelNav'],
// 人员模板
[['memberTemplate'], 'memberTemplateNav'],
// 管理空间下资源权限管理
[['resourcePermManage'], 'resourcePermManageNav'],
// 用户/组织
[['userOrgPerm'], 'userOrgPermNav'],
// 续期通知
[['renewalNotice'], 'renewalNoticeNav']
]);

// 切换管理员身份需要重定向的页面
export const MANAGE_SPACE_REDIRECT_ROUTES = new Map([
// 权限模板
[
['permTemplateDetail', 'permTemplateCreate', 'permTemplateEdit', 'permTemplateDiff'],
'permTemplate'
],
// 用户组模块
[
['userGroupDetail', 'createUserGroup', 'cloneUserGroup', 'userGroupPermDetail', 'groupPermRenewal', 'addGroupPerm'],
'userGroup'
],
// 管理空间
[
['gradingAdminDetail', 'gradingAdminCreate', 'gradingAdminEdit'],
'ratingManager'],
// 二级管理员
[
['secondaryManageSpaceCreate', 'secondaryManageSpaceDetail', 'secondaryManageSpaceEdit'],
'secondaryManageSpace'
]
]);

// 用户组属性枚举
export const USER_GROUP_ATTRIBUTES = [
{
Expand Down Expand Up @@ -273,3 +376,83 @@ export const SEND_DAYS_LIST = [
value: 'sunday'
}
];

// 只显示角色名称的审计类型
export const ONLY_ROLE_TYPE = [
'template.create',
'subject.template.create',
'subject.template.delete'
];

// 没有详情的审计类型
export const NO_DETAIL_TYPE = [
'group.create',
'group.delete',
// 'template.create',
'template.update',
'role.create'
];

// 只有描述字段的审计类型
export const ONLY_DESCRIPTION_TYPE = [
'group.update',
'role.update',
'role.member.policy.create',
'role.member.policy.delete',
'approval.global.update'
];

// 只有子对象的审计类型
export const ONLY_SUB_TYPE = [
'action.sensitivity.level.update',
'group.template.create',
'group.member.create',
'group.member.delete',
'group.member.renew',
'group.transfer',
'user.group.delete',
'department.group.delete',
'user.role.delete',
'role.member.create',
'role.member.delete',
'role.member.update',
'role.commonaction.create',
'role.commonaction.delete',
'subject.template.group.delete',
'subject.template.member.create',
'subject.template.member.delete'
];

// 只有附加信息的审计类型
export const ONLY_EXTRA_INFO_TYPE = [
'group.policy.create',
'group.policy.delete',
'group.policy.update',
'user.policy.delete',
'user.policy.create',
'user.policy.update',
'user.temporary.policy.create',
'user.temporary.policy.delete',
'user.blacklist.member.create',
'user.blacklist.member.delete',
'user.permission.clean',
'role.group.renew',
'template.version.sync'
];

// 既有 description 又有 extra_info
export const DE_TYPR = ['template.update'];

// 既有 sub_objects 又有 extra_info
export const SE_TYPE = [
'template.member.create',
'template.member.delete',
'template.version.update'
];

// 既有 description 又有 sub_objects
export const DS_TYPE = [
'approval.action.update',
'approval.group.update',
'template.preupdate.create'
];
Loading

0 comments on commit 2c298d4

Please sign in to comment.