mirror of https://github.com/longtai-cn/hippo4j
parent
d645c49450
commit
6a8bef846f
@ -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);
|
@ -0,0 +1,16 @@
|
||||
import request from '@/utils';
|
||||
|
||||
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 extends Params {
|
||||
/**
|
||||
* 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[];
|
||||
}
|
Loading…
Reference in new issue