From c28c12ee017f2732d6aa914547d108a2d19485db Mon Sep 17 00:00:00 2001 From: lijiahang Date: Fri, 24 May 2024 10:47:28 +0800 Subject: [PATCH] =?UTF-8?q?:pencil:=20=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++ docs/README.md | 10 +++++++ docs/quickstart/docker-install.md | 2 -- .../common/constant/BeanOrderConst.java | 9 +++++-- .../constant/InterceptorOrderConst.java | 14 ---------- .../OrionLogPrinterConfiguration.java | 4 +-- .../src/main/resources/application-dev.yaml | 8 +++--- orion-visor-ui/.env.development | 1 + orion-visor-ui/.env.production | 1 + orion-visor-ui/index.html | 2 +- orion-visor-ui/src/assets/images/logo.svg | 17 ------------ orion-visor-ui/src/assets/logo.svg | 27 +++++++++++-------- .../src/components/app/navbar/index.vue | 2 +- orion-visor-ui/src/env.d.ts | 3 ++- orion-visor-ui/src/utils/env.ts | 3 +++ .../login/components/login-form.vue | 8 +++--- .../src/views/authentication/login/index.vue | 2 +- .../components/layout/layout-header.vue | 2 +- .../terminal/components/sftp/sftp-table.vue | 2 +- 19 files changed, 64 insertions(+), 63 deletions(-) delete mode 100644 orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/InterceptorOrderConst.java delete mode 100644 orion-visor-ui/src/assets/images/logo.svg diff --git a/README.md b/README.md index bff42e55..0aafa73e 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,16 @@ ## 快速开始 +```bash +# clone +git clone https://github.com/lijiahangmax/orion-visor +cd orion-visor +# 启动 +docker compose up -d +``` + +## 项目文档 + * [文档地址](https://lijiahangmax.github.io/orion-visor/#/) * [docker安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/docker-install) * [普通安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/install) diff --git a/docs/README.md b/docs/README.md index 76aecba1..a6e90b96 100644 --- a/docs/README.md +++ b/docs/README.md @@ -59,6 +59,16 @@ ## 快速开始 +```bash +# clone +git clone https://github.com/lijiahangmax/orion-visor +cd orion-visor +# 启动 +docker compose up -d +``` + +## 项目文档 + * [文档地址](https://lijiahangmax.github.io/orion-visor/#/) * [docker安装](/quickstart/docker-install) * [普通安装](/quickstart/install) diff --git a/docs/quickstart/docker-install.md b/docs/quickstart/docker-install.md index 685bb333..2342508e 100644 --- a/docs/quickstart/docker-install.md +++ b/docs/quickstart/docker-install.md @@ -37,8 +37,6 @@ cd orion-visor # MYSQL_ROOT_PASSWORD mysql root 密码 # REDIS_PASSWORD redis 密码 # SECRET_KEY 加密密钥 -# 构建 -docker compose build ``` ### 启动 diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/BeanOrderConst.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/BeanOrderConst.java index c2054799..e7446b3c 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/BeanOrderConst.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/BeanOrderConst.java @@ -17,11 +17,16 @@ public interface BeanOrderConst { /** * 演示模式切面 */ - int DEMO_DISABLE_API_ASPECT = 20; + int DEMO_DISABLE_API_ASPECT = Integer.MIN_VALUE + 10; + + /** + * 全局日志打印 + */ + int LOG_PRINT_ASPECT = Integer.MIN_VALUE + 20; /** * 操作日志切面 */ - int OPERATOR_LOG_ASPECT = 30; + int OPERATOR_LOG_ASPECT = Integer.MIN_VALUE + 30; } diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/InterceptorOrderConst.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/InterceptorOrderConst.java deleted file mode 100644 index 4699f12f..00000000 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/constant/InterceptorOrderConst.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.orion.visor.framework.common.constant; - -/** - * 拦截器排序常量 - * - * @author Jiahang Li - * @version 1.0.0 - * @since 2023/6/16 18:15 - */ -public interface InterceptorOrderConst { - - int LOG_FILTER = Integer.MIN_VALUE; - -} diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/configuration/OrionLogPrinterConfiguration.java b/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/configuration/OrionLogPrinterConfiguration.java index 7e43f6c3..c78e0dd3 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/configuration/OrionLogPrinterConfiguration.java +++ b/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/configuration/OrionLogPrinterConfiguration.java @@ -1,7 +1,7 @@ package com.orion.visor.framework.log.configuration; import com.orion.visor.framework.common.constant.AutoConfigureOrderConst; -import com.orion.visor.framework.common.constant.InterceptorOrderConst; +import com.orion.visor.framework.common.constant.BeanOrderConst; import com.orion.visor.framework.log.configuration.config.LogPrinterConfig; import com.orion.visor.framework.log.core.interceptor.LogPrinterInterceptor; import com.orion.visor.framework.log.core.interceptor.PrettyLogPrinterInterceptor; @@ -59,7 +59,7 @@ public class OrionLogPrinterConfiguration { AspectJExpressionPointcutAdvisor advisor = new AspectJExpressionPointcutAdvisor(); advisor.setExpression(config.getExpression()); advisor.setAdvice(logPrinterInterceptor); - advisor.setOrder(InterceptorOrderConst.LOG_FILTER); + advisor.setOrder(BeanOrderConst.LOG_PRINT_ASPECT); return advisor; } diff --git a/orion-visor-launch/src/main/resources/application-dev.yaml b/orion-visor-launch/src/main/resources/application-dev.yaml index 4a305484..c7b1a286 100644 --- a/orion-visor-launch/src/main/resources/application-dev.yaml +++ b/orion-visor-launch/src/main/resources/application-dev.yaml @@ -1,16 +1,16 @@ spring: datasource: druid: - url: jdbc:mysql://116.62.194.246:3306/orion_visor?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true + url: jdbc:mysql://127.0.0.1:3306/orion_visor?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true username: root - password: LjhData@123456 + password: Data@123456 initial-size: 0 min-idle: 1 max-active: 5 redis: - host: 116.62.194.246 + host: 127.0.0.1 port: 6379 - password: Ljhlijiahang + password: Data@123456 redisson: threads: 2 netty-threads: 2 diff --git a/orion-visor-ui/.env.development b/orion-visor-ui/.env.development index 39a1b12a..2c995fad 100644 --- a/orion-visor-ui/.env.development +++ b/orion-visor-ui/.env.development @@ -2,3 +2,4 @@ VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-visor/api' VITE_WS_BASE_URL= 'ws://127.0.0.1:9200/orion-visor/keep-alive' VITE_APP_VERSION= '2.0.2' VITE_SFTP_PREVIEW_MB= 2 +VITE_DEMO_MODE= false diff --git a/orion-visor-ui/.env.production b/orion-visor-ui/.env.production index d8e2ac94..dda3a55c 100644 --- a/orion-visor-ui/.env.production +++ b/orion-visor-ui/.env.production @@ -2,3 +2,4 @@ VITE_API_BASE_URL= '/orion-visor/api' VITE_WS_BASE_URL= '/orion-visor/keep-alive' VITE_APP_VERSION= '2.0.2' VITE_SFTP_PREVIEW_MB= 2 +VITE_DEMO_MODE= false diff --git a/orion-visor-ui/index.html b/orion-visor-ui/index.html index fa40894d..cfac14c9 100644 --- a/orion-visor-ui/index.html +++ b/orion-visor-ui/index.html @@ -2,7 +2,7 @@ - + Orion Visor diff --git a/orion-visor-ui/src/assets/images/logo.svg b/orion-visor-ui/src/assets/images/logo.svg deleted file mode 100644 index 99023d13..00000000 --- a/orion-visor-ui/src/assets/images/logo.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/orion-visor-ui/src/assets/logo.svg b/orion-visor-ui/src/assets/logo.svg index 3215438f..99023d13 100644 --- a/orion-visor-ui/src/assets/logo.svg +++ b/orion-visor-ui/src/assets/logo.svg @@ -1,12 +1,17 @@ - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/orion-visor-ui/src/components/app/navbar/index.vue b/orion-visor-ui/src/components/app/navbar/index.vue index aa207d76..0ec8d4da 100644 --- a/orion-visor-ui/src/components/app/navbar/index.vue +++ b/orion-visor-ui/src/components/app/navbar/index.vue @@ -7,7 +7,7 @@ + src="@/assets/logo.svg?url" /> diff --git a/orion-visor-ui/src/env.d.ts b/orion-visor-ui/src/env.d.ts index 24541247..7e5571c0 100644 --- a/orion-visor-ui/src/env.d.ts +++ b/orion-visor-ui/src/env.d.ts @@ -19,7 +19,8 @@ interface ImportMetaEnv { readonly VITE_API_BASE_URL: string; readonly VITE_WS_BASE_URL: string; readonly VITE_APP_VERSION: string; - readonly VITE_SFTP_PREVIEW_MB: number; + readonly VITE_SFTP_PREVIEW_MB: string; + readonly VITE_DEMO_MODE: string; } // editor diff --git a/orion-visor-ui/src/utils/env.ts b/orion-visor-ui/src/utils/env.ts index d626e6d3..4435ac3e 100644 --- a/orion-visor-ui/src/utils/env.ts +++ b/orion-visor-ui/src/utils/env.ts @@ -12,6 +12,9 @@ export const isStandaloneMode = (() => ( || document.referrer.includes('android-app://') ) === true)(); +// 是否为 demo 环境 +export const isDemoMode = (() => import.meta.env.VITE_DEMO_MODE === 'true')(); + // http base url export const httpBaseUrl = (() => { const configBase = import.meta.env.VITE_API_BASE_URL; diff --git a/orion-visor-ui/src/views/authentication/login/components/login-form.vue b/orion-visor-ui/src/views/authentication/login/components/login-form.vue index 14d49b53..0760927f 100644 --- a/orion-visor-ui/src/views/authentication/login/components/login-form.vue +++ b/orion-visor-ui/src/views/authentication/login/components/login-form.vue @@ -51,19 +51,17 @@ const router = useRouter(); const { t } = useI18n(); - const errorMessage = ref(''); const { loading, setLoading } = useLoading(); const userStore = useUserStore(); + const errorMessage = ref(''); + const userInfo = reactive({ username: undefined, password: undefined, }); - const handleSubmit = async ({ - errors, - values, - }: { + const handleSubmit = async ({ errors, values }: { errors: Record | undefined; values: LoginRequest; }) => { diff --git a/orion-visor-ui/src/views/authentication/login/index.vue b/orion-visor-ui/src/views/authentication/login/index.vue index 8e517f61..93281e71 100644 --- a/orion-visor-ui/src/views/authentication/login/index.vue +++ b/orion-visor-ui/src/views/authentication/login/index.vue @@ -4,7 +4,7 @@ diff --git a/orion-visor-ui/src/views/host/terminal/components/layout/layout-header.vue b/orion-visor-ui/src/views/host/terminal/components/layout/layout-header.vue index ae62d3a2..bccbdfca 100644 --- a/orion-visor-ui/src/views/host/terminal/components/layout/layout-header.vue +++ b/orion-visor-ui/src/views/host/terminal/components/layout/layout-header.vue @@ -5,7 +5,7 @@ + src="@/assets/logo.svg?url" />
Orion Visor
diff --git a/orion-visor-ui/src/views/host/terminal/components/sftp/sftp-table.vue b/orion-visor-ui/src/views/host/terminal/components/sftp/sftp-table.vue index c4e2ec43..d2245e1b 100644 --- a/orion-visor-ui/src/views/host/terminal/components/sftp/sftp-table.vue +++ b/orion-visor-ui/src/views/host/terminal/components/sftp/sftp-table.vue @@ -152,7 +152,7 @@ import columns from './types/table.columns'; import { FILE_TYPE, openSftpChmodModalKey, openSftpMoveModalKey } from '../../types/terminal.const'; - const previewSize = import.meta.env.VITE_SFTP_PREVIEW_MB; + const previewSize = Number.parseInt(import.meta.env.VITE_SFTP_PREVIEW_MB); const props = defineProps<{ session?: ISftpSession;