Skip to content

Commit

Permalink
Merge pull request #2798 from TencentBlueKing/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nannan00 authored Sep 2, 2024
2 parents ed664a8 + cb63c4b commit a4d8470
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 55 deletions.
1 change: 0 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<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>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,5 +827,5 @@ export function getCopyValue (value) {
*/
export const getRoutePath = (subPath) => {
const path = subPath.startsWith('/') ? subPath.slice(1) : subPath;
return rootPath ? `${rootPath}${path}` : path;
return rootPath ? `${rootPath}${path}` : subPath;
};
10 changes: 5 additions & 5 deletions frontend/src/components/iam-resource-cascade-search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@
name: this.$t(`m.userGroup['用户组名']`),
default: true
},
{
id: 'id',
name: 'ID',
default: true
},
// {
// id: 'id',
// name: 'ID',
// default: true
// },
{
id: 'description',
name: this.$t(`m.common['描述']`),
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ export const m = {
'模板名称不能为空': 'Template name cannot be empty',
'模板成员不能为空': 'Template member cannot be empty',
'模板名称必填, 不允许输入表情字符': 'Template name is required and emoji characters are not allowed to be entered',
'用户组名不允许输入表情字符': 'User group name does not allow input of emoticons',
'ID必须是一个正整数': 'ID must be a positive integer'
'用户组名不允许输入表情字符': 'User group name does not allow input of emoticons'
},
info: {
'加入用户组申请成功': 'Apply to join the group successfully',
Expand Down Expand Up @@ -811,7 +810,7 @@ export const m = {
'直接加入人员模板的用户组权限': 'Directly add user group permissions to personnel templates',
'通过组织加入人员模板的用户组权限': 'User group permissions for joining member templates through organization',
'通过人员模板加入': 'Through Member Template',
'输入ID、用户组名、描述等按回车键进行搜索': 'Enter ID, user group name and description, etc. Press Enter to search'
'输入用户组名、描述等按回车键进行搜索': 'Enter user group name and description, etc. Press Enter to search'
},
permTemplate: {
'模板名': 'Template name',
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ export const m = {
'模板名称不能为空': '模板名称不能为空',
'模板成员不能为空': '模板成员不能为空',
'模板名称必填, 不允许输入表情字符': '模板名称必填, 不允许输入表情字符',
'用户组名不允许输入表情字符': '用户组名不允许输入表情字符',
'ID必须是一个正整数': 'ID必须是一个正整数'
'用户组名不允许输入表情字符': '用户组名不允许输入表情字符'
},
info: {
'加入用户组申请成功': '加入用户组申请成功',
Expand Down Expand Up @@ -811,7 +810,7 @@ export const m = {
'直接加入人员模板的用户组权限': '直接加入人员模板的用户组权限',
'通过组织加入人员模板的用户组权限': '通过组织加入人员模板的用户组权限',
'通过人员模板加入': '通过人员模板加入',
'输入ID、用户组名、描述等按回车键进行搜索': '输入ID、用户组名、描述等按回车键进行搜索'
'输入用户组名、描述等按回车键进行搜索': '输入用户组名、描述等按回车键进行搜索'
},
permTemplate: {
'模板名': '模板名',
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/router/ce.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

import il8n from '@/language';
import { rootPath } from '@blueking/sub-saas/dist/main.js';
import { getRoutePath } from '@/common/util';

// const SITE_URL = window.SITE_URL;
Expand Down Expand Up @@ -210,9 +209,11 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404');
// Main
const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views');

const SITE_URL = getRoutePath(window.SITE_URL);

export const routes = [
{
path: rootPath,
path: SITE_URL,
name: 'iamMain',
component: MainEntry,
children: [
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/router/ee.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

import il8n from '@/language';
import { rootPath } from '@blueking/sub-saas/dist/main.js';
import { getRoutePath } from '@/common/util';

// 系统接入
Expand Down Expand Up @@ -208,9 +207,11 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404');
// Main
const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views');

const SITE_URL = getRoutePath(window.SITE_URL);

export const routes = [
{
path: rootPath,
path: SITE_URL,
name: 'iamMain',
component: MainEntry,
children: [
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/router/ieod.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

import il8n from '@/language';
import { rootPath } from '@blueking/sub-saas/dist/main.js';
import { getRoutePath } from '@/common/util';

// 系统接入
Expand Down Expand Up @@ -208,10 +207,13 @@ const NotFound = () => import(/* webpackChunkName: 'none' */ '../views/404');
// Main
const MainEntry = () => import(/* webpackChunkName: 'index' */ '../views');

// 兼容容器化部署外部环境非根路径的path
const SITE_URL = getRoutePath(window.SITE_URL);

export const routes = [
{
// path: window.SITE_URL,
path: rootPath,
path: SITE_URL,
name: 'iamMain',
component: MainEntry,
children: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
:data="searchData"
:value="searchValue"
:quick-search-method="quickSearchMethod"
style="width: 240px; display: inline-block;" />
<div class="refresh-wrapper"
style="width: 240px; display: inline-block;"
/>
<!-- <div class="refresh-wrapper"
v-bk-tooltips="$t(`m.common['刷新']`)"
@click="handleRefresh">
<Icon type="refresh" />
</div>
</div> -->
</div>
</render-search>
<!-- eslint-disable max-len -->
Expand Down Expand Up @@ -361,7 +362,6 @@
showSelectionCount: false
});
this.currentBackup = 1;
this.currentSelectList = [];
this.requestQueueBySys = [];
this.requestQueueByTemplate = [];
this.selection = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
:data="searchData"
:value="searchValue"
:quick-search-method="quickSearchMethod"
style="width: 240px; display: inline-block;" />
<div class="refresh-wrapper"
style="width: 240px; display: inline-block;"
/>
<!-- <div class="refresh-wrapper"
v-bk-tooltips="$t(`m.common['刷新']`)"
@click="handleRefresh">
<Icon type="refresh" />
</div>
</div> -->
</div>
</render-search>
<!-- eslint-disable max-len -->
Expand Down Expand Up @@ -351,7 +352,6 @@
showSelectionCount: false
});
this.currentBackup = 1;
this.currentSelectList = [];
this.requestQueueBySys = [];
this.requestQueueByTemplate = [];
this.selection = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@
}
},
created () {
this.fetchInitData();
this.$once('hook:beforeDestroy', () => {
bus.$off('edit-member-boundary');
});
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/views/perm-apply/apply-join-user-group/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@
remoteMethod: this.handleGradeAdmin
}
],
searchData: [],
enableGroupInstanceSearch: window.ENABLE_GROUP_INSTANCE_SEARCH.toLowerCase() === 'true',
curSelectMenu: '',
curInputText: '',
Expand Down Expand Up @@ -644,7 +645,7 @@
'is_selected': true
}
];
this.searchData = this.enableGroupInstanceSearch ? this.initSearchData.filter(item => ['name', 'id', 'description', 'role_id'].includes(item.id)) : this.initSearchData;
this.searchData = this.enableGroupInstanceSearch ? this.initSearchData.filter(item => ['name', 'id', 'description', 'system_id', 'role_id'].includes(item.id)) : this.initSearchData;
this.setCurrentQueryCache(this.refreshCurrentQuery());
const isObject = (payload) => {
return Object.prototype.toString.call(payload) === '[object Object]';
Expand Down Expand Up @@ -1267,6 +1268,17 @@
// this.requestQueue.shift()
}
},
async handleRemoteSystem (value) {
const params = {};
if (this.externalSystemId) {
params.hidden = false;
}
const result = await this.$store.dispatch('system/getSystems', params).then(({ data }) => {
return data.map(({ id, name }) => ({ id, name })).filter((item) => item.name.indexOf(value) > -1);
});
return result || [];
},
// 管理空间数据
handleGradeAdmin (value) {
Expand Down
10 changes: 1 addition & 9 deletions frontend/src/views/perm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<IamResourceCascadeSearch
ref="iamResourceSearchRef"
:active="active"
:search-select-place-holder="$t(`m.perm['输入ID、用户组名、描述等按回车键进行搜索']`)"
:search-select-place-holder="$t(`m.perm['输入用户组名、描述等按回车键进行搜索']`)"
@on-remote-table="handleRemoteTable"
@on-refresh-table="handleRefreshTable"
@on-input-value="handleInputValue"
Expand Down Expand Up @@ -624,14 +624,6 @@
},
async fetchRemoteTable (isRefreshCurCount = false) {
if (this.curSearchParams.id) {
const exp = /^[1-9]\d*$/;
if (!exp.test(this.curSearchParams.id)) {
this.componentLoading = false;
this.curEmptyData = formatCodeData(0, { ...this.curEmptyData, ...{ tipType: 'search' } }, true);
return this.messageWarn(this.$t(`m.verify['ID必须是一个正整数']`));
}
}
// 这里需要拿到所有tab项的total,所以需要调所有接口, 且需要在当前页动态加载tab的label
const typeMap = {
GroupPerm: async () => {
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/views/user/components/render-depart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
:custom-select-width="customSelectWidth"
:min-select-width="'165px'"
:max-select-width="'200px'"
:search-select-place-holder="$t(`m.perm['输入ID、用户组名、描述等按回车键进行搜索']`)"
:search-select-place-holder="$t(`m.perm['输入用户组名、描述等按回车键进行搜索']`)"
@on-remote-table="handleRemoteTable"
@on-refresh-table="handleRefreshTable"
@on-input-value="handleInputValue"
Expand Down Expand Up @@ -398,13 +398,6 @@
},
async fetchRemoteTable (isRefreshCurCount = false) {
if (this.curSearchParams.id) {
const exp = /^[1-9]\d*$/;
if (!exp.test(this.curSearchParams.id)) {
this.curEmptyData = formatCodeData(0, { ...this.curEmptyData, ...{ tipType: 'search' } }, true);
return this.messageWarn(this.$t(`m.verify['ID必须是一个正整数']`));
}
}
const typeMap = {
GroupPerm: async () => {
this.emptyData = _.cloneDeep(this.curEmptyData);
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/views/user/components/render-user.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:active="active"
:min-select-width="'165px'"
:max-select-width="'200px'"
:search-select-place-holder="$t(`m.perm['输入ID、用户组名、描述等按回车键进行搜索']`)"
:search-select-place-holder="$t(`m.perm['输入用户组名、描述等按回车键进行搜索']`)"
@on-remote-table="handleRemoteTable"
@on-refresh-table="handleRefreshTable"
@on-input-value="handleInputValue"
Expand Down Expand Up @@ -505,13 +505,6 @@
async fetchRemoteTable (isRefreshCurCount = false) {
// 这里需要拿到所有tab项的total,所以需要调所有接口, 且需要在当前页动态加载tab的label
if (this.curSearchParams.id) {
const exp = /^[1-9]\d*$/;
if (!exp.test(this.curSearchParams.id)) {
this.curEmptyData = formatCodeData(0, { ...this.curEmptyData, ...{ tipType: 'search' } }, true);
return this.messageWarn(this.$t(`m.verify['ID必须是一个正整数']`));
}
}
const typeMap = {
GroupPerm: async () => {
this.emptyData = _.cloneDeep(this.curEmptyData);
Expand Down
2 changes: 1 addition & 1 deletion saas/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.32
1.10.33
11 changes: 11 additions & 0 deletions saas/resources/version_log/change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<!-- 2024-09-02 -->
# V1.10.33 版本更新日志

### 缺陷修复

* 申请加入用户组资源实例搜索增加系统筛选
* 组权限添加权限模板去掉刷新icon
* 兼容容器化部署外部环境非根路径的path

---

<!-- 2024-08-22 -->
# V1.10.32 版本更新日志

Expand Down
11 changes: 11 additions & 0 deletions saas/resources/version_log/change_log_en.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<!-- 2024-09-02 -->
# V1.10.33 Version Update Log

### Bug Fixes

* Added system filter to the resource instance search when applying to join a user group.
* Removed the refresh icon from the permission template addition in group permissions.
* Compatible with non-root path deployment in containerized external environments.

---

<!-- 2024-08-22 -->
# V1.10.32 Version Update Log

Expand Down

0 comments on commit a4d8470

Please sign in to comment.