From 60b7874f654eef38986975be3f35b38b9a0863ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A3=B3=E5=A3=B3=E4=B8=AD=E7=9A=84=E5=AE=87=E5=AE=99?= Date: Thu, 9 Mar 2023 17:52:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96docker=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E6=96=87=E4=BB=B6=E8=BF=87=E5=A4=A7=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#415)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 更新文档 * Improve zh-TW locale (#379) * fix: 移动端样式 * feat: typo * fix: 调整滚动回原样 * :zap:优化docker打包镜像文件过大 --------- Co-authored-by: ChenZhaoYu <790348264@qq.com> Co-authored-by: Peter Dave Hello --- .dockerignore | 8 +-- Dockerfile | 14 ++++-- README.en.md | 6 +++ README.md | 6 +++ src/components/common/Setting/General.vue | 60 ++++++++++++----------- src/components/common/Setting/index.vue | 2 +- src/locales/zh-CN.ts | 2 +- src/locales/zh-TW.ts | 13 ++--- src/views/chat/index.vue | 1 + 9 files changed, 69 insertions(+), 43 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5078fcd..def59e5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,6 @@ +**/node_modules +*/node_modules node_modules Dockerfile -.git -.husky -.github -.vscode +.* +*/.* diff --git a/Dockerfile b/Dockerfile index f0b6f22..90a0f09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,11 @@ FROM node:lts-alpine AS builder COPY ./ /app WORKDIR /app -RUN npm install pnpm -g && pnpm install && pnpm run build +RUN apk add --no-cache git \ + && npm install pnpm -g \ + && pnpm install \ + && pnpm run build \ + && rm -rf /root/.npm /root/.pnpm-store /usr/local/share/.cache /tmp/* # service FROM node:lts-alpine @@ -13,8 +17,12 @@ COPY /service /app COPY --from=builder /app/dist /app/public WORKDIR /app -RUN npm install pnpm -g && pnpm install +RUN apk add --no-cache git \ + && npm install pnpm -g \ + && pnpm install --only=production \ + && rm -rf /root/.npm /root/.pnpm-store /usr/local/share/.cache /tmp/* + EXPOSE 3002 -CMD ["pnpm", "run", "start"] \ No newline at end of file +CMD ["pnpm", "run", "start"] diff --git a/README.en.md b/README.en.md index bffae14..6fa93e4 100644 --- a/README.en.md +++ b/README.en.md @@ -84,6 +84,12 @@ For all parameter variables, check [here](#docker-parameter-example) or see: [✓] Formatting and beautifying code-like message types +[✓] Access rights control + +[✓] Data import and export + +[✓] Save message to local image + [✓] Multilingual interface [✓] Interface themes diff --git a/README.md b/README.md index 32bac58..4f421fb 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,12 @@ API_REVERSE_PROXY= [✓] 对代码等消息类型的格式化美化处理 +[✓] 访问权限控制 + +[✓] 数据导入、导出 + +[✓] 保存消息到本地图片 + [✓] 界面多语言 [✓] 界面主题 diff --git a/src/components/common/Setting/General.vue b/src/components/common/Setting/General.vue index 2516cbb..e75b0a9 100644 --- a/src/components/common/Setting/General.vue +++ b/src/components/common/Setting/General.vue @@ -51,7 +51,7 @@ const themeOptions: { label: string; key: Theme; icon: string }[] = [ ] const languageOptions: { label: string; key: Language; value: Language }[] = [ - { label: '中文', key: 'zh-CN', value: 'zh-CN' }, + { label: '简体中文', key: 'zh-CN', value: 'zh-CN' }, { label: '繁體中文', key: 'zh-TW', value: 'zh-TW' }, { label: 'English', key: 'en-US', value: 'en-US' }, ] @@ -151,38 +151,41 @@ function handleImportButtonClick(): void {
{{ $t('setting.chatHistory') }} - - - {{ $t('common.export') }} - +
+ + + {{ $t('common.export') }} + - - - - {{ $t('common.import') }} - + + + + {{ $t('common.import') }} + - - - {{ $t('chat.clearHistoryConfirm') }} - + + + {{ $t('chat.clearHistoryConfirm') }} + +
{{ $t('setting.theme') }} -
+