66 lines
2.9 KiB
React
66 lines
2.9 KiB
React
/*
|
||
Copyright (C) 2025 QuantumNous
|
||
|
||
This program is free software: you can redistribute it and/or modify
|
||
it under the terms of the GNU Affero General Public License as
|
||
published by the Free Software Foundation, either version 3 of the
|
||
License, or (at your option) any later version.
|
||
|
||
This program is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU Affero General Public License for more details.
|
||
|
||
You should have received a copy of the GNU Affero General Public License
|
||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
||
For commercial licensing, please contact support@quantumnous.com
|
||
*/
|
||
import React from 'react';
|
||
import { useTranslation } from 'react-i18next';
|
||
import { Tabs, TabPane } from '@douyinfe/semi-ui';
|
||
import OrgDsPolicy from './datasecurity/OrgDsPolicy';
|
||
import OrgDsRules from './datasecurity/OrgDsRules';
|
||
import OrgDsTest from './datasecurity/OrgDsTest';
|
||
import OrgDsHitLogs from './datasecurity/OrgDsHitLogs';
|
||
import OrgDsChanges from './datasecurity/OrgDsChanges';
|
||
|
||
// OrgDataSecurity 企业自助数据安全 tab(/org/settings,功能开关 data_security 控制)。
|
||
// 五个子 tab:策略配置(覆盖平台默认,只能收紧)/ 自定义规则(企业私有,只增加检测项)/
|
||
// 脱敏测试 / 命中审计(本企业口径统计+明细)/ 变更记录(审批与生效留痕)。
|
||
// 父组件以 key={orgId} 挂载,切换企业时整棵子树重挂载,各子 tab 无跨企业残留。
|
||
// lazyRender:只在首次激活时挂载子 tab,避免一进页面并发拉全部数据。
|
||
// 页签形态:这是「企业设置」一级页签里的下一层,必须与一级的下划线页签区分开,
|
||
// 所以走 button 型 + .org-nested-tabs(styles/org.css 第 6 节)的分段控件观感;
|
||
// 两层都用 line 型时上下两条页签条完全同形,用户读不出层级。
|
||
const OrgDataSecurity = ({ orgId, isSuperAdmin, refreshVersion = 0 }) => {
|
||
const { t } = useTranslation();
|
||
return (
|
||
<div className='org-nested-tabs'>
|
||
<Tabs type='button' lazyRender keepDOM>
|
||
<TabPane tab={t('策略配置')} itemKey='policy'>
|
||
<OrgDsPolicy
|
||
orgId={orgId}
|
||
isSuperAdmin={isSuperAdmin}
|
||
refreshVersion={refreshVersion}
|
||
/>
|
||
</TabPane>
|
||
<TabPane tab={t('自定义规则')} itemKey='rules'>
|
||
<OrgDsRules orgId={orgId} isSuperAdmin={isSuperAdmin} />
|
||
</TabPane>
|
||
<TabPane tab={t('脱敏测试')} itemKey='test'>
|
||
<OrgDsTest orgId={orgId} />
|
||
</TabPane>
|
||
<TabPane tab={t('命中审计')} itemKey='hitlogs'>
|
||
<OrgDsHitLogs orgId={orgId} />
|
||
</TabPane>
|
||
<TabPane tab={t('变更记录')} itemKey='changes'>
|
||
<OrgDsChanges orgId={orgId} />
|
||
</TabPane>
|
||
</Tabs>
|
||
</div>
|
||
);
|
||
};
|
||
|
||
export default OrgDataSecurity;
|