feat: login en and happy work (#1479)

* stash code

* fix active router

* feat: login en and happy work

---------

Co-authored-by: yikai <yikai@didiglobal.com>
pull/1480/head
bobowiki 9 months ago committed by GitHub
parent 159fd9cbad
commit f70fee636c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"@ahooksjs/use-url-state": "^3.5.1",
"@ant-design/happy-work-theme": "^1.0.0",
"@ant-design/icons": "^5.2.6",
"@tanem/react-nprogress": "^5.0.51",
"@testing-library/jest-dom": "^5.16.5",
@ -13,6 +14,8 @@
"antd": "^5.4.7",
"classnames": "^2.3.2",
"dayjs": "^1.11.9",
"echarts": "^5.4.3",
"echarts-for-react": "^3.0.2",
"i18next": "^23.5.1",
"i18next-browser-languagedetector": "^7.1.0",
"lodash": "^4.17.21",

@ -6,6 +6,7 @@ import { MenuProps } from 'antd';
import { useTran } from './hooks';
import { STR_MAP } from './config/i18n/locales/constants';
import IconFont from './components/icon';
import { HappyProvider } from '@ant-design/happy-work-theme';
type MenuItem = Required<MenuProps>['items'][number];
@ -16,39 +17,44 @@ const App = () => {
key: STR_MAP.DYNAMIC_THREAD_POOL,
icon: <IconFont type="icon-hot-for-ux"></IconFont>,
children: [
{ label: <Link to={'/thread-poll/index'}>{useTran(STR_MAP.THREAD_POOL)}</Link>, key: '/thread-poll/index' },
{
label: <Link to={'/thread-poll/index'}>{useTran(STR_MAP.THREAD_POOL_MANAGE)}</Link>,
key: '/thread-poll/index',
},
],
},
{
label: <Link to={'/tenant'}>{useTran(STR_MAP.TENANT_MANAGE)}</Link>,
key: STR_MAP.TENANT_MANAGE,
key: '/tenant',
icon: <IconFont type="icon-hot-for-ux"></IconFont>,
},
{
label: <Link to={'/item'}>{useTran(STR_MAP.PROJECT_MANAGE)}</Link>,
key: STR_MAP.PROJECT_MANAGE,
key: '/item',
icon: <IconFont type="icon-hot-for-ux"></IconFont>,
},
{
label: <Link to={'/user'}>{useTran(STR_MAP.USER_MANAGE)}</Link>,
key: STR_MAP.USER_MANAGE,
key: '/user',
icon: <IconFont type="icon-hot-for-ux"></IconFont>,
},
{
label: <Link to={'/log'}>{useTran(STR_MAP.LOG_MANAGE)}</Link>,
key: STR_MAP.LOG_MANAGE,
key: '/log',
icon: <IconFont type="icon-hot-for-ux"></IconFont>,
},
];
return (
<LayoutCom sideMenuList={sideMenuList}>
<Routes>
{routeList.map(item => (
<Route key={item.path} path={item.path} Component={item.component} />
))}
</Routes>
</LayoutCom>
<HappyProvider>
<LayoutCom sideMenuList={sideMenuList}>
<Routes>
{routeList.map(item => (
<Route key={item.path} path={item.path} Component={item.component} />
))}
</Routes>
</LayoutCom>
</HappyProvider>
);
};

@ -39,7 +39,7 @@ const HeaderChild = () => {
return (
<div className={style['header-wrapper']}>
<div className={style['logo']} onClick={() => navigate('/home')}>
<img src="https://nageoffer.com/img/logo3.png" alt="" />
<img src="https://nageoffer.com/img/logo3.png" alt="" style={{ cursor: 'pointer' }} />
</div>
<div className={style['edit-container']}>
<Row gutter={[16, 16]}>

@ -0,0 +1,3 @@
// .custom-icon {
// color: red !important;
// }

@ -1,15 +1,15 @@
import { createFromIconfontCN } from '@ant-design/icons';
interface Props {
type: string;
}
import React from 'react';
import style from './index.module.less';
const MyIcon = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/c/font_4254722_3l4m6by7h34.js', // 在 iconfont.cn 上生成
scriptUrl: '//at.alicdn.com/t/c/font_4254722_vw34zn7su2.js', // 在 iconfont.cn 上生成
});
const IconFont = (props: Props) => {
return <MyIcon {...props}></MyIcon>;
type MyComponentProps = React.HTMLProps<HTMLDivElement> & { type: string };
const IconFont: React.FC<MyComponentProps> = props => {
return <MyIcon className={style['custom-icon']} {...props}></MyIcon>;
};
export default IconFont;

@ -0,0 +1,27 @@
import { Button, ButtonProps } from 'antd';
import React from 'react';
import { SearchOutlined, PlusOutlined, RedoOutlined } from '@ant-design/icons';
function withSearchIconButton<P extends ButtonProps>(WrappedComponent: React.ComponentType<P>) {
return function EnhancedComponent(props: P) {
return <WrappedComponent icon={<SearchOutlined></SearchOutlined>} {...props} />;
};
}
function withAddIconButton<P extends ButtonProps>(WrappedComponent: React.ComponentType<P>) {
return function EnhancedComponent(props: P) {
return <WrappedComponent icon={<PlusOutlined />} {...props}></WrappedComponent>;
};
}
function withResetIconButton<P extends ButtonProps>(WrappedComponent: React.ComponentType<P>) {
return function EnhancedComponent(props: P) {
return <WrappedComponent {...props} icon={<RedoOutlined />}></WrappedComponent>;
};
}
export const SearchButton = withSearchIconButton(Button);
export const AddButton = withAddIconButton(Button);
export const ResetButton = withResetIconButton(Button);

@ -1,4 +1,5 @@
export enum STR_MAP {
GLOBAL_TITLE = 'globalTitle',
DYNAMIC_THREAD_POOL = 'dynamicThreadPool',
THREAD_POOL_MANAGE = 'threadPoolManage',
PROJECT = 'project',
@ -15,10 +16,21 @@ export enum STR_MAP {
EXECUTION_TIMEOUT = 'executionTimeout',
ALARM_OR_NOT = 'alarmOrNot',
CREATION_TIME = 'creationTime',
UPDATE_TIME = 'update time',
UPDATE_TIME = 'updateTime',
EDIT = 'edit',
TENANT_MANAGE = 'tenantManage',
LOG_MANAGE = 'logManage',
PROJECT_MANAGE = 'projectManage',
USER_MANAGE = 'userManage',
LOGIN_SUCCESSFUL = 'loginSuccessful',
USER_INPUT_MESSAGE = 'userInputMessage',
USRE_NAME = 'username',
PASSWORD_INPUT_MESSAGE = 'passwordInputMessage',
REMERBER_PASSWORD = 'rememberPassWord',
FORGOT_PASSWORD = 'forgotPassword',
ACCOUNT_PASSWORD_LOGIN = 'accountPasswordLogin',
PASSWOR = 'password',
LOGIN = 'login',
PHONE_LOGIN = 'phoneLogin',
ALARM_EDITING_SUCCESS = 'alarmEditingSuccess',
}

@ -23,6 +23,18 @@ const enTranslationMap: { [key: string]: string } = {
[STR_MAP.PROJECT_MANAGE]: 'project management',
[STR_MAP.USER_MANAGE]: 'user management',
[STR_MAP.LOG_MANAGE]: 'log management',
[STR_MAP.LOGIN_SUCCESSFUL]: 'login successful',
[STR_MAP.USER_INPUT_MESSAGE]: 'please enter your username',
[STR_MAP.USRE_NAME]: 'username',
[STR_MAP.PASSWORD_INPUT_MESSAGE]: 'please enter password',
[STR_MAP.REMERBER_PASSWORD]: 'remember the password',
[STR_MAP.FORGOT_PASSWORD]: 'forgot password',
[STR_MAP.ACCOUNT_PASSWORD_LOGIN]: 'account password login',
[STR_MAP.GLOBAL_TITLE]: `The world's best thread pool management tool`,
[STR_MAP.PASSWOR]: 'password',
[STR_MAP.LOGIN]: 'login',
[STR_MAP.PHONE_LOGIN]: 'Mobile login',
[STR_MAP.ALARM_EDITING_SUCCESS]: 'alarm editing success',
};
export default enTranslationMap;

@ -23,6 +23,18 @@ const zhTranslationMap: { [key: string]: string } = {
[STR_MAP.PROJECT_MANAGE]: '项目管理',
[STR_MAP.USER_MANAGE]: '用户权限',
[STR_MAP.LOG_MANAGE]: '日志管理',
[STR_MAP.LOGIN_SUCCESSFUL]: '登录成功',
[STR_MAP.USER_INPUT_MESSAGE]: '请输入用户名',
[STR_MAP.USRE_NAME]: '用户名',
[STR_MAP.PASSWORD_INPUT_MESSAGE]: '请输入密码',
[STR_MAP.REMERBER_PASSWORD]: '记住密码',
[STR_MAP.FORGOT_PASSWORD]: '忘记密码',
[STR_MAP.ACCOUNT_PASSWORD_LOGIN]: '账号密码登录',
[STR_MAP.GLOBAL_TITLE]: `全球最好用的线程池管理工具`,
[STR_MAP.PASSWOR]: '密码',
[STR_MAP.LOGIN]: '登录',
[STR_MAP.PHONE_LOGIN]: '手机号登录',
[STR_MAP.ALARM_EDITING_SUCCESS]: '报警编辑成功',
};
export default zhTranslationMap;

@ -22,7 +22,7 @@ export const darkAlgorithm = {
// padding: 10,
// paddingXS: 5,
// margin: 0,
// fontSize: 14,
// cellFontSize: 12,
// colorBorderSecondary: darkDefaultTheme.borderColor.bl1,
// paddingContentVerticalLG: 4,
},

@ -20,7 +20,7 @@ export const defaultAlgorithm = {
// padding: 10,
// paddingXS: 5,
// margin: 0,
// fontSize: 14,
// cellFontSize: 12,
// colorBorderSecondary: lightDefaultTheme.borderColor.bl1,
// paddingContentVerticalLG: 4,
},

@ -122,7 +122,6 @@ const Tenant: React.FC = () => {
</Form>
<Table
{...tableProps}
bordered
rowKey="index"
scroll={{ x: 1000 }}
columns={[

@ -96,7 +96,6 @@ const Tenant: React.FC = () => {
</Form>
<Table
{...tableProps}
bordered
rowKey="id"
scroll={{ x: 1000 }}
columns={[

@ -6,6 +6,8 @@ import style from './index.module.less';
import { useRequest } from 'ahooks';
import { setToken } from '@/utils';
import { useNavigate } from 'react-router-dom';
import { STR_MAP } from '@/config/i18n/locales/constants';
import { useTranslation } from 'react-i18next';
const { Paragraph } = Typography;
@ -19,12 +21,13 @@ const Login = () => {
const navigate = useNavigate();
const { validateFields } = form;
const [remenberMe, setRemenberMe] = useState(0);
const { t } = useTranslation();
const { run, loading } = useRequest(service.fetchLogin, {
manual: true,
onSuccess: res => {
if (res) {
message.success('登陆成功');
message.success(t(STR_MAP.LOGIN_SUCCESSFUL));
navigate('/thread-poll/index');
setToken(res?.data);
}
@ -54,12 +57,12 @@ const Login = () => {
rules={[
{
required: true,
message: '请输入用户名!',
message: t(STR_MAP.USER_INPUT_MESSAGE),
},
]}
>
<Input
placeholder="用户名"
placeholder={t(STR_MAP.USER_INPUT_MESSAGE)}
prefix={<UserOutlined className={'prefixIcon'} />}
size="large"
allowClear
@ -71,12 +74,12 @@ const Login = () => {
rules={[
{
required: true,
message: '请输入密码!',
message: t(STR_MAP.PASSWORD_INPUT_MESSAGE),
},
]}
>
<Input.Password
placeholder="密码"
placeholder={t(STR_MAP.PASSWORD_INPUT_MESSAGE)}
prefix={<LockOutlined className={'prefixIcon'} />}
size="large"
allowClear
@ -91,9 +94,9 @@ const Login = () => {
setRemenberMe(e.target.checked ? 1 : 0);
}}
>
{t(STR_MAP.REMERBER_PASSWORD)}
</Checkbox>
<Button type="link"></Button>
<a>{t(STR_MAP.FORGOT_PASSWORD)}</a>
</div>
</Form.Item>
<Form.Item>
@ -105,23 +108,23 @@ const Login = () => {
onClick={handleLogin}
loading={loading}
>
{t(STR_MAP.LOGIN)}
</Button>
</Form.Item>
</Form>
),
[form, loading, handleLogin]
[form, loading, handleLogin, t]
);
const items: TabsProps['items'] = [
{
key: TABS_KEY.LOGIN,
label: '账号密码登陆',
label: t(STR_MAP.ACCOUNT_PASSWORD_LOGIN),
children: formNode,
},
{
key: TABS_KEY.PHONE,
label: '手机号登陆',
label: t(STR_MAP.PHONE_LOGIN),
children: formNode,
},
];
@ -132,7 +135,7 @@ const Login = () => {
<div className={style['img-wrapper']}>
<img src="https://nageoffer.com/img/logo3.png" alt="" />
</div>
<Paragraph className={style['tip']}>线</Paragraph>
<Paragraph className={style['tip']}>{t(STR_MAP.GLOBAL_TITLE)}</Paragraph>
<div className={style['form-content']}>
<Tabs centered defaultActiveKey={TABS_KEY.LOGIN} items={items} />
</div>

@ -109,7 +109,6 @@ const Tenant: React.FC = () => {
</Form>
<Table
{...tableProps}
bordered
rowKey="id"
columns={[
...baseColumns,

@ -0,0 +1,34 @@
import * as echarts from 'echarts/core';
import { GridComponent } from 'echarts/components';
import { LineChart } from 'echarts/charts';
import { UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';
import { useEffect } from 'react';
echarts.use([GridComponent, LineChart, CanvasRenderer, UniversalTransition]);
const ThreadPoolMonitor = () => {
useEffect(() => {
let chartDom = document.getElementById('main');
let myChart = echarts.init(chartDom);
let option;
option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
},
yAxis: {
type: 'value',
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line',
},
],
};
option && myChart.setOption(option);
});
return <div id="main" style={{ width: '400px', height: '400px' }}></div>;
};
export default ThreadPoolMonitor;

@ -0,0 +1,11 @@
import { IRouterList } from '@/typings';
import ThreadPoolMonitor from '.';
const routerList: IRouterList[] = [
{
path: '/echarts',
component: ThreadPoolMonitor,
},
];
export default routerList;

@ -0,0 +1,23 @@
export const QUEUE_TYPE_MAP: { [key: string]: string } = {
'1': 'ArrayBlockingQueue',
'2': 'LinkedBlockingQueue',
'3': 'LinkedBlockingDeque',
'4': 'SynchronousQueue',
'5': 'LinkedTransferQueue',
'6': 'PriorityBlockingQueue',
'9': 'ResizableLinkedBlockingQueue',
};
export const REJECT_TYPE_MAP: { [key: string]: string } = {
'1': 'CallerRunsPolicy',
'2': 'AbortPolicy',
'3': 'DiscardPolicy',
'4': 'DiscardOldestPolicy',
'5': 'RunsOldestTaskPolicy',
'6': 'SyncPutQueuePolicy',
};
export const paramsType = { project: 0, thpool: 0 };
export const eBtnStyle = {
padding: '0 6px',
};

@ -1,73 +1,162 @@
import { Button, Form, Select, Space, Table, Typography } from 'antd';
import { Button, Form, Select, Space, Switch, Table, Typography, message } from 'antd';
import { useFormStateToUrl, useTran } from '@/hooks';
import { STR_MAP } from '@/config/i18n/locales/constants';
import { ColumnProps } from 'antd/es/table';
import { SearchButton, AddButton } from '@/components/with-button';
import { useAntdTable } from 'ahooks';
import service from './service';
import { Result, Record } from './type';
import { QUEUE_TYPE_MAP, REJECT_TYPE_MAP, eBtnStyle, paramsType } from './constants';
import { useTranslation } from 'react-i18next';
import request from '@/utils';
const { Title } = Typography;
const { Item } = Form;
const params = { project: 0, thpool: 0 };
interface CustomTableParams {
pageSize: number;
current: number;
tpId: string;
itemId: string;
}
const ThreadPoll = () => {
const [form] = Form.useForm();
const { handleSetUrlState } = useFormStateToUrl<{ project: number; thpool: number }>(form, params);
const columns: ColumnProps<any>[] = [
const { handleSetUrlState } = useFormStateToUrl<{ project: number; thpool: number }>(form, paramsType);
const { t } = useTranslation();
const columns: ColumnProps<Record>[] = [
{
title: useTran(STR_MAP.SERIAL_NUMBER),
dataIndex: 'order',
dataIndex: '',
render: (col, num, index) => {
return index + 1;
},
fixed: 'left',
width: 80,
},
{
title: useTran(STR_MAP.PROJECT),
dataIndex: 'project',
dataIndex: 'tenantId',
width: 150,
},
{
title: useTran(STR_MAP.TENANTRY),
dataIndex: 'tenantry',
title: useTran(STR_MAP.THREAD_POOL),
dataIndex: 'tpId',
width: 150,
},
{
title: useTran(STR_MAP.THREAD_POOL),
dataIndex: 'thread_pool',
title: useTran(STR_MAP.CORE_THREAD),
dataIndex: 'coreSize',
render: col => <span style={{ color: 'green' }}>{col}</span>,
width: 100,
},
{
title: useTran(STR_MAP.MAXIMUM_THREAD),
dataIndex: 'maximum_thread',
dataIndex: 'maxSize',
render: col => <span style={{ color: 'red' }}>{col}</span>,
width: 100,
},
{
title: useTran(STR_MAP.QUEUE_TYPE),
dataIndex: 'queue_type',
dataIndex: 'queueType',
render: (col: number) => QUEUE_TYPE_MAP[String(col)],
width: 150,
},
{
title: useTran(STR_MAP.QUEUE_CAPACITY),
dataIndex: 'capacity',
width: 150,
},
{
title: useTran(STR_MAP.REJECTION_STRATEGY),
dataIndex: 'tenantry',
dataIndex: 'rejectedType',
render: (col: number) => REJECT_TYPE_MAP[String(col)] ?? 'CustomRejectedPolicy_' + col,
width: 150,
},
{
title: useTran(STR_MAP.EXECUTION_TIMEOUT),
dataIndex: 'tenantry',
dataIndex: 'executeTimeOut',
render: (col: number) => col ?? 0,
width: 100,
},
{
title: useTran(STR_MAP.ALARM_OR_NOT),
dataIndex: 'tenantry',
dataIndex: 'isAlarm',
render: (col: number, row) => (
<Switch checked={Boolean(col)} onChange={() => handleAlarm({ id: row?.id, alarm: Number(!col) })} />
),
width: 100,
},
{
title: useTran(STR_MAP.CREATION_TIME),
dataIndex: 'tenantry',
dataIndex: 'gmtCreate',
width: 150,
align: 'center',
},
{
title: useTran(STR_MAP.UPDATE_TIME),
dataIndex: 'tenantry',
dataIndex: 'gmtModified',
width: 150,
align: 'center',
},
{
title: useTran(STR_MAP.EDIT),
dataIndex: 'tenantry',
dataIndex: 'eidt',
fixed: 'right',
width: 150,
render: () => (
<>
<Button type="link" style={eBtnStyle}>
</Button>
<Button type="link" style={eBtnStyle}>
</Button>
</>
),
},
];
const handleSubmit = () => {
handleSetUrlState();
const getTableData = (params: CustomTableParams): Promise<Result> => {
const { pageSize, current } = params;
return service.fetchThreadPoolTable({
current,
size: pageSize,
tpId: '',
itemId: '',
});
};
const { tableProps, search } = useAntdTable(getTableData, {
defaultPageSize: 5,
form: form,
});
const { submit } = search;
const handleAlarm = async (params: { id: string; alarm: number }) => {
const { id, alarm } = params;
request(`/hippo4j/v1/cs/thread/pool/alarm/enable/${id}/${alarm}`, {
method: 'post',
})
.then(res => {
if (res.success) {
message.success(t(STR_MAP.ALARM_EDITING_SUCCESS));
submit();
}
})
.catch(err => {
console.log('err:::', err);
});
};
return (
<Space direction="vertical" style={{ width: '100%' }} size="large">
<Title>{useTran(STR_MAP.THREAD_POOL)}</Title>
<Space direction="vertical" size="large" style={{ display: 'flex' }}>
<Title>{useTran(STR_MAP.THREAD_POOL_MANAGE)}</Title>
<Form form={form} layout="inline">
<Item name="tenatIds" style={{ flex: 1 }}>
<Select options={[{ label: '哈哈哈', value: 1 }]} placeholder={useTran(STR_MAP.PROJECT)}></Select>
</Item>
<Item name="project" style={{ flex: 1 }}>
<Select options={[{ label: '哈哈哈', value: 1 }]} placeholder={useTran(STR_MAP.PROJECT)}></Select>
</Item>
@ -76,14 +165,21 @@ const ThreadPoll = () => {
</Item>
<Item style={{ flex: 4 }}>
<Space>
<Button type="primary" htmlType="submit" onClick={handleSubmit}>
<SearchButton
type="primary"
htmlType="submit"
onClick={() => {
submit();
handleSetUrlState();
}}
>
{useTran(STR_MAP.SEARCH)}
</Button>
<Button type="primary">{useTran(STR_MAP.ADD)}</Button>
</SearchButton>
<AddButton type="primary">{useTran(STR_MAP.ADD)}</AddButton>
</Space>
</Item>
</Form>
<Table columns={columns}></Table>
<Table scroll={{ x: 1300 }} columns={columns} {...tableProps}></Table>
</Space>
);
};

@ -0,0 +1,17 @@
import request from '@/utils';
import { Result, ThreadPoolTableBody, ThreadPoolTableRes } from './type';
const fetchThreadPoolTable = async (body: ThreadPoolTableBody): Promise<Result> => {
const { data } = await request<ThreadPoolTableRes>('/hippo4j/v1/cs/thread/pool/query/page', {
method: 'POST',
body,
});
return {
total: data?.total,
list: data?.records,
};
};
export default {
fetchThreadPoolTable,
};

@ -0,0 +1,123 @@
import { Params } from 'ahooks/lib/useAntdTable/types';
// body
export interface ThreadPoolTableBody {
/**
* current page
*/
current: number;
/**
* project id
*/
itemId?: string;
/**
* page size
*/
size: number;
/**
*tenant Id
*/
tenantId?: string;
/**
* thread pool ID
*/
tpId?: string;
}
export interface Record {
/**
*
*/
allowCoreThreadTimeOut?: number;
/**
*
*/
capacity?: number;
/**
*
*/
capacityAlarm?: number;
/**
* 线
*/
coreSize?: number;
/**
*
*/
executeTimeOut?: number;
/**
*
*/
gmtCreate?: string;
/**
*
*/
gmtModified?: string;
/**
* ID
*/
id: string;
/**
*
*/
isAlarm?: number;
/**
* ID
*/
itemId?: string;
/**
*
*/
keepAliveTime?: number;
/**
*
*/
livenessAlarm?: number;
/**
* 线
*/
maxSize?: number;
/**
*
*/
queueName?: null;
/**
*
*/
queueType?: number;
/**
*
*/
rejectedType?: number;
/**
* ID
*/
tenantId?: string;
/**
* 线ID
*/
tpId?: string;
}
export interface ThreadPoolTableRes {
countId: null;
current: number;
desc: boolean;
hitCount: boolean;
itemId: string;
maxLimit: null;
optimizeCountSql: boolean;
orders: string[];
pages: number;
records: Record[];
searchCount: boolean;
size: number;
tenantId: string;
total: number;
tpId: string;
}
export interface Result {
total: number;
list: Record[];
}

@ -109,7 +109,6 @@ const Tenant: React.FC = () => {
</Form>
<Table
{...tableProps}
bordered
rowKey="index"
columns={[
...baseColumns,

@ -7,6 +7,7 @@ import LoginRouter from '@/page/login/router';
import itemRouter from '@/page/item/router';
import userRouter from '@/page/user/router';
import logRouter from '@/page/log/router';
import ThreadPoolMonitorRouter from '@/page/thread-pool-monitor/router';
const routerList: IRouterList[] = [
...homeRouter,
@ -17,5 +18,6 @@ const routerList: IRouterList[] = [
...itemRouter,
...userRouter,
...logRouter,
...ThreadPoolMonitorRouter,
];
export default routerList;

@ -24,7 +24,7 @@ interface RequestOptions {
type Response<T = any> = {
success: boolean;
data?: T;
data: T;
module?: T;
msg?: string;
status?: number;
@ -41,6 +41,7 @@ const inital: RequestOptions = {
headers: {
'Content-Type': 'application/json',
},
// headers,
credentials: true,
responseType: 'JSON',
cache: 'no-cache',
@ -89,6 +90,7 @@ function request<T>(url: string, config: RequestOptions): Promise<Response<T>> {
} else {
config.headers = { Authorization: getToken(), 'Content-Type': 'application/json' };
}
let { method, params, body, headers, credentials, responseType } = Object.assign({}, inital, config) as any;
if (typeof url !== 'string') throw new TypeError('url is not an string');
if (!/^http(s?):\/\//i.test(url)) url = baseURL + url;

@ -41,7 +41,7 @@
dependencies:
"@ctrl/tinycolor" "^3.4.0"
"@ant-design/cssinjs@^1.16.0":
"@ant-design/cssinjs@^1.16.0", "@ant-design/cssinjs@^1.16.1":
version "1.17.0"
resolved "https://registry.npmmirror.com/@ant-design/cssinjs/-/cssinjs-1.17.0.tgz#a3f69cf5131539b76ccdbfced43d242557599fea"
integrity sha512-MgGCZ6sfD3yQB0XW0hN4jgixMxApTlDYyct+pc7fRZNO4CaqWWm/9iXkkljNR27lyWLZmm+XiDfcIOo1bnrnMA==
@ -54,6 +54,18 @@
rc-util "^5.35.0"
stylis "^4.0.13"
"@ant-design/happy-work-theme@^1.0.0":
version "1.0.0"
resolved "https://registry.npmmirror.com/@ant-design/happy-work-theme/-/happy-work-theme-1.0.0.tgz#b18e2d2cb37df496def5c5773c146885c6cac87c"
integrity sha512-BKuz5PZkGZwXqzDwTE9fiHYlpKdDyoGnApEih2MG1GF79/a/YekxBc4tdqocykDtWzt3z1wwmHv8AiB7EUTWsQ==
dependencies:
"@ant-design/cssinjs" "^1.16.1"
"@babel/runtime" "^7.18.3"
"@ctrl/tinycolor" "^3.6.0"
classnames "^2.3.2"
rc-motion "^2.7.3"
rc-util "^5.33.0"
"@ant-design/icons-svg@^4.3.0":
version "4.3.1"
resolved "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.3.1.tgz#4b2f65a17d4d32b526baa6414aca2117382bf8da"
@ -4468,6 +4480,22 @@ eastasianwidth@^0.2.0:
resolved "https://registry.npmmirror.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
echarts-for-react@^3.0.2:
version "3.0.2"
resolved "https://registry.npmmirror.com/echarts-for-react/-/echarts-for-react-3.0.2.tgz#ac5859157048a1066d4553e34b328abb24f2b7c1"
integrity sha512-DRwIiTzx8JfwPOVgGttDytBqdp5VzCSyMRIxubgU/g2n9y3VLUmF2FK7Icmg/sNVkv4+rktmrLN9w22U2yy3fA==
dependencies:
fast-deep-equal "^3.1.3"
size-sensor "^1.0.1"
echarts@^5.4.3:
version "5.4.3"
resolved "https://registry.npmmirror.com/echarts/-/echarts-5.4.3.tgz#f5522ef24419164903eedcfd2b506c6fc91fb20c"
integrity sha512-mYKxLxhzy6zyTi/FaEbJMOZU1ULGEQHaeIeuMR5L+JnJTpz+YR03mnnpBhbR4+UYJAgiXgpyTVLffPAjOTLkZA==
dependencies:
tslib "2.3.0"
zrender "5.4.4"
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
@ -8733,7 +8761,7 @@ rc-menu@~9.12.0:
rc-overflow "^1.3.1"
rc-util "^5.27.0"
rc-motion@^2.0.0, rc-motion@^2.0.1, rc-motion@^2.3.0, rc-motion@^2.3.4, rc-motion@^2.4.3, rc-motion@^2.4.4, rc-motion@^2.6.0, rc-motion@^2.6.1, rc-motion@^2.6.2, rc-motion@^2.9.0:
rc-motion@^2.0.0, rc-motion@^2.0.1, rc-motion@^2.3.0, rc-motion@^2.3.4, rc-motion@^2.4.3, rc-motion@^2.4.4, rc-motion@^2.6.0, rc-motion@^2.6.1, rc-motion@^2.6.2, rc-motion@^2.7.3, rc-motion@^2.9.0:
version "2.9.0"
resolved "https://registry.npmmirror.com/rc-motion/-/rc-motion-2.9.0.tgz#9e18a1b8d61e528a97369cf9a7601e9b29205710"
integrity sha512-XIU2+xLkdIr1/h6ohPZXyPBMvOmuyFZQ/T0xnawz+Rh+gh4FINcnZmMT5UTIj6hgI0VLDjTaPeRd+smJeSPqiQ==
@ -9647,6 +9675,11 @@ sisteransi@^1.0.5:
resolved "https://registry.npmmirror.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
size-sensor@^1.0.1:
version "1.0.2"
resolved "https://registry.npmmirror.com/size-sensor/-/size-sensor-1.0.2.tgz#b8f8da029683cf2b4e22f12bf8b8f0a1145e8471"
integrity sha512-2NCmWxY7A9pYKGXNBfteo4hy14gWu47rg5692peVMst6lQLPKrVjhY+UTEsPI5ceFRJSl3gVgMYaUi/hKuaiKw==
slash@^2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
@ -10318,6 +10351,11 @@ tsconfig-paths@^3.14.2:
minimist "^1.2.6"
strip-bom "^3.0.0"
tslib@2.3.0:
version "2.3.0"
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==
tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.npmmirror.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
@ -11152,3 +11190,10 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
zrender@5.4.4:
version "5.4.4"
resolved "https://registry.npmmirror.com/zrender/-/zrender-5.4.4.tgz#8854f1d95ecc82cf8912f5a11f86657cb8c9e261"
integrity sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==
dependencies:
tslib "2.3.0"

@ -81,7 +81,6 @@
<el-table-column :label="$t('common.num')" fixed="left" width="95">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column :label="$t('threadPoolInstance.instanceID')" width="260">
<template slot-scope="scope">
<el-link type="primary" :underline="false">{{ scope.row.identify }}</el-link>

Loading…
Cancel
Save