From 35cf5d82d06d6c0b24ae2179f5a8ea3078728256 Mon Sep 17 00:00:00 2001 From: bobowiki <69181829+bobowiki@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:16:35 +0800 Subject: [PATCH] Feat oe thread pool (#1468) * feat: thread pool * feat: remove yarnloack --------- Co-authored-by: yikai --- threadpool/console-new/craco.config.js | 1 - threadpool/console-new/package.json | 1 + threadpool/console-new/public/locales/en.json | 0 threadpool/console-new/public/locales/zh.json | 0 threadpool/console-new/src/App.tsx | 34 +++---- .../src/components/header/index.tsx | 4 +- .../console-new/src/components/icon/index.tsx | 2 +- .../components/layout-com/index.module.less | 5 +- .../src/components/layout-com/index.tsx | 54 ++++++++--- .../src/config/i18n/locales/constants.ts | 20 +++++ .../console-new/src/config/i18n/locales/en.ts | 21 ++++- .../console-new/src/config/i18n/locales/zh.ts | 21 ++++- .../src/config/theme/dark-algorithm.ts | 33 ++++--- .../src/config/theme/default-algnorithm.ts | 62 +++++++------ threadpool/console-new/src/hooks/index.ts | 3 + .../console-new/src/hooks/useFormToUrl.ts | 52 +++++++++++ .../{useThemeMode.tsx => useThemeMode.ts} | 4 +- .../console-new/src/hooks/useTransLate.ts | 6 ++ .../src/page/thread-pool/index.tsx | 90 +++++++++++++++++++ .../src/page/thread-pool/router.ts | 11 +++ threadpool/console-new/src/route/index.tsx | 3 +- threadpool/console-new/yarn.lock | 41 ++++++++- yarn.lock | 76 ++++++++++++++++ 23 files changed, 458 insertions(+), 86 deletions(-) delete mode 100644 threadpool/console-new/public/locales/en.json delete mode 100644 threadpool/console-new/public/locales/zh.json create mode 100644 threadpool/console-new/src/config/i18n/locales/constants.ts create mode 100644 threadpool/console-new/src/hooks/index.ts create mode 100644 threadpool/console-new/src/hooks/useFormToUrl.ts rename threadpool/console-new/src/hooks/{useThemeMode.tsx => useThemeMode.ts} (78%) create mode 100644 threadpool/console-new/src/hooks/useTransLate.ts create mode 100644 threadpool/console-new/src/page/thread-pool/index.tsx create mode 100644 threadpool/console-new/src/page/thread-pool/router.ts create mode 100644 yarn.lock diff --git a/threadpool/console-new/craco.config.js b/threadpool/console-new/craco.config.js index 0d7d72a2..5ad94a67 100644 --- a/threadpool/console-new/craco.config.js +++ b/threadpool/console-new/craco.config.js @@ -41,7 +41,6 @@ module.exports = { webpack: { alias: { '@': resolve('src'), - '@i18': resolve('public/locales'), }, }, devServer: { diff --git a/threadpool/console-new/package.json b/threadpool/console-new/package.json index 801cbd51..353e4cf1 100644 --- a/threadpool/console-new/package.json +++ b/threadpool/console-new/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "@ahooksjs/use-url-state": "^3.5.1", "@ant-design/icons": "^5.2.6", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/threadpool/console-new/public/locales/en.json b/threadpool/console-new/public/locales/en.json deleted file mode 100644 index e69de29b..00000000 diff --git a/threadpool/console-new/public/locales/zh.json b/threadpool/console-new/public/locales/zh.json deleted file mode 100644 index e69de29b..00000000 diff --git a/threadpool/console-new/src/App.tsx b/threadpool/console-new/src/App.tsx index 709464e4..d03544f5 100644 --- a/threadpool/console-new/src/App.tsx +++ b/threadpool/console-new/src/App.tsx @@ -1,25 +1,29 @@ import LayoutCom from './components/layout-com'; -import { Routes, Route } from 'react-router-dom'; +import { Routes, Route, Link } from 'react-router-dom'; + import routeList from './route'; import Login from '@/page/login'; -import { AppstoreOutlined, MailOutlined } from '@ant-design/icons'; +import { MenuProps } from 'antd'; +import { useTran } from './hooks'; +import { STR_MAP } from './config/i18n/locales/constants'; +import IconFont from './components/icon'; -const sideMenuList = [ - { - label: about, - key: 'mail', - icon: , - }, - { - label: 主页, - key: 'app', - icon: , - }, -]; +type MenuItem = Required['items'][number]; const App = () => { + const sideMenuList: MenuItem[] = [ + { + label: useTran(STR_MAP.DYNAMIC_THREAD_POOL), + key: STR_MAP.DYNAMIC_THREAD_POOL, + icon: , + children: [ + { label: {useTran(STR_MAP.THREAD_POOL)}, key: '/thread-poll/index' }, + ], + }, + ]; + return ( - + {routeList.map(item => ( diff --git a/threadpool/console-new/src/components/header/index.tsx b/threadpool/console-new/src/components/header/index.tsx index 2619f290..dddb3252 100644 --- a/threadpool/console-new/src/components/header/index.tsx +++ b/threadpool/console-new/src/components/header/index.tsx @@ -1,8 +1,8 @@ import React, { useContext } from 'react'; import style from './index.module.less'; import { UserOutlined } from '@ant-design/icons'; -import { Avatar, Button, Col, Dropdown, Row, Switch, Tag } from 'antd'; -import useThemeMode from '@/hooks/useThemeMode'; +import { Avatar, Button, Col, Dropdown, Row, Switch } from 'antd'; +import { useThemeMode } from '@/hooks'; import { MyContext } from '@/context'; import IconFont from '@/components/icon'; diff --git a/threadpool/console-new/src/components/icon/index.tsx b/threadpool/console-new/src/components/icon/index.tsx index 335ec6a6..fee31ec8 100644 --- a/threadpool/console-new/src/components/icon/index.tsx +++ b/threadpool/console-new/src/components/icon/index.tsx @@ -5,7 +5,7 @@ interface Props { } const MyIcon = createFromIconfontCN({ - scriptUrl: '//at.alicdn.com/t/c/font_4254722_1xl4w1k5c53.js', // 在 iconfont.cn 上生成 + scriptUrl: '//at.alicdn.com/t/c/font_4254722_3l4m6by7h34.js', // 在 iconfont.cn 上生成 }); const IconFont = (props: Props) => { diff --git a/threadpool/console-new/src/components/layout-com/index.module.less b/threadpool/console-new/src/components/layout-com/index.module.less index 4d7b07bc..05eeadc3 100644 --- a/threadpool/console-new/src/components/layout-com/index.module.less +++ b/threadpool/console-new/src/components/layout-com/index.module.less @@ -9,14 +9,13 @@ align-items: center; } .sider { - height: calc(100vh - 48px); padding-top: 24px; } .content { margin: 10px 10px 0px; border-radius: 12px 12px 0 0; - min-height: 100%; flex: 1; - padding: 10px 12px; + padding: 16px; + overflow-y: auto; } } diff --git a/threadpool/console-new/src/components/layout-com/index.tsx b/threadpool/console-new/src/components/layout-com/index.tsx index 13d25217..cffa0f30 100644 --- a/threadpool/console-new/src/components/layout-com/index.tsx +++ b/threadpool/console-new/src/components/layout-com/index.tsx @@ -1,37 +1,63 @@ -import { useState, useContext, ReactNode } from 'react'; +import { useState, useContext, ReactNode, useEffect } from 'react'; import { DefaultTheme, ThemeContext } from 'styled-components'; -import { Layout, Menu } from 'antd'; +import { Layout, Menu, MenuProps } from 'antd'; import HeaderChild from '../header'; -import { IMenuList } from '@/typings'; import style from './index.module.less'; +import { useLocation } from 'react-router-dom'; +import { useThemeMode } from '@/hooks'; +type MenuItem = Required['items'][number]; const { Header, Sider, Content } = Layout; interface ILayoutCom { children?: ReactNode; - sideMenuList: IMenuList[]; + sideMenuList: MenuItem[]; isSider?: boolean; + isHeader?: boolean; } const LayoutCom = (props: ILayoutCom) => { - const { sideMenuList, children, isSider = true } = props; + const { sideMenuList, children, isSider = true, isHeader = true } = props; const myThemes: DefaultTheme = useContext(ThemeContext); - const [current, setCurrent] = useState('mail'); + const [currentKey, setCurrentKey] = useState(''); + const { isDark } = useThemeMode(); + + const location = useLocation(); + useEffect(() => { + setCurrentKey(location.pathname); + }, [location]); + const onClick = (e: any) => { - setCurrent(e.key); + setCurrentKey(e.key); }; + useEffect(() => { + document.body.style.backgroundColor = myThemes.backgroundColor.bg1; + }, [isDark, myThemes]); + return (
-
- -
- + {isHeader && ( +
+ +
+ )} + {isSider && ( - - + + )} - {children} + + {children} +
); diff --git a/threadpool/console-new/src/config/i18n/locales/constants.ts b/threadpool/console-new/src/config/i18n/locales/constants.ts new file mode 100644 index 00000000..84fe02d5 --- /dev/null +++ b/threadpool/console-new/src/config/i18n/locales/constants.ts @@ -0,0 +1,20 @@ +export enum STR_MAP { + DYNAMIC_THREAD_POOL = 'dynamicThreadPool', + THREAD_POOL_MANAGE = 'threadPoolManage', + PROJECT = 'project', + SEARCH = 'search', + ADD = 'add', + SERIAL_NUMBER = 'serialNumber', + TENANTRY = 'tenantry', + THREAD_POOL = 'threadPool', + CORE_THREAD = 'coreThread', + MAXIMUM_THREAD = 'maximumThread', + QUEUE_TYPE = 'queueType', + QUEUE_CAPACITY = 'queueCapacity', + REJECTION_STRATEGY = 'rejectionStrategy', + EXECUTION_TIMEOUT = 'executionTimeout', + ALARM_OR_NOT = 'alarmOrNot', + CREATION_TIME = 'creationTime', + UPDATE_TIME = 'update time', + EDIT = 'edit', +} diff --git a/threadpool/console-new/src/config/i18n/locales/en.ts b/threadpool/console-new/src/config/i18n/locales/en.ts index 9c4e9957..ab05675d 100644 --- a/threadpool/console-new/src/config/i18n/locales/en.ts +++ b/threadpool/console-new/src/config/i18n/locales/en.ts @@ -1,5 +1,24 @@ +import { STR_MAP } from './constants'; + const enTranslationMap: { [key: string]: string } = { - hello: 'hello', + [STR_MAP.DYNAMIC_THREAD_POOL]: 'Dynamic thread pool', + [STR_MAP.THREAD_POOL_MANAGE]: 'Thread pool management', + [STR_MAP.PROJECT]: 'project', + [STR_MAP.SEARCH]: 'search', + [STR_MAP.ADD]: 'add', + [STR_MAP.SERIAL_NUMBER]: 'number', + [STR_MAP.TENANTRY]: 'tenantry', + [STR_MAP.THREAD_POOL]: 'thread pool', + [STR_MAP.CORE_THREAD]: 'core thread', + [STR_MAP.MAXIMUM_THREAD]: 'maximum thread', + [STR_MAP.QUEUE_TYPE]: 'queue type', + [STR_MAP.QUEUE_CAPACITY]: 'queue capacity', + [STR_MAP.REJECTION_STRATEGY]: 'rejection strategy', + [STR_MAP.EXECUTION_TIMEOUT]: 'execution timeout', + [STR_MAP.ALARM_OR_NOT]: 'alarm or not', + [STR_MAP.CREATION_TIME]: 'creation time', + [STR_MAP.UPDATE_TIME]: 'update time', + [STR_MAP.EDIT]: 'edit', }; export default enTranslationMap; diff --git a/threadpool/console-new/src/config/i18n/locales/zh.ts b/threadpool/console-new/src/config/i18n/locales/zh.ts index dbf8591d..05544c3b 100644 --- a/threadpool/console-new/src/config/i18n/locales/zh.ts +++ b/threadpool/console-new/src/config/i18n/locales/zh.ts @@ -1,5 +1,24 @@ +import { STR_MAP } from './constants'; + const zhTranslationMap: { [key: string]: string } = { - hello: '你好', + [STR_MAP.DYNAMIC_THREAD_POOL]: '动态线程池', + [STR_MAP.THREAD_POOL_MANAGE]: '线程池管理', + [STR_MAP.PROJECT]: '项目', + [STR_MAP.SEARCH]: '搜索', + [STR_MAP.ADD]: '添加', + [STR_MAP.SERIAL_NUMBER]: '序号', + [STR_MAP.TENANTRY]: '租户', + [STR_MAP.THREAD_POOL]: '线程池', + [STR_MAP.CORE_THREAD]: '核心线程', + [STR_MAP.MAXIMUM_THREAD]: '最大线程', + [STR_MAP.QUEUE_TYPE]: '队列类型', + [STR_MAP.QUEUE_CAPACITY]: '队列容量', + [STR_MAP.REJECTION_STRATEGY]: '拒绝策略', + [STR_MAP.EXECUTION_TIMEOUT]: '执行超时', + [STR_MAP.ALARM_OR_NOT]: '是否报警', + [STR_MAP.CREATION_TIME]: '创建时间', + [STR_MAP.UPDATE_TIME]: '更新时间', + [STR_MAP.EDIT]: '操作', }; export default zhTranslationMap; diff --git a/threadpool/console-new/src/config/theme/dark-algorithm.ts b/threadpool/console-new/src/config/theme/dark-algorithm.ts index 5e1fea63..054da61e 100644 --- a/threadpool/console-new/src/config/theme/dark-algorithm.ts +++ b/threadpool/console-new/src/config/theme/dark-algorithm.ts @@ -4,25 +4,28 @@ export const darkAlgorithm = { token: { colorPrimary: darkDefaultTheme.primary, fontSize: 14, + fontSizeHeading1: 18, }, components: { Layout: { bodyBg: darkDefaultTheme.backgroundColor.bg1, headerBg: darkDefaultTheme.backgroundColor.bgHeader, + triggerBg: darkDefaultTheme.backgroundColor.bg1, + triggerColor: darkDefaultTheme.fontColor.fc1, }, Button: { - fontSize: 14, + // fontSize: 14, + }, + Table: { + // borderRadius: 0, + // borderRadiusLG: 0, + // padding: 10, + // paddingXS: 5, + // margin: 0, + // fontSize: 14, + // colorBorderSecondary: darkDefaultTheme.borderColor.bl1, + // paddingContentVerticalLG: 4, }, - // Table: { - // borderRadius: 0, - // borderRadiusLG: 0, - // padding: 10, - // paddingXS: 5, - // margin: 0, - // fontSize: 14, - // colorBorderSecondary: darkDefaultTheme.borderColor.bl1, - // paddingContentVerticalLG: 4, - // }, Modal: { borderRadiusLG: 2, borderRadiusSM: 2, @@ -33,12 +36,14 @@ export const darkAlgorithm = { }, Menu: { itemBg: darkDefaultTheme.backgroundColor.bg1, + // itemSelectedBg: darkDefaultTheme.primary, + // itemSelectedColor: darkDefaultTheme.fontColor.fc1, activeBarWidth: 0, activeBarHeight: 0, activeBarBorderWidth: 0, - subMenuItemBorderRadius: 8, - horizontalItemBorderRadius: 8, - itemBorderRadius: 8, + // subMenuItemBorderRadius: 8, + // horizontalItemBorderRadius: 8, + // itemBorderRadius: 8, }, }, algorithm: theme.darkAlgorithm, diff --git a/threadpool/console-new/src/config/theme/default-algnorithm.ts b/threadpool/console-new/src/config/theme/default-algnorithm.ts index 4ebe96e7..b22cbcaf 100644 --- a/threadpool/console-new/src/config/theme/default-algnorithm.ts +++ b/threadpool/console-new/src/config/theme/default-algnorithm.ts @@ -4,41 +4,45 @@ export const defaultAlgorithm = { token: { colorPrimary: lightDefaultTheme.primary, fontSize: 14, - // colorBgBase: lightDefaultTheme.backgroundColor.bg1, + fontSizeHeading1: 18, }, components: { Layout: { bodyBg: lightDefaultTheme.backgroundColor.bg1, headerBg: lightDefaultTheme.backgroundColor.bgHeader, + triggerBg: lightDefaultTheme.backgroundColor.bg1, + triggerColor: lightDefaultTheme.fontColor.fc1, + }, + Button: { + // fontSize: 14, + }, + Table: { + // padding: 10, + // paddingXS: 5, + // margin: 0, + // fontSize: 14, + // colorBorderSecondary: lightDefaultTheme.borderColor.bl1, + // paddingContentVerticalLG: 4, + }, + Modal: { + borderRadiusLG: 2, + borderRadiusSM: 2, + colorText: lightDefaultTheme.fontColor.fc3, + borderRadius: 2, + paddingContentHorizontalLG: 0, + paddingMD: 0, + }, + Menu: { + itemBg: lightDefaultTheme.backgroundColor.bg1, + // itemSelectedBg: lightDefaultTheme.primary, + // itemSelectedColor: lightDefaultTheme.fontColor.fc1, + activeBarWidth: 0, + activeBarHeight: 0, + activeBarBorderWidth: 0, + // subMenuItemBorderRadius: 8, + // horizontalItemBorderRadius: 8, + // itemBorderRadius: 8, }, - // Button: { - // fontSize: 14, - // }, - // Table: { - // padding: 10, - // paddingXS: 5, - // margin: 0, - // fontSize: 14, - // colorBorderSecondary: lightDefaultTheme.borderColor.bl1, - // paddingContentVerticalLG: 4, - // }, - // Modal: { - // borderRadiusLG: 2, - // borderRadiusSM: 2, - // colorText: lightDefaultTheme.fontColor.fc3, - // borderRadius: 2, - // paddingContentHorizontalLG: 0, - // paddingMD: 0, - // }, - // Menu: { - // itemBg: lightDefaultTheme.backgroundColor.bg1, - // activeBarWidth: 0, - // activeBarHeight: 0, - // activeBarBorderWidth: 0, - // subMenuItemBorderRadius: 8, - // horizontalItemBorderRadius: 8, - // itemBorderRadius: 8, - // }, }, algorithm: theme.defaultAlgorithm, }; diff --git a/threadpool/console-new/src/hooks/index.ts b/threadpool/console-new/src/hooks/index.ts new file mode 100644 index 00000000..2d6b5b00 --- /dev/null +++ b/threadpool/console-new/src/hooks/index.ts @@ -0,0 +1,3 @@ +export * from './useThemeMode'; +export * from './useTransLate'; +export * from './useFormToUrl'; diff --git a/threadpool/console-new/src/hooks/useFormToUrl.ts b/threadpool/console-new/src/hooks/useFormToUrl.ts new file mode 100644 index 00000000..664d54c3 --- /dev/null +++ b/threadpool/console-new/src/hooks/useFormToUrl.ts @@ -0,0 +1,52 @@ +import { useEffect, useMemo, useState } from 'react'; +import { parse } from 'qs'; +import useUrlState from '@ahooksjs/use-url-state'; +import { FormInstance } from 'antd'; + +export function useFormStateToUrl>( + form: FormInstance, + params?: T +): { + urlState: any; + isFirstMount: boolean; + handleSetUrlState: () => void; +} { + const [state, setState] = useState(); + const [urlState, setUrlState] = useUrlState(); + const [count, setCount] = useState(0); + + useEffect(() => { + const url = window.location.search.split('?')[1] ?? null; + const urlParams = parse(url) as T; + const result: Partial = {}; + setState(urlParams); + for (const key in params) { + if (Object.prototype.hasOwnProperty.call(params, key)) { + const paramValue = urlParams[key]; + if (paramValue ?? false) { + if (typeof params[key] === 'number') { + const parsedValue = parseFloat(paramValue); + if (!isNaN(parsedValue)) { + result[key] = parsedValue as T[keyof T]; + } + } else { + result[key] = paramValue as T[keyof T]; + } + } + } + } + form.setFieldsValue(result); + setCount(count => count + 1); + }, [setState, setCount, form, params]); + + const handleSetUrlState = () => { + const values = form.getFieldsValue(); + setUrlState({ ...state, ...values }); + }; + + const isFirstMount = useMemo(() => { + return count === 1; + }, [count]); + + return { urlState, isFirstMount, handleSetUrlState }; +} diff --git a/threadpool/console-new/src/hooks/useThemeMode.tsx b/threadpool/console-new/src/hooks/useThemeMode.ts similarity index 78% rename from threadpool/console-new/src/hooks/useThemeMode.tsx rename to threadpool/console-new/src/hooks/useThemeMode.ts index 502a31dd..170b3afe 100644 --- a/threadpool/console-new/src/hooks/useThemeMode.tsx +++ b/threadpool/console-new/src/hooks/useThemeMode.ts @@ -2,7 +2,7 @@ import { useContext, useEffect } from 'react'; import { useLocalStorageState } from 'ahooks'; import { MyContext, THEME_NAME } from '@/context'; -const useThemeMode = (): { isDark: boolean | undefined; setIsDark: (isDark: boolean) => void } => { +export const useThemeMode = (): { isDark: boolean | undefined; setIsDark: (isDark: boolean) => void } => { const [isDark, setIsDark] = useLocalStorageState('current-mode', { defaultValue: false }); const { setThemeName } = useContext(MyContext); @@ -12,5 +12,3 @@ const useThemeMode = (): { isDark: boolean | undefined; setIsDark: (isDark: bool return { isDark, setIsDark }; }; - -export default useThemeMode; diff --git a/threadpool/console-new/src/hooks/useTransLate.ts b/threadpool/console-new/src/hooks/useTransLate.ts new file mode 100644 index 00000000..de37118e --- /dev/null +++ b/threadpool/console-new/src/hooks/useTransLate.ts @@ -0,0 +1,6 @@ +import { useTranslation } from 'react-i18next'; + +export const useTran = (str: string): string => { + const { t } = useTranslation(); + return t(str); +}; diff --git a/threadpool/console-new/src/page/thread-pool/index.tsx b/threadpool/console-new/src/page/thread-pool/index.tsx new file mode 100644 index 00000000..ed2dc227 --- /dev/null +++ b/threadpool/console-new/src/page/thread-pool/index.tsx @@ -0,0 +1,90 @@ +import { Button, Form, Select, Space, Table, Typography } from 'antd'; +import { useFormStateToUrl, useTran } from '@/hooks'; +import { STR_MAP } from '@/config/i18n/locales/constants'; +import { ColumnProps } from 'antd/es/table'; +const { Title } = Typography; +const { Item } = Form; + +const params = { project: 0, thpool: 0 }; +const ThreadPoll = () => { + const [form] = Form.useForm(); + const { handleSetUrlState } = useFormStateToUrl<{ project: number; thpool: number }>(form, params); + const columns: ColumnProps[] = [ + { + title: useTran(STR_MAP.SERIAL_NUMBER), + dataIndex: 'order', + }, + { + title: useTran(STR_MAP.PROJECT), + dataIndex: 'project', + }, + { + title: useTran(STR_MAP.TENANTRY), + dataIndex: 'tenantry', + }, + { + title: useTran(STR_MAP.THREAD_POOL), + dataIndex: 'thread_pool', + }, + { + title: useTran(STR_MAP.MAXIMUM_THREAD), + dataIndex: 'maximum_thread', + }, + { + title: useTran(STR_MAP.QUEUE_TYPE), + dataIndex: 'queue_type', + }, + { + title: useTran(STR_MAP.REJECTION_STRATEGY), + dataIndex: 'tenantry', + }, + { + title: useTran(STR_MAP.EXECUTION_TIMEOUT), + dataIndex: 'tenantry', + }, + { + title: useTran(STR_MAP.ALARM_OR_NOT), + dataIndex: 'tenantry', + }, + { + title: useTran(STR_MAP.CREATION_TIME), + dataIndex: 'tenantry', + }, + { + title: useTran(STR_MAP.UPDATE_TIME), + dataIndex: 'tenantry', + }, + { + title: useTran(STR_MAP.EDIT), + dataIndex: 'tenantry', + }, + ]; + + const handleSubmit = () => { + handleSetUrlState(); + }; + + return ( + + {useTran(STR_MAP.THREAD_POOL)} +
+ + + + + + + + + + + + +
+
+
+ ); +}; +export default ThreadPoll; diff --git a/threadpool/console-new/src/page/thread-pool/router.ts b/threadpool/console-new/src/page/thread-pool/router.ts new file mode 100644 index 00000000..a981458d --- /dev/null +++ b/threadpool/console-new/src/page/thread-pool/router.ts @@ -0,0 +1,11 @@ +import { IRouterList } from '@/typings'; +import ThreadPoll from '.'; + +const routerList: IRouterList[] = [ + { + path: '/thread-poll/index', + component: ThreadPoll, + }, +]; + +export default routerList; diff --git a/threadpool/console-new/src/route/index.tsx b/threadpool/console-new/src/route/index.tsx index bb3681ca..8f0f3c93 100644 --- a/threadpool/console-new/src/route/index.tsx +++ b/threadpool/console-new/src/route/index.tsx @@ -1,7 +1,8 @@ import { IRouterList } from '@/typings'; import homeRouter from '@/page/home/router'; import aboutRouter from '@/page/about/router'; +import ThreadPoolRouter from '@/page/thread-pool/router'; import tenantRouter from '@/page/tenant/router'; -const routerList: IRouterList[] = [...homeRouter, ...aboutRouter, ...tenantRouter]; +const routerList: IRouterList[] = [...homeRouter, ...aboutRouter, ...tenantRouter, ...ThreadPoolRouter]; export default routerList; diff --git a/threadpool/console-new/yarn.lock b/threadpool/console-new/yarn.lock index 6d118190..dcdbc5fb 100644 --- a/threadpool/console-new/yarn.lock +++ b/threadpool/console-new/yarn.lock @@ -12,6 +12,15 @@ resolved "https://registry.npmmirror.com/@adobe/css-tools/-/css-tools-4.3.1.tgz#abfccb8ca78075a2b6187345c26243c1a0842f28" integrity sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg== +"@ahooksjs/use-url-state@^3.5.1": + version "3.5.1" + resolved "https://registry.npmmirror.com/@ahooksjs/use-url-state/-/use-url-state-3.5.1.tgz#c3ad04e98cbcbc8f9eba476bcbd3237e9809aa5b" + integrity sha512-XTrOLZKOAXahDD1Evg+aSN6qNzoh/FuvRKbUtB/0RhYvz57tyXRPbED0KXK4h2C3ZyHUKBJcVCSDcd6EsTyMyQ== + dependencies: + ahooks "^3.4.1" + query-string "^6.9.0" + tslib "^2.4.1" + "@alloc/quick-lru@^5.2.0": version "5.2.0" resolved "https://registry.npmmirror.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30" @@ -2793,7 +2802,7 @@ ahooks-v3-count@^1.0.0: resolved "https://registry.npmmirror.com/ahooks-v3-count/-/ahooks-v3-count-1.0.0.tgz#ddeb392e009ad6e748905b3cbf63a9fd8262ca80" integrity sha512-V7uUvAwnimu6eh/PED4mCDjE7tokeZQLKlxg9lCTMPhN+NjsSbtdacByVlR1oluXQzD3MOw55wylDmQo4+S9ZQ== -ahooks@^3.7.8: +ahooks@^3.4.1, ahooks@^3.7.8: version "3.7.8" resolved "https://registry.npmmirror.com/ahooks/-/ahooks-3.7.8.tgz#3fa3c491cd153e884a32b0c4192fc72cf84c4332" integrity sha512-e/NMlQWoCjaUtncNFIZk3FG1ImSkV/JhScQSkTqnftakRwdfZWSw6zzoWSG9OMYqPNs2MguDYBUFFC6THelWXA== @@ -4178,6 +4187,11 @@ decimal.js@^10.2.1: resolved "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== +decode-uri-component@^0.2.0: + version "0.2.2" + resolved "https://registry.npmmirror.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + dedent@^0.7.0: version "0.7.0" resolved "https://registry.npmmirror.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -5188,6 +5202,11 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +filter-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.npmmirror.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" + integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== + finalhandler@1.2.0: version "1.2.0" resolved "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" @@ -8505,6 +8524,16 @@ qs@^6.11.2: dependencies: side-channel "^1.0.4" +query-string@^6.9.0: + version "6.14.1" + resolved "https://registry.npmmirror.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" + integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== + dependencies: + decode-uri-component "^0.2.0" + filter-obj "^1.1.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + querystringify@^2.1.1: version "2.2.0" resolved "https://registry.npmmirror.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -9702,6 +9731,11 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.npmmirror.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -9748,6 +9782,11 @@ stop-iteration-iterator@^1.0.0: dependencies: internal-slot "^1.0.4" +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== + string-argv@0.3.2: version "0.3.2" resolved "https://registry.npmmirror.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..2b771a7a --- /dev/null +++ b/yarn.lock @@ -0,0 +1,76 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime@^7.21.0": + version "7.22.15" + resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" + integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== + dependencies: + regenerator-runtime "^0.14.0" + +"@types/js-cookie@^2.x.x": + version "2.2.7" + resolved "https://registry.npmmirror.com/@types/js-cookie/-/js-cookie-2.2.7.tgz#226a9e31680835a6188e887f3988e60c04d3f6a3" + integrity sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA== + +ahooks-v3-count@^1.0.0: + version "1.0.0" + resolved "https://registry.npmmirror.com/ahooks-v3-count/-/ahooks-v3-count-1.0.0.tgz#ddeb392e009ad6e748905b3cbf63a9fd8262ca80" + integrity sha512-V7uUvAwnimu6eh/PED4mCDjE7tokeZQLKlxg9lCTMPhN+NjsSbtdacByVlR1oluXQzD3MOw55wylDmQo4+S9ZQ== + +ahooks@^3.7.8: + version "3.7.8" + resolved "https://registry.npmmirror.com/ahooks/-/ahooks-3.7.8.tgz#3fa3c491cd153e884a32b0c4192fc72cf84c4332" + integrity sha512-e/NMlQWoCjaUtncNFIZk3FG1ImSkV/JhScQSkTqnftakRwdfZWSw6zzoWSG9OMYqPNs2MguDYBUFFC6THelWXA== + dependencies: + "@babel/runtime" "^7.21.0" + "@types/js-cookie" "^2.x.x" + ahooks-v3-count "^1.0.0" + dayjs "^1.9.1" + intersection-observer "^0.12.0" + js-cookie "^2.x.x" + lodash "^4.17.21" + resize-observer-polyfill "^1.5.1" + screenfull "^5.0.0" + tslib "^2.4.1" + +dayjs@^1.9.1: + version "1.11.9" + resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a" + integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA== + +intersection-observer@^0.12.0: + version "0.12.2" + resolved "https://registry.npmmirror.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375" + integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg== + +js-cookie@^2.x.x: + version "2.2.1" + resolved "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + +resize-observer-polyfill@^1.5.1: + version "1.5.1" + resolved "https://registry.npmmirror.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" + integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== + +screenfull@^5.0.0: + version "5.2.0" + resolved "https://registry.npmmirror.com/screenfull/-/screenfull-5.2.0.tgz#6533d524d30621fc1283b9692146f3f13a93d1ba" + integrity sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA== + +tslib@^2.4.1: + version "2.6.2" + resolved "https://registry.npmmirror.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==