mirror of https://gitee.com/topiam/eiam
Merge remote-tracking branch 'origin/master'
commit
03369ef09a
|
@ -47,7 +47,7 @@
|
|||
"@ant-design/charts": "^1.4.2",
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
"@ant-design/maps": "^1.0.7",
|
||||
"@ant-design/pro-components": "^2.6.18",
|
||||
"@ant-design/pro-components": "^2.6.19",
|
||||
"ahooks": "^3.7.8",
|
||||
"antd": "^5.9.1",
|
||||
"antd-img-crop": "^4.12.2",
|
||||
|
|
|
@ -113,7 +113,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, loading }) => {
|
|||
heightLayoutHeader: showBanner ? 78 : 56,
|
||||
},
|
||||
pageContainer: {
|
||||
paddingBlockPageContainerContent: 12,
|
||||
paddingBlockPageContainerContent: 6,
|
||||
paddingInlinePageContainerContent: 24,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -19,14 +19,17 @@ import { history } from '@@/core/history';
|
|||
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useMount } from 'ahooks';
|
||||
import { App } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import { App, Button } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
import LoginAudit from './components/LoginAudit';
|
||||
import UserInfo from './components/UserInfo';
|
||||
import { UserDetailTabs } from './constant';
|
||||
import queryString from 'query-string';
|
||||
import { useLocation } from '@umijs/max';
|
||||
import { useIntl } from '@@/exports';
|
||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||
import { removeUser } from '@/services/account';
|
||||
import AppAccess from './components/AppAccess';
|
||||
|
||||
export default () => {
|
||||
const location = useLocation();
|
||||
|
@ -38,6 +41,7 @@ export default () => {
|
|||
type: UserDetailTabs;
|
||||
};
|
||||
const [tabActiveKey, setTabActiveKey] = useState<string>();
|
||||
|
||||
useMount(() => {
|
||||
if (!id) {
|
||||
useApp.message
|
||||
|
@ -65,13 +69,49 @@ export default () => {
|
|||
tabList={[
|
||||
{
|
||||
key: UserDetailTabs.user_info,
|
||||
tab: '用户信息',
|
||||
tab: intl.formatMessage({ id: 'pages.account.user_detail.tabs.user_info' }),
|
||||
},
|
||||
{
|
||||
key: UserDetailTabs.app_access,
|
||||
tab: intl.formatMessage({ id: 'pages.account.user_detail.tabs.app_access' }),
|
||||
},
|
||||
{
|
||||
key: UserDetailTabs.login_audit,
|
||||
tab: '登录日志',
|
||||
tab: intl.formatMessage({ id: 'pages.account.user_detail.tabs.login_audit' }),
|
||||
},
|
||||
]}
|
||||
extra={[
|
||||
<Button
|
||||
key="delete"
|
||||
type="primary"
|
||||
danger
|
||||
onClick={() => {
|
||||
const confirmed = useApp.modal.error({
|
||||
centered: true,
|
||||
title: intl.formatMessage({
|
||||
id: 'pages.account.user_detail.extra.delete.confirm_title',
|
||||
}),
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: intl.formatMessage({
|
||||
id: 'pages.account.user_detail.extra.delete.confirm_content',
|
||||
}),
|
||||
okText: intl.formatMessage({ id: 'app.confirm' }),
|
||||
okType: 'danger',
|
||||
okCancel: true,
|
||||
cancelText: intl.formatMessage({ id: 'app.cancel' }),
|
||||
onOk: async () => {
|
||||
const { success } = await removeUser(id);
|
||||
if (success) {
|
||||
useApp.message.success(intl.formatMessage({ id: 'app.operation_success' }));
|
||||
confirmed.destroy();
|
||||
}
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{intl.formatMessage({ id: 'pages.account.user_detail.extra.delete' })}
|
||||
</Button>,
|
||||
]}
|
||||
tabActiveKey={tabActiveKey}
|
||||
onTabChange={(key: string) => {
|
||||
setTabActiveKey(key);
|
||||
|
@ -83,8 +123,10 @@ export default () => {
|
|||
>
|
||||
{/*用户信息*/}
|
||||
{UserDetailTabs.user_info === tabActiveKey && <UserInfo userId={id} />}
|
||||
{/*应用授权*/}
|
||||
{UserDetailTabs.app_access === tabActiveKey && <AppAccess userId={id} />}
|
||||
{/*登录日志*/}
|
||||
{UserDetailTabs.login_audit === tabActiveKey && <LoginAudit id={id} />}
|
||||
{UserDetailTabs.login_audit === tabActiveKey && <LoginAudit userId={id} />}
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -56,7 +56,7 @@ export default (props: { userId: string }) => {
|
|||
padding: 0,
|
||||
},
|
||||
}}
|
||||
headerTitle={intl.formatMessage({ id: 'pages.account.user_detail.access_strategy' })}
|
||||
headerTitle={intl.formatMessage({ id: 'pages.account.user_detail.app_access_title' })}
|
||||
request={getAppAccessPolicyList}
|
||||
params={{ subjectId: userId, subjectType: AccessPolicyType.USER }}
|
||||
rowKey={'id'}
|
|
@ -15,6 +15,6 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import AccessStrategy from './AccessStrategy';
|
||||
import AppAccess from './AppAccess';
|
||||
|
||||
export default AccessStrategy;
|
||||
export default AppAccess;
|
|
@ -24,8 +24,8 @@ import { EventStatus } from '@/pages/audit/data.d';
|
|||
import { getLoginAuditList } from '@/services/account';
|
||||
import { useIntl } from '@umijs/max';
|
||||
|
||||
export default (props: { id: string }) => {
|
||||
const { id } = props;
|
||||
export default (props: { userId: string }) => {
|
||||
const { userId } = props;
|
||||
useEffect(() => {}, []);
|
||||
const intl = useIntl();
|
||||
|
||||
|
@ -97,7 +97,7 @@ export default (props: { id: string }) => {
|
|||
columns={columns}
|
||||
search={false}
|
||||
request={getLoginAuditList}
|
||||
params={{ id }}
|
||||
params={{ userId: userId }}
|
||||
pagination={{ pageSize: 10 }}
|
||||
/>
|
||||
</>
|
||||
|
|
|
@ -31,7 +31,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons';
|
|||
import { omit } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import { ParamCheckType } from '@/constant';
|
||||
import AccessStrategy from '../AccessStrategy';
|
||||
import AppAccess from '../AppAccess';
|
||||
import { useIntl } from '@umijs/max';
|
||||
|
||||
const prefixCls = 'user-detail-info';
|
||||
|
@ -480,8 +480,6 @@ export default (props: { userId: string }) => {
|
|||
toolbar={{ settings: [] }}
|
||||
/>
|
||||
</ProCard>
|
||||
<br />
|
||||
<AccessStrategy userId={userId} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
export enum UserDetailTabs {
|
||||
//用户信息
|
||||
user_info = 'user-info',
|
||||
//权限
|
||||
permission_info = 'permission-info',
|
||||
//应用授权
|
||||
app_access = 'app_access',
|
||||
//登录审计
|
||||
login_audit = 'login-audit',
|
||||
}
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
export default {
|
||||
'pages.account.user_detail.tabs.user_info': '用户信息',
|
||||
'pages.account.user_detail.tabs.login_audit': '登录日志',
|
||||
'pages.account.user_detail.tabs.app_access': '应用权限',
|
||||
'pages.account.user_detail.extra.delete': '删除用户',
|
||||
'pages.account.user_detail.extra.delete.confirm_title': '您确定要删除此用户?',
|
||||
'pages.account.user_detail.extra.delete.confirm_content': '此操作不可恢复,请谨慎操作!',
|
||||
'pages.account.user_detail.user_info': '账户信息',
|
||||
'pages.account.user_detail.user_info.not_selected': '未选择用户',
|
||||
'pages.account.user_detail.user_info.columns.open_id': '显示名',
|
||||
|
@ -73,7 +79,7 @@ export default {
|
|||
'pages.account.user_detail.app_account.columns.option.popconfirm.title':
|
||||
'您确定要删除此应用账户?',
|
||||
|
||||
'pages.account.user_detail.access_strategy': '已授权应用',
|
||||
'pages.account.user_detail.app_access_title': '已授权应用',
|
||||
'pages.account.user_detail.access_strategy.popconfirm.title': '您确定要取消应用授权?',
|
||||
'pages.account.user_detail.access_strategy.popconfirm.remove': '取消授权',
|
||||
};
|
||||
|
|
|
@ -15,19 +15,20 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { getUserGroup, updateUserGroup } from '@/services/account';
|
||||
import { getUserGroup, removeUserGroup, updateUserGroup } from '@/services/account';
|
||||
import { history } from '@@/core/history';
|
||||
|
||||
import { PageContainer, ProDescriptions, RouteContext } from '@ant-design/pro-components';
|
||||
import { useAsyncEffect, useMount } from 'ahooks';
|
||||
import { App, Skeleton } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import { App, Button, Skeleton } from 'antd';
|
||||
import React, { useState } from 'react';
|
||||
import MemberList from './components/MemberList';
|
||||
import { UserGroupDetailTabs } from './constant';
|
||||
import queryString from 'query-string';
|
||||
import { useIntl, useLocation } from '@umijs/max';
|
||||
import useStyles from './style';
|
||||
import AccessStrategy from '@/pages/account/UserGroupDetail/components/AccessStrategy';
|
||||
import AppAccess from './components/AppAccess';
|
||||
import { ExclamationCircleFilled } from '@ant-design/icons';
|
||||
|
||||
/**
|
||||
* 用户组详情
|
||||
|
@ -35,7 +36,7 @@ import AccessStrategy from '@/pages/account/UserGroupDetail/components/AccessStr
|
|||
export default () => {
|
||||
const intl = useIntl();
|
||||
const { styles } = useStyles();
|
||||
const { message } = App.useApp();
|
||||
const { message, modal } = App.useApp();
|
||||
const location = useLocation();
|
||||
const query = queryString.parse(location.search);
|
||||
const { id } = query as { id: string };
|
||||
|
@ -106,7 +107,7 @@ export default () => {
|
|||
<ProDescriptions.Item
|
||||
dataIndex="name"
|
||||
label={intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.pro_descriptions.name',
|
||||
id: 'pages.account.user_group_detail.descriptions.name',
|
||||
})}
|
||||
fieldProps={{
|
||||
maxLength: 8,
|
||||
|
@ -116,14 +117,14 @@ export default () => {
|
|||
<ProDescriptions.Item
|
||||
dataIndex="code"
|
||||
label={intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.pro_descriptions.code',
|
||||
id: 'pages.account.user_group_detail.descriptions.code',
|
||||
})}
|
||||
copyable
|
||||
editable={false}
|
||||
/>
|
||||
<ProDescriptions.Item
|
||||
label={intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.pro_descriptions.remark',
|
||||
id: 'pages.account.user_group_detail.descriptions.remark',
|
||||
})}
|
||||
className={styles.descriptionRemark}
|
||||
dataIndex="remark"
|
||||
|
@ -151,12 +152,44 @@ export default () => {
|
|||
tab: intl.formatMessage({ id: 'pages.account.user_group_detail.tab_list.member' }),
|
||||
},
|
||||
{
|
||||
key: UserGroupDetailTabs.access_policy,
|
||||
key: UserGroupDetailTabs.app_access,
|
||||
tab: intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.tab_list.access_policy',
|
||||
id: 'pages.account.user_group_detail.tab_list.app_access',
|
||||
}),
|
||||
},
|
||||
]}
|
||||
extra={[
|
||||
<Button
|
||||
key="delete"
|
||||
type="primary"
|
||||
danger
|
||||
onClick={() => {
|
||||
const confirmed = modal.error({
|
||||
centered: true,
|
||||
title: intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.extra.delete.confirm_title',
|
||||
}),
|
||||
icon: <ExclamationCircleFilled />,
|
||||
content: intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.extra.delete.confirm_content',
|
||||
}),
|
||||
okText: intl.formatMessage({ id: 'app.confirm' }),
|
||||
okType: 'danger',
|
||||
okCancel: true,
|
||||
cancelText: intl.formatMessage({ id: 'app.cancel' }),
|
||||
onOk: async () => {
|
||||
const { success } = await removeUserGroup(id);
|
||||
if (success) {
|
||||
message.success(intl.formatMessage({ id: 'app.operation_success' }));
|
||||
confirmed.destroy();
|
||||
}
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{intl.formatMessage({ id: 'pages.account.user_group_detail.extra.delete' })}
|
||||
</Button>,
|
||||
]}
|
||||
tabActiveKey={tabActiveKey}
|
||||
onTabChange={(key: string) => {
|
||||
setTabActiveKey(key);
|
||||
|
@ -169,7 +202,7 @@ export default () => {
|
|||
{/*成员信息*/}
|
||||
{type === UserGroupDetailTabs.member && <MemberList id={id} />}
|
||||
{/*授权应用*/}
|
||||
{type === UserGroupDetailTabs.access_policy && <AccessStrategy userGroupId={id} />}
|
||||
{type === UserGroupDetailTabs.app_access && <AppAccess userGroupId={id} />}
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -52,7 +52,7 @@ export default (props: { userGroupId: string }) => {
|
|||
xxl: 5,
|
||||
}}
|
||||
headerTitle={intl.formatMessage({
|
||||
id: 'pages.account.user_group_detail.access_strategy',
|
||||
id: 'pages.account.user_group_detail.app_access_title',
|
||||
})}
|
||||
request={getAppAccessPolicyList}
|
||||
params={{ subjectId: userGroupId, subjectType: AccessPolicyType.USER_GROUP }}
|
|
@ -15,6 +15,6 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import AccessStrategy from './AccessStrategy';
|
||||
import AppAccess from './AppAccess';
|
||||
|
||||
export default AccessStrategy;
|
||||
export default AppAccess;
|
|
@ -19,8 +19,8 @@
|
|||
* UserGroupDetailTabs
|
||||
*/
|
||||
export enum UserGroupDetailTabs {
|
||||
//access_policy
|
||||
access_policy = 'access-policy',
|
||||
//app_access
|
||||
app_access = 'app-access',
|
||||
//权限
|
||||
permission_info = 'permission-info',
|
||||
//member
|
||||
|
|
|
@ -16,21 +16,23 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
export default {
|
||||
'pages.account.user_group_detail.extra.delete': '删除用户组',
|
||||
'pages.account.user_group_detail.extra.delete.confirm_title': '您确定要删除此用户组?',
|
||||
'pages.account.user_group_detail.extra.delete.confirm_content': '此操作不可恢复,请谨慎操作!',
|
||||
'pages.account.user_group_detail.common.username': '用户名称',
|
||||
'pages.account.user_group_detail.common.phone': '手机号',
|
||||
'pages.account.user_group_detail.common.org_display_path': '所属组织',
|
||||
'pages.account.user_group_detail.use_mount.message': '未选择用户组',
|
||||
'pages.account.user_group_detail.pro_descriptions.name': '名称',
|
||||
'pages.account.user_group_detail.pro_descriptions.code': '编码',
|
||||
'pages.account.user_group_detail.pro_descriptions.remark': '备注',
|
||||
'pages.account.user_group_detail.descriptions.name': '名称',
|
||||
'pages.account.user_group_detail.descriptions.code': '编码',
|
||||
'pages.account.user_group_detail.descriptions.remark': '备注',
|
||||
'pages.account.user_group_detail.tab_list.rule': '规则配置',
|
||||
'pages.account.user_group_detail.tab_list.member': '成员信息',
|
||||
'pages.account.user_group_detail.tab_list.access_policy': '授权应用',
|
||||
'pages.account.user_group_detail.tab_list.app_access': '应用权限',
|
||||
'pages.account.user_group_detail.tab_list.permission_info': '权限管理',
|
||||
'pages.account.user_group_detail.access_strategy': '已授权应用',
|
||||
'pages.account.user_group_detail.access_strategy.metas.popconfirm.title':
|
||||
'您确定要取消应用授权?',
|
||||
'pages.account.user_group_detail.access_strategy.metas.popconfirm.remove': '取消授权',
|
||||
'pages.account.user_group_detail.app_access_title': '已授权应用',
|
||||
'pages.account.user_group_detail.app_access.remove.popconfirm.title': '您确定要取消应用授权?',
|
||||
'pages.account.user_group_detail.app_access.remove.popconfirm.remove': '取消授权',
|
||||
'pages.account.user_group_detail.add_member.columns.username': '用户名称',
|
||||
'pages.account.user_group_detail.add_member.columns.full_name': '用户姓名',
|
||||
'pages.account.user_group_detail.add_member.drawer_form.title': '添加成员',
|
||||
|
|
|
@ -64,7 +64,7 @@ const CreateApp = (props: {
|
|||
|
||||
useAsyncEffect(async () => {
|
||||
if (open) {
|
||||
form?.setFieldsValue({ name: `${name} 应用` });
|
||||
form?.setFieldsValue({ name: `${name}` });
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
|
@ -108,7 +108,7 @@ const CreateApp = (props: {
|
|||
onOk: () => {
|
||||
successModal.destroy();
|
||||
history.push(
|
||||
`/app/config?id=${result.id}&name=${values.name}&protocol=${protocol}`,
|
||||
`/app/detail?id=${result.id}&name=${values.name}&protocol=${protocol}`,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -22,6 +22,7 @@ export default {
|
|||
'pages.app.list.tool_bar_render.add_app': '添加应用',
|
||||
'pages.app.list.metas.title': '应用名称',
|
||||
'pages.app.list.metas.group': '应用分组',
|
||||
'pages.app.list.actions.detail': '详情',
|
||||
'pages.app.list.actions.popconfirm.disable_app': '确定禁用该应用吗?',
|
||||
'pages.app.list.actions.popconfirm.enable_app': '确定启用该应用吗?',
|
||||
'pages.app.list.actions.popconfirm.delete_app': '您确定要删除此应用?',
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { download, filterParamConverter, sortParamConverter } from '@/utils/utils';
|
||||
import { filterParamConverter, sortParamConverter } from '@/utils/utils';
|
||||
import type { RequestData } from '@ant-design/pro-components';
|
||||
import type { SortOrder } from 'antd/es/table/interface';
|
||||
import { request } from '@umijs/max';
|
||||
|
@ -62,27 +62,16 @@ export async function getAppConfig(id: string): Promise<API.ApiResult<Record<str
|
|||
}
|
||||
|
||||
/**
|
||||
* 下载 IDP SAML2 元数据
|
||||
* Remove Application
|
||||
*/
|
||||
export async function downloadIdpSaml2AppMetadata(id: string): Promise<void> {
|
||||
let fileName = '';
|
||||
request(`/api/v1/app/saml2/download/idp_metadata_file`, {
|
||||
method: 'GET',
|
||||
params: { appId: id },
|
||||
responseType: 'blob',
|
||||
getResponse: true,
|
||||
})
|
||||
.then((res) => {
|
||||
fileName = res.headers['content-disposition'] || res.headers['Content-Disposition'];
|
||||
return res.data;
|
||||
})
|
||||
.then((res) => {
|
||||
download(new Blob([res]), fileName);
|
||||
});
|
||||
export async function removeApp(id: string): Promise<API.ApiResult<boolean>> {
|
||||
return request<API.ApiResult<boolean>>(`/api/v1/app/delete/${id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Saml2 Config
|
||||
* Save App Config
|
||||
*/
|
||||
export async function saveAppConfig(
|
||||
values: Record<string, any>,
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"@ant-design/charts": "^1.4.2",
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
"@ant-design/maps": "^1.0.7",
|
||||
"@ant-design/pro-components": "^2.6.18",
|
||||
"@ant-design/pro-components": "^2.6.19",
|
||||
"ahooks": "^3.7.8",
|
||||
"antd": "^5.9.1",
|
||||
"antd-img-crop": "^4.12.2",
|
||||
|
|
|
@ -117,7 +117,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, loading }) => {
|
|||
heightLayoutHeader: showBanner ? 78 : 56,
|
||||
},
|
||||
pageContainer: {
|
||||
paddingBlockPageContainerContent: 12,
|
||||
paddingBlockPageContainerContent: 6,
|
||||
paddingInlinePageContainerContent: 24,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue