From 696e5232ba7e3c63c8bed17efa5b0f671fbdb807 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 20 Jun 2023 15:42:24 +0800 Subject: [PATCH] refactor: move admin to admin-old --- docker/admin-old.yml | 20 ++++++++++++++++++ package.json | 4 +++- pnpm-workspace.yaml | 1 + server/{admin => admin-old}/.gitignore | 0 server/{admin => admin-old}/README.md | 0 .../{admin => admin-old}/app/entry.client.tsx | 0 .../{admin => admin-old}/app/entry.server.tsx | 0 server/{admin => admin-old}/app/ra/App.tsx | 0 .../app/ra/authProvider.ts | 0 .../app/ra/components/ButtonWithConfirm.tsx | 0 .../app/ra/components/ChipItems.tsx | 0 .../app/ra/components/DangerButton.tsx | 0 .../app/ra/components/FilesizeField.tsx | 0 .../app/ra/components/GroupField.tsx | 0 .../app/ra/components/Image.tsx | 0 .../ra/components/PostListActionToolbar.tsx | 0 .../app/ra/components/UserField.tsx | 0 .../app/ra/dashboard/CardWithIcon.tsx | 0 .../app/ra/dashboard/Welcome.tsx | 0 .../app/ra/dashboard/cartouche.png | Bin .../app/ra/dashboard/cartoucheDark.png | Bin .../app/ra/dashboard/index.tsx | 0 .../app/ra/dashboard/logo.svg | 0 .../app/ra/i18n/builtin.ts | 0 .../app/ra/i18n/custom.ts | 0 .../{admin => admin-old}/app/ra/i18n/index.ts | 0 .../app/ra/i18n/resources.ts | 0 .../app/ra/layout/Menu.tsx | 0 .../app/ra/layout/index.tsx | 0 server/{admin => admin-old}/app/ra/request.ts | 0 .../app/ra/resources/chat.tsx | 0 .../app/ra/resources/file.tsx | 0 .../app/ra/resources/group.tsx | 0 .../app/ra/resources/user.tsx | 0 .../app/ra/routes/network/index.tsx | 0 .../app/ra/routes/socketio.tsx | 0 .../app/ra/routes/system/index.tsx | 0 server/{admin => admin-old}/app/ra/theme.ts | 0 .../app/ra/utils/hooks.ts | 0 .../app/ra/utils/index.ts | 0 server/{admin => admin-old}/app/root.tsx | 0 .../app/routes/admin/$.tsx | 0 .../app/routes/admin/index.tsx | 0 .../{admin => admin-old}/app/routes/index.tsx | 0 .../{admin => admin-old}/app/server/broker.ts | 2 +- .../{admin => admin-old}/app/server/index.ts | 0 .../app/server/middleware/auth.ts | 0 .../app/server/router/api.ts | 0 .../app/server/router/config.ts | 0 .../app/server/router/file.ts | 0 .../app/server/router/network.ts | 0 .../{admin => admin-old}/app/styles/app.css | 0 server/{admin => admin-old}/nodemon.json | 0 server/{admin => admin-old}/package.json | 2 +- .../{admin => admin-old}/public/favicon.ico | Bin server/{admin => admin-old}/remix.config.js | 0 server/{admin => admin-old}/remix.env.d.ts | 0 server/{admin => admin-old}/server.ts | 0 .../test/docker-compose.yml | 0 server/{admin => admin-old}/tsconfig.json | 0 60 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 docker/admin-old.yml rename server/{admin => admin-old}/.gitignore (100%) rename server/{admin => admin-old}/README.md (100%) rename server/{admin => admin-old}/app/entry.client.tsx (100%) rename server/{admin => admin-old}/app/entry.server.tsx (100%) rename server/{admin => admin-old}/app/ra/App.tsx (100%) rename server/{admin => admin-old}/app/ra/authProvider.ts (100%) rename server/{admin => admin-old}/app/ra/components/ButtonWithConfirm.tsx (100%) rename server/{admin => admin-old}/app/ra/components/ChipItems.tsx (100%) rename server/{admin => admin-old}/app/ra/components/DangerButton.tsx (100%) rename server/{admin => admin-old}/app/ra/components/FilesizeField.tsx (100%) rename server/{admin => admin-old}/app/ra/components/GroupField.tsx (100%) rename server/{admin => admin-old}/app/ra/components/Image.tsx (100%) rename server/{admin => admin-old}/app/ra/components/PostListActionToolbar.tsx (100%) rename server/{admin => admin-old}/app/ra/components/UserField.tsx (100%) rename server/{admin => admin-old}/app/ra/dashboard/CardWithIcon.tsx (100%) rename server/{admin => admin-old}/app/ra/dashboard/Welcome.tsx (100%) rename server/{admin => admin-old}/app/ra/dashboard/cartouche.png (100%) rename server/{admin => admin-old}/app/ra/dashboard/cartoucheDark.png (100%) rename server/{admin => admin-old}/app/ra/dashboard/index.tsx (100%) rename server/{admin => admin-old}/app/ra/dashboard/logo.svg (100%) rename server/{admin => admin-old}/app/ra/i18n/builtin.ts (100%) rename server/{admin => admin-old}/app/ra/i18n/custom.ts (100%) rename server/{admin => admin-old}/app/ra/i18n/index.ts (100%) rename server/{admin => admin-old}/app/ra/i18n/resources.ts (100%) rename server/{admin => admin-old}/app/ra/layout/Menu.tsx (100%) rename server/{admin => admin-old}/app/ra/layout/index.tsx (100%) rename server/{admin => admin-old}/app/ra/request.ts (100%) rename server/{admin => admin-old}/app/ra/resources/chat.tsx (100%) rename server/{admin => admin-old}/app/ra/resources/file.tsx (100%) rename server/{admin => admin-old}/app/ra/resources/group.tsx (100%) rename server/{admin => admin-old}/app/ra/resources/user.tsx (100%) rename server/{admin => admin-old}/app/ra/routes/network/index.tsx (100%) rename server/{admin => admin-old}/app/ra/routes/socketio.tsx (100%) rename server/{admin => admin-old}/app/ra/routes/system/index.tsx (100%) rename server/{admin => admin-old}/app/ra/theme.ts (100%) rename server/{admin => admin-old}/app/ra/utils/hooks.ts (100%) rename server/{admin => admin-old}/app/ra/utils/index.ts (100%) rename server/{admin => admin-old}/app/root.tsx (100%) rename server/{admin => admin-old}/app/routes/admin/$.tsx (100%) rename server/{admin => admin-old}/app/routes/admin/index.tsx (100%) rename server/{admin => admin-old}/app/routes/index.tsx (100%) rename server/{admin => admin-old}/app/server/broker.ts (91%) rename server/{admin => admin-old}/app/server/index.ts (100%) rename server/{admin => admin-old}/app/server/middleware/auth.ts (100%) rename server/{admin => admin-old}/app/server/router/api.ts (100%) rename server/{admin => admin-old}/app/server/router/config.ts (100%) rename server/{admin => admin-old}/app/server/router/file.ts (100%) rename server/{admin => admin-old}/app/server/router/network.ts (100%) rename server/{admin => admin-old}/app/styles/app.css (100%) rename server/{admin => admin-old}/nodemon.json (100%) rename server/{admin => admin-old}/package.json (98%) rename server/{admin => admin-old}/public/favicon.ico (100%) rename server/{admin => admin-old}/remix.config.js (100%) rename server/{admin => admin-old}/remix.env.d.ts (100%) rename server/{admin => admin-old}/server.ts (100%) rename server/{admin => admin-old}/test/docker-compose.yml (100%) rename server/{admin => admin-old}/tsconfig.json (100%) diff --git a/docker/admin-old.yml b/docker/admin-old.yml new file mode 100644 index 00000000..e59dcd2b --- /dev/null +++ b/docker/admin-old.yml @@ -0,0 +1,20 @@ +version: "3.3" + +services: + # 后台应用 + tailchat-admin-old: + build: + context: ../ + image: tailchat + restart: unless-stopped + env_file: docker-compose.env + depends_on: + - mongo + - redis + labels: + - "traefik.enable=true" + - "traefik.http.routers.admin-old.rule=PathPrefix(`/admin`)" + - "traefik.http.services.admin-old.loadbalancer.server.port=3000" + networks: + - internal + command: pnpm start:admin-old diff --git a/package.json b/package.json index 26371d88..86aa994b 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,13 @@ "start:service": "cd server && pnpm start:service", "start:admin": "cd server/admin && pnpm start", "start:admin-next": "cd server/admin-next && pnpm start", - "build": "concurrently npm:build:web npm:build:server npm:build:admin npm:build:admin-next && cp -r client/web/dist/* server/dist/public", + "start:admin-old": "cd server/admin-old && pnpm start", + "build": "concurrently npm:build:web npm:build:server npm:build:admin-old npm:build:admin-next && cp -r client/web/dist/* server/dist/public", "build:web": "cd client/web && pnpm build", "build:server": "cd server && pnpm build && echo \"Install server side plugin:\" && pnpm run plugin:install com.msgbyte.tasks com.msgbyte.linkmeta com.msgbyte.github com.msgbyte.simplenotify com.msgbyte.topic com.msgbyte.agora com.msgbyte.wxpusher com.msgbyte.welcome && mkdir -p ./dist/public && cp -r ./public/plugins ./dist/public && cp ./public/registry-be.json ./dist/public", "build:admin": "cd server/admin && pnpm build", "build:admin-next": "cd server/admin-next && pnpm build", + "build:admin-old": "cd server/admin-old && pnpm build", "check:type": "concurrently npm:check:type:client npm:check:type:server", "check:type:client": "cd client/web && tsc --noEmit", "check:type:server": "cd server && tsc --noEmit", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index dbd98f89..666aef56 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,6 +7,7 @@ packages: - 'client/packages/**' - 'server' - 'server/admin' + - 'server/admin-old' - 'server/admin-next' - 'server/packages/**' - 'server/plugins/**' diff --git a/server/admin/.gitignore b/server/admin-old/.gitignore similarity index 100% rename from server/admin/.gitignore rename to server/admin-old/.gitignore diff --git a/server/admin/README.md b/server/admin-old/README.md similarity index 100% rename from server/admin/README.md rename to server/admin-old/README.md diff --git a/server/admin/app/entry.client.tsx b/server/admin-old/app/entry.client.tsx similarity index 100% rename from server/admin/app/entry.client.tsx rename to server/admin-old/app/entry.client.tsx diff --git a/server/admin/app/entry.server.tsx b/server/admin-old/app/entry.server.tsx similarity index 100% rename from server/admin/app/entry.server.tsx rename to server/admin-old/app/entry.server.tsx diff --git a/server/admin/app/ra/App.tsx b/server/admin-old/app/ra/App.tsx similarity index 100% rename from server/admin/app/ra/App.tsx rename to server/admin-old/app/ra/App.tsx diff --git a/server/admin/app/ra/authProvider.ts b/server/admin-old/app/ra/authProvider.ts similarity index 100% rename from server/admin/app/ra/authProvider.ts rename to server/admin-old/app/ra/authProvider.ts diff --git a/server/admin/app/ra/components/ButtonWithConfirm.tsx b/server/admin-old/app/ra/components/ButtonWithConfirm.tsx similarity index 100% rename from server/admin/app/ra/components/ButtonWithConfirm.tsx rename to server/admin-old/app/ra/components/ButtonWithConfirm.tsx diff --git a/server/admin/app/ra/components/ChipItems.tsx b/server/admin-old/app/ra/components/ChipItems.tsx similarity index 100% rename from server/admin/app/ra/components/ChipItems.tsx rename to server/admin-old/app/ra/components/ChipItems.tsx diff --git a/server/admin/app/ra/components/DangerButton.tsx b/server/admin-old/app/ra/components/DangerButton.tsx similarity index 100% rename from server/admin/app/ra/components/DangerButton.tsx rename to server/admin-old/app/ra/components/DangerButton.tsx diff --git a/server/admin/app/ra/components/FilesizeField.tsx b/server/admin-old/app/ra/components/FilesizeField.tsx similarity index 100% rename from server/admin/app/ra/components/FilesizeField.tsx rename to server/admin-old/app/ra/components/FilesizeField.tsx diff --git a/server/admin/app/ra/components/GroupField.tsx b/server/admin-old/app/ra/components/GroupField.tsx similarity index 100% rename from server/admin/app/ra/components/GroupField.tsx rename to server/admin-old/app/ra/components/GroupField.tsx diff --git a/server/admin/app/ra/components/Image.tsx b/server/admin-old/app/ra/components/Image.tsx similarity index 100% rename from server/admin/app/ra/components/Image.tsx rename to server/admin-old/app/ra/components/Image.tsx diff --git a/server/admin/app/ra/components/PostListActionToolbar.tsx b/server/admin-old/app/ra/components/PostListActionToolbar.tsx similarity index 100% rename from server/admin/app/ra/components/PostListActionToolbar.tsx rename to server/admin-old/app/ra/components/PostListActionToolbar.tsx diff --git a/server/admin/app/ra/components/UserField.tsx b/server/admin-old/app/ra/components/UserField.tsx similarity index 100% rename from server/admin/app/ra/components/UserField.tsx rename to server/admin-old/app/ra/components/UserField.tsx diff --git a/server/admin/app/ra/dashboard/CardWithIcon.tsx b/server/admin-old/app/ra/dashboard/CardWithIcon.tsx similarity index 100% rename from server/admin/app/ra/dashboard/CardWithIcon.tsx rename to server/admin-old/app/ra/dashboard/CardWithIcon.tsx diff --git a/server/admin/app/ra/dashboard/Welcome.tsx b/server/admin-old/app/ra/dashboard/Welcome.tsx similarity index 100% rename from server/admin/app/ra/dashboard/Welcome.tsx rename to server/admin-old/app/ra/dashboard/Welcome.tsx diff --git a/server/admin/app/ra/dashboard/cartouche.png b/server/admin-old/app/ra/dashboard/cartouche.png similarity index 100% rename from server/admin/app/ra/dashboard/cartouche.png rename to server/admin-old/app/ra/dashboard/cartouche.png diff --git a/server/admin/app/ra/dashboard/cartoucheDark.png b/server/admin-old/app/ra/dashboard/cartoucheDark.png similarity index 100% rename from server/admin/app/ra/dashboard/cartoucheDark.png rename to server/admin-old/app/ra/dashboard/cartoucheDark.png diff --git a/server/admin/app/ra/dashboard/index.tsx b/server/admin-old/app/ra/dashboard/index.tsx similarity index 100% rename from server/admin/app/ra/dashboard/index.tsx rename to server/admin-old/app/ra/dashboard/index.tsx diff --git a/server/admin/app/ra/dashboard/logo.svg b/server/admin-old/app/ra/dashboard/logo.svg similarity index 100% rename from server/admin/app/ra/dashboard/logo.svg rename to server/admin-old/app/ra/dashboard/logo.svg diff --git a/server/admin/app/ra/i18n/builtin.ts b/server/admin-old/app/ra/i18n/builtin.ts similarity index 100% rename from server/admin/app/ra/i18n/builtin.ts rename to server/admin-old/app/ra/i18n/builtin.ts diff --git a/server/admin/app/ra/i18n/custom.ts b/server/admin-old/app/ra/i18n/custom.ts similarity index 100% rename from server/admin/app/ra/i18n/custom.ts rename to server/admin-old/app/ra/i18n/custom.ts diff --git a/server/admin/app/ra/i18n/index.ts b/server/admin-old/app/ra/i18n/index.ts similarity index 100% rename from server/admin/app/ra/i18n/index.ts rename to server/admin-old/app/ra/i18n/index.ts diff --git a/server/admin/app/ra/i18n/resources.ts b/server/admin-old/app/ra/i18n/resources.ts similarity index 100% rename from server/admin/app/ra/i18n/resources.ts rename to server/admin-old/app/ra/i18n/resources.ts diff --git a/server/admin/app/ra/layout/Menu.tsx b/server/admin-old/app/ra/layout/Menu.tsx similarity index 100% rename from server/admin/app/ra/layout/Menu.tsx rename to server/admin-old/app/ra/layout/Menu.tsx diff --git a/server/admin/app/ra/layout/index.tsx b/server/admin-old/app/ra/layout/index.tsx similarity index 100% rename from server/admin/app/ra/layout/index.tsx rename to server/admin-old/app/ra/layout/index.tsx diff --git a/server/admin/app/ra/request.ts b/server/admin-old/app/ra/request.ts similarity index 100% rename from server/admin/app/ra/request.ts rename to server/admin-old/app/ra/request.ts diff --git a/server/admin/app/ra/resources/chat.tsx b/server/admin-old/app/ra/resources/chat.tsx similarity index 100% rename from server/admin/app/ra/resources/chat.tsx rename to server/admin-old/app/ra/resources/chat.tsx diff --git a/server/admin/app/ra/resources/file.tsx b/server/admin-old/app/ra/resources/file.tsx similarity index 100% rename from server/admin/app/ra/resources/file.tsx rename to server/admin-old/app/ra/resources/file.tsx diff --git a/server/admin/app/ra/resources/group.tsx b/server/admin-old/app/ra/resources/group.tsx similarity index 100% rename from server/admin/app/ra/resources/group.tsx rename to server/admin-old/app/ra/resources/group.tsx diff --git a/server/admin/app/ra/resources/user.tsx b/server/admin-old/app/ra/resources/user.tsx similarity index 100% rename from server/admin/app/ra/resources/user.tsx rename to server/admin-old/app/ra/resources/user.tsx diff --git a/server/admin/app/ra/routes/network/index.tsx b/server/admin-old/app/ra/routes/network/index.tsx similarity index 100% rename from server/admin/app/ra/routes/network/index.tsx rename to server/admin-old/app/ra/routes/network/index.tsx diff --git a/server/admin/app/ra/routes/socketio.tsx b/server/admin-old/app/ra/routes/socketio.tsx similarity index 100% rename from server/admin/app/ra/routes/socketio.tsx rename to server/admin-old/app/ra/routes/socketio.tsx diff --git a/server/admin/app/ra/routes/system/index.tsx b/server/admin-old/app/ra/routes/system/index.tsx similarity index 100% rename from server/admin/app/ra/routes/system/index.tsx rename to server/admin-old/app/ra/routes/system/index.tsx diff --git a/server/admin/app/ra/theme.ts b/server/admin-old/app/ra/theme.ts similarity index 100% rename from server/admin/app/ra/theme.ts rename to server/admin-old/app/ra/theme.ts diff --git a/server/admin/app/ra/utils/hooks.ts b/server/admin-old/app/ra/utils/hooks.ts similarity index 100% rename from server/admin/app/ra/utils/hooks.ts rename to server/admin-old/app/ra/utils/hooks.ts diff --git a/server/admin/app/ra/utils/index.ts b/server/admin-old/app/ra/utils/index.ts similarity index 100% rename from server/admin/app/ra/utils/index.ts rename to server/admin-old/app/ra/utils/index.ts diff --git a/server/admin/app/root.tsx b/server/admin-old/app/root.tsx similarity index 100% rename from server/admin/app/root.tsx rename to server/admin-old/app/root.tsx diff --git a/server/admin/app/routes/admin/$.tsx b/server/admin-old/app/routes/admin/$.tsx similarity index 100% rename from server/admin/app/routes/admin/$.tsx rename to server/admin-old/app/routes/admin/$.tsx diff --git a/server/admin/app/routes/admin/index.tsx b/server/admin-old/app/routes/admin/index.tsx similarity index 100% rename from server/admin/app/routes/admin/index.tsx rename to server/admin-old/app/routes/admin/index.tsx diff --git a/server/admin/app/routes/index.tsx b/server/admin-old/app/routes/index.tsx similarity index 100% rename from server/admin/app/routes/index.tsx rename to server/admin-old/app/routes/index.tsx diff --git a/server/admin/app/server/broker.ts b/server/admin-old/app/server/broker.ts similarity index 91% rename from server/admin/app/server/broker.ts rename to server/admin-old/app/server/broker.ts index 961e56d3..33e94e89 100644 --- a/server/admin/app/server/broker.ts +++ b/server/admin-old/app/server/broker.ts @@ -1,5 +1,5 @@ import { TcBroker, SYSTEM_USERID } from 'tailchat-server-sdk'; -import brokerConfig from '../../../moleculer.config'; +import brokerConfig from '../../moleculer.config'; const transporter = process.env.TRANSPORTER; export const broker = new TcBroker({ diff --git a/server/admin/app/server/index.ts b/server/admin-old/app/server/index.ts similarity index 100% rename from server/admin/app/server/index.ts rename to server/admin-old/app/server/index.ts diff --git a/server/admin/app/server/middleware/auth.ts b/server/admin-old/app/server/middleware/auth.ts similarity index 100% rename from server/admin/app/server/middleware/auth.ts rename to server/admin-old/app/server/middleware/auth.ts diff --git a/server/admin/app/server/router/api.ts b/server/admin-old/app/server/router/api.ts similarity index 100% rename from server/admin/app/server/router/api.ts rename to server/admin-old/app/server/router/api.ts diff --git a/server/admin/app/server/router/config.ts b/server/admin-old/app/server/router/config.ts similarity index 100% rename from server/admin/app/server/router/config.ts rename to server/admin-old/app/server/router/config.ts diff --git a/server/admin/app/server/router/file.ts b/server/admin-old/app/server/router/file.ts similarity index 100% rename from server/admin/app/server/router/file.ts rename to server/admin-old/app/server/router/file.ts diff --git a/server/admin/app/server/router/network.ts b/server/admin-old/app/server/router/network.ts similarity index 100% rename from server/admin/app/server/router/network.ts rename to server/admin-old/app/server/router/network.ts diff --git a/server/admin/app/styles/app.css b/server/admin-old/app/styles/app.css similarity index 100% rename from server/admin/app/styles/app.css rename to server/admin-old/app/styles/app.css diff --git a/server/admin/nodemon.json b/server/admin-old/nodemon.json similarity index 100% rename from server/admin/nodemon.json rename to server/admin-old/nodemon.json diff --git a/server/admin/package.json b/server/admin-old/package.json similarity index 98% rename from server/admin/package.json rename to server/admin-old/package.json index dc46cad3..d12935f8 100644 --- a/server/admin/package.json +++ b/server/admin-old/package.json @@ -1,5 +1,5 @@ { - "name": "tailchat-admin", + "name": "tailchat-admin-old", "private": true, "sideEffects": false, "scripts": { diff --git a/server/admin/public/favicon.ico b/server/admin-old/public/favicon.ico similarity index 100% rename from server/admin/public/favicon.ico rename to server/admin-old/public/favicon.ico diff --git a/server/admin/remix.config.js b/server/admin-old/remix.config.js similarity index 100% rename from server/admin/remix.config.js rename to server/admin-old/remix.config.js diff --git a/server/admin/remix.env.d.ts b/server/admin-old/remix.env.d.ts similarity index 100% rename from server/admin/remix.env.d.ts rename to server/admin-old/remix.env.d.ts diff --git a/server/admin/server.ts b/server/admin-old/server.ts similarity index 100% rename from server/admin/server.ts rename to server/admin-old/server.ts diff --git a/server/admin/test/docker-compose.yml b/server/admin-old/test/docker-compose.yml similarity index 100% rename from server/admin/test/docker-compose.yml rename to server/admin-old/test/docker-compose.yml diff --git a/server/admin/tsconfig.json b/server/admin-old/tsconfig.json similarity index 100% rename from server/admin/tsconfig.json rename to server/admin-old/tsconfig.json