From e2308b524ba76357af564759681b9b7cf6050fae Mon Sep 17 00:00:00 2001 From: slhmy <1484836413@qq.com> Date: Sat, 10 Aug 2024 12:43:30 +0800 Subject: [PATCH] Tidy project structure --- .vscode/extensions.json | 5 +- index.html | 46 +- package-lock.json | 5615 +++++------------ package.json | 6 +- src/App.tsx | 6 +- src/{index.css => Index.css} | 0 src/{index.tsx => Index.tsx} | 41 +- src/Router.tsx | 48 + src/{api => apis}/auth.ts | 12 +- src/{api => apis}/event.ts | 0 src/{api => apis}/judge.ts | 10 +- src/{api => apis}/problem.ts | 17 +- src/components/JudgeVerdictTable.tsx | 53 - src/components/NewsCard.tsx | 18 - src/components/control/ConfirmDialog.tsx | 38 + .../{theme => control}/DarkLightToggle.tsx | 4 +- src/components/{ => control}/Pagination.tsx | 0 .../{judge => display}/JudgeTable.tsx | 10 +- src/components/display/MarkdownRender.tsx | 89 + src/components/display/ProblemTable.tsx | 128 + .../{ => display}/icons/GitHubIcon.tsx | 0 src/components/display/icons/OJLabIcon.tsx | 11 + .../icons/tabler/ActivityIcon.tsx | 0 .../{ => display}/icons/tabler/AwardIcon.tsx | 0 .../icons/tabler/BrandCPPIcon.tsx | 0 .../icons/tabler/BrandPythonIcon.tsx | 0 .../icons/tabler/FileTextIcon.tsx | 0 .../icons/tabler/LanguageIcon.tsx | 0 .../{ => display}/icons/tabler/Menu3Icon.tsx | 0 .../{ => display}/icons/tabler/MoonIcon.tsx | 0 .../icons/tabler/PackageIcon.tsx | 0 .../{ => display}/icons/tabler/PencilIcon.tsx | 0 .../{ => display}/icons/tabler/PlusIcon.tsx | 0 .../{ => display}/icons/tabler/ReportIcon.tsx | 0 .../{ => display}/icons/tabler/SunIcon.tsx | 0 .../{ => display}/icons/tabler/TrashIcon.tsx | 0 .../{ => display}/icons/tabler/UsersIcon.tsx | 0 .../{ => display}/icons/tabler/defaults.ts | 0 .../{code-editor => input}/CodeEditor.tsx | 2 +- src/components/{ => input}/FileUploader.tsx | 0 src/components/judge/JudgeDetail.tsx | 65 - src/components/markdown/MarkdownRender.tsx | 77 - .../{i18n => navigation}/LanguageMenu.tsx | 6 +- .../navigation/PageBreadcrumbs.tsx} | 4 +- src/components/navigation/PageMenu.tsx | 49 + .../navigation}/UserMenu.tsx | 2 +- src/components/problem/ProblemTable.tsx | 144 - src/hooks/event.ts | 2 +- src/hooks/judge.ts | 4 +- src/hooks/problem.ts | 4 +- src/hooks/user.ts | 4 +- src/i18n/{i18n.ts => module.ts} | 4 +- src/i18n/{ => resources}/en_US.ts | 0 src/i18n/{ => resources}/zh_CN.ts | 0 src/layouts/Drawer.tsx | 71 +- src/layouts/Layout.tsx | 4 +- src/layouts/Menu.tsx | 66 - src/layouts/Navbar.tsx | 6 +- src/{components => layouts}/RequireAuth.tsx | 0 src/mocks/data/problem.ts | 2 +- src/mocks/{rest => handlers}/judge.ts | 2 +- src/mocks/{rest => handlers}/problem.ts | 2 +- src/mocks/{rest => handlers}/user.ts | 0 src/mocks/server.ts | 4 - src/mocks/{handlers.ts => worker.ts} | 11 +- src/models/service/judge.ts | 29 + src/models/service/problem.ts | 12 + src/models/service/user.ts | 6 + src/models/view/judge.ts | 5 + .../useWorker.ts => monacoWorker.ts} | 3 + src/pages/Judge.tsx | 12 - src/pages/Login.tsx | 4 +- .../CreateProblem.tsx | 4 +- .../ProblemList.tsx | 4 +- src/pages/judge/Judge.tsx | 25 + src/pages/{ => judge}/JudgeList.tsx | 4 +- src/pages/{ => problem}/Problem.tsx | 8 +- src/pages/{ => problem}/ProblemList.tsx | 6 +- src/pipes/judge.ts | 18 +- src/react-app-env.d.ts | 1 - src/routes/Router.tsx | 49 - src/typings/judge.ts | 40 - src/typings/problem.ts | 14 - src/typings/user.ts | 8 - src/utils/{avatar_url.ts => avatarURL.ts} | 0 src/{api/client.ts => utils/axiosClient.ts} | 2 +- src/utils/environment.ts | 6 +- src/utils/markdown.ts | 11 + src/{pipes/common.ts => utils/unit.ts} | 0 src/utils/window.ts | 3 + tsconfig.json | 21 +- 91 files changed, 2422 insertions(+), 4565 deletions(-) rename src/{index.css => Index.css} (100%) rename src/{index.tsx => Index.tsx} (51%) create mode 100644 src/Router.tsx rename src/{api => apis}/auth.ts (64%) rename src/{api => apis}/event.ts (100%) rename src/{api => apis}/judge.ts (74%) rename src/{api => apis}/problem.ts (78%) delete mode 100644 src/components/JudgeVerdictTable.tsx delete mode 100644 src/components/NewsCard.tsx create mode 100644 src/components/control/ConfirmDialog.tsx rename src/components/{theme => control}/DarkLightToggle.tsx (91%) rename src/components/{ => control}/Pagination.tsx (100%) rename src/components/{judge => display}/JudgeTable.tsx (91%) create mode 100644 src/components/display/MarkdownRender.tsx create mode 100644 src/components/display/ProblemTable.tsx rename src/components/{ => display}/icons/GitHubIcon.tsx (100%) create mode 100644 src/components/display/icons/OJLabIcon.tsx rename src/components/{ => display}/icons/tabler/ActivityIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/AwardIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/BrandCPPIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/BrandPythonIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/FileTextIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/LanguageIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/Menu3Icon.tsx (100%) rename src/components/{ => display}/icons/tabler/MoonIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/PackageIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/PencilIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/PlusIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/ReportIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/SunIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/TrashIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/UsersIcon.tsx (100%) rename src/components/{ => display}/icons/tabler/defaults.ts (100%) rename src/components/{code-editor => input}/CodeEditor.tsx (99%) rename src/components/{ => input}/FileUploader.tsx (100%) delete mode 100644 src/components/judge/JudgeDetail.tsx delete mode 100644 src/components/markdown/MarkdownRender.tsx rename src/components/{i18n => navigation}/LanguageMenu.tsx (90%) rename src/{layouts/Breadcrumbs.tsx => components/navigation/PageBreadcrumbs.tsx} (92%) create mode 100644 src/components/navigation/PageMenu.tsx rename src/{layouts => components/navigation}/UserMenu.tsx (98%) delete mode 100644 src/components/problem/ProblemTable.tsx rename src/i18n/{i18n.ts => module.ts} (90%) rename src/i18n/{ => resources}/en_US.ts (100%) rename src/i18n/{ => resources}/zh_CN.ts (100%) delete mode 100644 src/layouts/Menu.tsx rename src/{components => layouts}/RequireAuth.tsx (100%) rename src/mocks/{rest => handlers}/judge.ts (97%) rename src/mocks/{rest => handlers}/problem.ts (96%) rename src/mocks/{rest => handlers}/user.ts (100%) delete mode 100644 src/mocks/server.ts rename src/mocks/{handlers.ts => worker.ts} (51%) create mode 100644 src/models/service/judge.ts create mode 100644 src/models/service/problem.ts create mode 100644 src/models/service/user.ts create mode 100644 src/models/view/judge.ts rename src/{components/code-editor/useWorker.ts => monacoWorker.ts} (90%) delete mode 100644 src/pages/Judge.tsx rename src/pages/{admin-dashboard => admin}/CreateProblem.tsx (98%) rename src/pages/{admin-dashboard => admin}/ProblemList.tsx (86%) create mode 100644 src/pages/judge/Judge.tsx rename src/pages/{ => judge}/JudgeList.tsx (91%) rename src/pages/{ => problem}/Problem.tsx (91%) rename src/pages/{ => problem}/ProblemList.tsx (88%) delete mode 100644 src/react-app-env.d.ts delete mode 100644 src/routes/Router.tsx delete mode 100644 src/typings/judge.ts delete mode 100644 src/typings/problem.ts delete mode 100644 src/typings/user.ts rename src/utils/{avatar_url.ts => avatarURL.ts} (100%) rename src/{api/client.ts => utils/axiosClient.ts} (60%) create mode 100644 src/utils/markdown.ts rename src/{pipes/common.ts => utils/unit.ts} (100%) create mode 100644 src/utils/window.ts diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 13d40395d..2a5f40046 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "esbenp.prettier-vscode", "dbaeumer.vscode-eslint", - "bradlc.vscode-tailwindcss" + "bradlc.vscode-tailwindcss", + "gruntfuggly.todo-tree" ] -} +} \ No newline at end of file diff --git a/index.html b/index.html index 658eecbe9..bc4cd407b 100644 --- a/index.html +++ b/index.html @@ -1,29 +1,28 @@ -
- - - - - - - - - - -