From 630a1fd3cd44edc64834b341cb04e438ef11f35b Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 20 Jun 2024 01:29:43 +0000 Subject: [PATCH 01/15] test: add e2e testing base on docker compose --- .github/workflows/e2e.yaml | 21 ++++++++++++++++ docker-compose.yml | 33 +++++++++++++++++++++++++ e2e/Dockerfile | 6 +++++ e2e/entrypoint.sh | 3 +++ e2e/testsuite.yaml | 50 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 .github/workflows/e2e.yaml create mode 100644 e2e/Dockerfile create mode 100755 e2e/entrypoint.sh create mode 100644 e2e/testsuite.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 00000000..883ead32 --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,21 @@ +name: E2E + +on: + pull_request: + branches: + - main + +concurrency: + group: ${{github.workflow}} - ${{github.ref}} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: E2E Testing + run: | + sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose + sudo chmod u+x /usr/local/bin/docker-compose + docker compose up --build testing --exit-code-from testing --remove-orphans diff --git a/docker-compose.yml b/docker-compose.yml index 802a7426..49f3b7d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,18 @@ services: - DEMO_MODE=false volumes: - /data/orion-visor-space/docker-volumes/orion-visor-service/root-orion:/root/orion + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1/login"] + interval: 3s + timeout: 180s + retries: 30 + start_period: 3s depends_on: + orion-visor-mysql: + condition: service_healthy + orion-visor-redis: + condition: service_healthy + links: - orion-visor-mysql - orion-visor-redis orion-visor-mysql: @@ -34,6 +45,12 @@ services: - /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql:/var/lib/mysql - /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files - /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306"] + interval: 3s + timeout: 60s + retries: 10 + start_period: 3s orion-visor-redis: image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.9 privileged: true @@ -44,7 +61,23 @@ services: volumes: - /data/orion-visor-space/docker-volumes/orion-visor-redis/data:/data command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}" + healthcheck: + test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] + interval: 3s + timeout: 60s + retries: 10 + start_period: 3s orion-visor-adminer: image: adminer ports: - 8081:8080 + testing: + build: + context: e2e + environment: + SERVER: http://orion-visor-service:80 + depends_on: + orion-visor-service: + condition: service_healthy + links: + - orion-visor-service diff --git a/e2e/Dockerfile b/e2e/Dockerfile new file mode 100644 index 00000000..886f4f12 --- /dev/null +++ b/e2e/Dockerfile @@ -0,0 +1,6 @@ +FROM ghcr.io/linuxsuren/api-testing:v0.0.17 + +WORKDIR /workspace +COPY . . + +CMD [ "/workspace/entrypoint.sh" ] diff --git a/e2e/entrypoint.sh b/e2e/entrypoint.sh new file mode 100755 index 00000000..2aa71863 --- /dev/null +++ b/e2e/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +atest run -p testsuite.yaml --report md diff --git a/e2e/testsuite.yaml b/e2e/testsuite.yaml new file mode 100644 index 00000000..05f4e806 --- /dev/null +++ b/e2e/testsuite.yaml @@ -0,0 +1,50 @@ +#!api-testing +# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json +name: orion-visor +api: | + {{default "http://orion-visor-service:80" (env "SERVER")}} +items: +- name: login + request: + api: /orion-visor/api/infra/auth/login + method: POST + header: + Content-type: application/json + body: | + {"username":"admin","password":"admin"} + expect: + bodyFieldsExpect: + code: 200 +- name: userPermission + request: + api: /orion-visor/api/infra/permission/user?s={{.login.data.token}} + header: + Authorization: Bearer {{.login.data.token}} + expect: + bodyFieldsExpect: + code: 200 + message: "success" +- name: menu + request: + api: /orion-visor/api/infra/permission/menu + expect: + bodyFieldsExpect: + code: 200 + message: "success" +- name: haveUnRead + request: + api: /orion-visor/api/infra/system-message/has-unread + expect: + bodyFieldsExpect: + data: false +- name: queryOperatorLog + request: + api: /orion-visor/api/infra/mine/query-operator-log + method: POST +- name: hostList + request: + api: /orion-visor/api/infra/tag/list?type=HOST +- name: queryHost + request: + api: /orion-visor/api/asset/host/query + method: POST From 1ca93116256a8f5beb1f8a0a4cb7e21fc46b9e68 Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 20 Jun 2024 01:52:10 +0000 Subject: [PATCH 02/15] fix the password in e2e --- e2e/Dockerfile | 3 ++- e2e/testsuite.yaml | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/e2e/Dockerfile b/e2e/Dockerfile index 886f4f12..946e571f 100644 --- a/e2e/Dockerfile +++ b/e2e/Dockerfile @@ -1,4 +1,5 @@ -FROM ghcr.io/linuxsuren/api-testing:v0.0.17 +FROM ghcr.io/linuxsuren/api-testing:master +#v0.0.17 WORKDIR /workspace COPY . . diff --git a/e2e/testsuite.yaml b/e2e/testsuite.yaml index 05f4e806..76a444d6 100644 --- a/e2e/testsuite.yaml +++ b/e2e/testsuite.yaml @@ -11,29 +11,33 @@ items: header: Content-type: application/json body: | - {"username":"admin","password":"admin"} + {"username":"admin","password":"21232f297a57a5a743894a0e4a801fc3"} expect: bodyFieldsExpect: code: 200 - name: userPermission request: - api: /orion-visor/api/infra/permission/user?s={{.login.data.token}} + api: /orion-visor/api/infra/permission/user header: Authorization: Bearer {{.login.data.token}} expect: bodyFieldsExpect: code: 200 - message: "success" + msg: "success" - name: menu request: api: /orion-visor/api/infra/permission/menu + header: + Authorization: Bearer {{.login.data.token}} expect: bodyFieldsExpect: code: 200 - message: "success" + msg: "success" - name: haveUnRead request: api: /orion-visor/api/infra/system-message/has-unread + header: + Authorization: Bearer {{.login.data.token}} expect: bodyFieldsExpect: data: false From e04a972df55b952db52abac902390a98d2182da7 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:24:58 +0800 Subject: [PATCH 03/15] Update Dockerfile --- e2e/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/e2e/Dockerfile b/e2e/Dockerfile index 946e571f..886f4f12 100644 --- a/e2e/Dockerfile +++ b/e2e/Dockerfile @@ -1,5 +1,4 @@ -FROM ghcr.io/linuxsuren/api-testing:master -#v0.0.17 +FROM ghcr.io/linuxsuren/api-testing:v0.0.17 WORKDIR /workspace COPY . . From 95d8988f110c12673ed0e54ab0922280c934591b Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:25:23 +0800 Subject: [PATCH 04/15] Update e2e.yaml --- .github/workflows/e2e.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 883ead32..90551896 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - dev concurrency: group: ${{github.workflow}} - ${{github.ref}} From 2a49e7670d46ccbf41708584b3566effd0d98fe8 Mon Sep 17 00:00:00 2001 From: rick Date: Thu, 20 Jun 2024 02:56:16 +0000 Subject: [PATCH 05/15] fix the health check command --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 49f3b7d9..1d6fd3a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,10 +18,10 @@ services: volumes: - /data/orion-visor-space/docker-volumes/orion-visor-service/root-orion:/root/orion healthcheck: - test: ["CMD", "curl", "-f", "http://127.0.0.1/login"] + test: ["CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health"] interval: 3s - timeout: 180s - retries: 30 + timeout: 300s + retries: 200 start_period: 3s depends_on: orion-visor-mysql: From 2ec1678f018c1eeacfdb4be794347404754177bb Mon Sep 17 00:00:00 2001 From: lijiahang Date: Thu, 20 Jun 2024 11:53:39 +0800 Subject: [PATCH 06/15] =?UTF-8?q?:hammer:=20=E4=BF=AE=E6=94=B9=20ip=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visor/framework/common/utils/IpUtils.java | 20 +++++++++++++++++++ .../framework/common/utils/Requests.java | 2 +- .../PrettyLogPrinterInterceptor.java | 3 ++- .../interceptor/RowLogPrinterInterceptor.java | 3 ++- .../impl/AuthenticationServiceImpl.java | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/IpUtils.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/IpUtils.java index f88b151f..2e0398bf 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/IpUtils.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/IpUtils.java @@ -2,8 +2,12 @@ package com.orion.visor.framework.common.utils; import com.orion.ext.location.Region; import com.orion.ext.location.region.LocationRegions; +import com.orion.lang.constant.StandardHttpHeader; +import com.orion.lang.utils.Strings; import com.orion.visor.framework.common.constant.Const; +import com.orion.web.servlet.web.Servlets; +import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.Map; @@ -21,6 +25,22 @@ public class IpUtils { private IpUtils() { } + /** + * 获取请求地址 + * + * @param request request + * @return addr + */ + public static String getRemoteAddr(HttpServletRequest request) { + // 获取实际地址 + String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP); + if (!Strings.isBlank(realIp)) { + return realIp; + } + // 获取请求地址 + return Servlets.getRemoteAddr(request); + } + /** * 获取 ip 位置 * diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/Requests.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/Requests.java index ce553ab7..6757dd38 100644 --- a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/Requests.java +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/utils/Requests.java @@ -41,7 +41,7 @@ public class Requests { .map(s -> (ServletRequestAttributes) s) .map(ServletRequestAttributes::getRequest) .ifPresent(request -> { - String address = Servlets.getRemoteAddr(request); + String address = IpUtils.getRemoteAddr(request); identity.setAddress(address); identity.setLocation(IpUtils.getLocation(address)); identity.setUserAgent(Servlets.getUserAgent(request)); diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/PrettyLogPrinterInterceptor.java b/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/PrettyLogPrinterInterceptor.java index ed05e8b6..725a5bfe 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/PrettyLogPrinterInterceptor.java +++ b/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/PrettyLogPrinterInterceptor.java @@ -3,6 +3,7 @@ package com.orion.visor.framework.log.core.interceptor; import com.orion.lang.utils.Exceptions; import com.orion.lang.utils.Strings; import com.orion.lang.utils.time.Dates; +import com.orion.visor.framework.common.utils.IpUtils; import com.orion.visor.framework.common.utils.SwaggerUtils; import com.orion.visor.framework.log.configuration.config.LogPrinterConfig; import com.orion.web.servlet.web.Servlets; @@ -60,7 +61,7 @@ public class PrettyLogPrinterInterceptor extends AbstractLogPrinterInterceptor { // http if (request != null) { // remoteAddr - requestLog.append("\tremoteAddr: ").append(Servlets.getRemoteAddr(request)).append('\n'); + requestLog.append("\tremoteAddr: ").append(IpUtils.getRemoteAddr(request)).append('\n'); // header Servlets.getHeaderMap(request).forEach((hk, hv) -> { if (headerFilter.test(hk.toLowerCase())) { diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/RowLogPrinterInterceptor.java b/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/RowLogPrinterInterceptor.java index d05e2d64..51fe9169 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/RowLogPrinterInterceptor.java +++ b/orion-visor-framework/orion-visor-spring-boot-starter-log/src/main/java/com/orion/visor/framework/log/core/interceptor/RowLogPrinterInterceptor.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.orion.lang.utils.Exceptions; import com.orion.lang.utils.Strings; import com.orion.lang.utils.time.Dates; +import com.orion.visor.framework.common.utils.IpUtils; import com.orion.visor.framework.common.utils.SwaggerUtils; import com.orion.visor.framework.log.configuration.config.LogPrinterConfig; import com.orion.visor.framework.log.core.enums.LogFieldConst; @@ -61,7 +62,7 @@ public class RowLogPrinterInterceptor extends AbstractLogPrinterInterceptor impl // http if (request != null) { // remoteAddr - fields.put(REMOTE_ADDR, Servlets.getRemoteAddr(request)); + fields.put(REMOTE_ADDR, IpUtils.getRemoteAddr(request)); // header Map headers = new LinkedHashMap<>(); Servlets.getHeaderMap(request).forEach((hk, hv) -> { diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/AuthenticationServiceImpl.java b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/AuthenticationServiceImpl.java index 34760beb..bfb44a34 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/AuthenticationServiceImpl.java +++ b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/AuthenticationServiceImpl.java @@ -97,7 +97,7 @@ public class AuthenticationServiceImpl implements AuthenticationService { // 重设用户缓存 this.setUserCache(user); // 获取登录信息 - String remoteAddr = Servlets.getRemoteAddr(servletRequest); + String remoteAddr = IpUtils.getRemoteAddr(servletRequest); String location = IpUtils.getLocation(remoteAddr); String userAgent = Servlets.getUserAgent(servletRequest); long current = System.currentTimeMillis(); From 9ae5a6c6277bad2c507bfd2beb43ae1b2c7017c5 Mon Sep 17 00:00:00 2001 From: lijiahang Date: Thu, 20 Jun 2024 11:55:00 +0800 Subject: [PATCH 07/15] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E7=A0=81=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SystemSettingServiceImpl.java | 54 +++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/SystemSettingServiceImpl.java b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/SystemSettingServiceImpl.java index 19ebed6b..0ac50bcd 100644 --- a/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/SystemSettingServiceImpl.java +++ b/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/com/orion/visor/module/infra/service/impl/SystemSettingServiceImpl.java @@ -1,8 +1,10 @@ package com.orion.visor.module.infra.service.impl; -import com.orion.ext.process.Processes; +import com.orion.ext.process.ProcessAwaitExecutor; +import com.orion.lang.support.Attempt; import com.orion.lang.utils.Arrays1; import com.orion.lang.utils.Strings; +import com.orion.lang.utils.io.Streams; import com.orion.visor.framework.common.constant.AppConst; import com.orion.visor.framework.common.constant.Const; import com.orion.visor.framework.common.utils.Mixes; @@ -10,6 +12,8 @@ import com.orion.visor.module.infra.entity.vo.AppInfoVO; import com.orion.visor.module.infra.service.SystemSettingService; import org.springframework.stereotype.Service; +import java.io.ByteArrayOutputStream; + /** * 系统服务 实现类 * @@ -39,22 +43,33 @@ public class SystemSettingServiceImpl implements SystemSettingService { if (this.uuid != null) { return this.uuid; } - String[] cmd = new String[]{"cat /sys/class/dmi/id/product_serial", "dmidecode -s system-uuid", "wmic csproduct get uuid"}; - for (String s : cmd) { + String[][] cmd = new String[][]{ + new String[]{"/bin/sh", "-c", "cat /sys/class/dmi/id/product_serial"}, + new String[]{"/bin/bash", "-c", "cat /sys/class/dmi/id/product_serial"}, + new String[]{"/bin/sh", "-c", "dmidecode -s system-uuid"}, + new String[]{"/bin/bash", "-c", "dmidecode -s system-uuid"}, + new String[]{"cmd", "/c", "wmic csproduct get uuid"} + }; + for (String[] s : cmd) { try { - // 执行命令获取 uuid - String uuid = Processes.getOutputResultString(s); + String uuid = this.getCommandOutput(s); if (Strings.isBlank(uuid)) { continue; } // 去除符号并且转为大写 - uuid = uuid.replaceAll(Const.DASHED, Const.EMPTY).toUpperCase(); - // 去除特殊字符 + uuid = uuid.replaceAll(Const.DASHED, Const.EMPTY) + .toUpperCase() + .trim(); + // 去除 \n String extraUuid = Arrays1.last(uuid.trim().split(Const.LF)); if (!Strings.isBlank(extraUuid)) { - uuid = extraUuid; + uuid = extraUuid.trim(); + } + // 去除 : + extraUuid = Arrays1.last(uuid.trim().split(Const.COLON)); + if (!Strings.isBlank(extraUuid)) { + uuid = extraUuid.trim(); } - // 转义 return this.uuid = Mixes.obfuscate(uuid); } catch (Exception e) { // IGNORED @@ -63,4 +78,25 @@ public class SystemSettingServiceImpl implements SystemSettingService { return this.uuid = Const.UNKNOWN; } + /** + * 获取输出结果 + * + * @param command command + * @return result + */ + private String getCommandOutput(String[] command) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ProcessAwaitExecutor executor = new ProcessAwaitExecutor(command); + try { + executor.streamHandler(i -> Attempt.uncheck(Streams::transfer, i, out)) + .waitFor() + .sync() + .exec(); + return out.toString(); + } finally { + Streams.close(out); + Streams.close(executor); + } + } + } From 8dec40553d4f17c20bd2f67912c20b23ddf9b5b1 Mon Sep 17 00:00:00 2001 From: lijiahang Date: Fri, 21 Jun 2024 10:15:33 +0800 Subject: [PATCH 08/15] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=20terminal=20?= =?UTF-8?q?=E9=80=BB=E8=BE=91.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orion-visor-ui/src/store/modules/app/types.ts | 4 +- .../command-snippet-drawer.vue | 6 +- .../command-snippet-form-drawer.vue | 2 +- .../command-snippet-group-select.vue | 0 .../command-snippet-list-group.vue | 0 .../command-snippet-list-item.vue | 6 +- .../command-snippet/types/const.ts | 0 .../command-snippet/types/form.rules.ts | 0 .../components/layout/main-content.vue | 2 +- .../path-bookmark}/path-bookmark-drawer.vue | 15 ++-- .../path-bookmark-form-drawer.vue | 5 +- .../path-bookmark-group-select.vue | 0 .../path-bookmark-list-group.vue | 0 .../path-bookmark-list-item.vue | 6 +- .../components}/path-bookmark/types/const.ts | 6 -- .../path-bookmark/types/form.rules.ts | 0 .../components/sftp/sftp-chmod-modal.vue | 7 +- .../components/sftp/sftp-create-modal.vue | 7 +- .../components/sftp/sftp-move-modal.vue | 7 +- .../host/terminal/handler/base-session.ts | 46 ++++++++++ .../host/terminal/handler/sftp-session.ts | 29 ++----- .../host/terminal/handler/ssh-session.ts | 36 +++----- .../handler/terminal-output-processor.ts | 84 ++++++++++++------- .../handler/terminal-session-manager.ts | 24 ++---- .../src/views/host/terminal/index.vue | 8 +- .../host/terminal/types/terminal.const.ts | 4 + .../host/terminal/types/terminal.type.ts | 13 +-- 27 files changed, 177 insertions(+), 140 deletions(-) rename orion-visor-ui/src/views/host/{command-snippet/components => terminal/components/command-snippet}/command-snippet-drawer.vue (97%) rename orion-visor-ui/src/views/host/{command-snippet/components => terminal/components/command-snippet}/command-snippet-form-drawer.vue (98%) rename orion-visor-ui/src/views/host/{command-snippet/components => terminal/components/command-snippet}/command-snippet-group-select.vue (100%) rename orion-visor-ui/src/views/host/{command-snippet/components => terminal/components/command-snippet}/command-snippet-list-group.vue (100%) rename orion-visor-ui/src/views/host/{command-snippet/components => terminal/components/command-snippet}/command-snippet-list-item.vue (96%) rename orion-visor-ui/src/views/host/{ => terminal/components}/command-snippet/types/const.ts (100%) rename orion-visor-ui/src/views/host/{ => terminal/components}/command-snippet/types/form.rules.ts (100%) rename orion-visor-ui/src/views/host/{path-bookmark/components => terminal/components/path-bookmark}/path-bookmark-drawer.vue (95%) rename orion-visor-ui/src/views/host/{path-bookmark/components => terminal/components/path-bookmark}/path-bookmark-form-drawer.vue (96%) rename orion-visor-ui/src/views/host/{path-bookmark/components => terminal/components/path-bookmark}/path-bookmark-group-select.vue (100%) rename orion-visor-ui/src/views/host/{path-bookmark/components => terminal/components/path-bookmark}/path-bookmark-list-group.vue (100%) rename orion-visor-ui/src/views/host/{path-bookmark/components => terminal/components/path-bookmark}/path-bookmark-list-item.vue (97%) rename orion-visor-ui/src/views/host/{ => terminal/components}/path-bookmark/types/const.ts (57%) rename orion-visor-ui/src/views/host/{ => terminal/components}/path-bookmark/types/form.rules.ts (100%) create mode 100644 orion-visor-ui/src/views/host/terminal/handler/base-session.ts diff --git a/orion-visor-ui/src/store/modules/app/types.ts b/orion-visor-ui/src/store/modules/app/types.ts index f628b8cc..82ac0616 100644 --- a/orion-visor-ui/src/store/modules/app/types.ts +++ b/orion-visor-ui/src/store/modules/app/types.ts @@ -5,7 +5,7 @@ type ViewType = 'table' | 'card' | undefined; /** * 应用状态 */ -export interface AppState extends AppSetting, UserPreferenceLayout, UserPreferenceData, UserPreferenceViews { +export interface AppState extends AppSetting, UserPreferenceLayout, UserPreferenceData, UserPreferenceView { [key: string]: unknown; } @@ -43,7 +43,7 @@ export interface UserPreferenceData { /** * 用户偏好 - 页面视图 */ -export interface UserPreferenceViews { +export interface UserPreferenceView { hostView: ViewType; hostKeyView: ViewType; hostIdentityView: ViewType; diff --git a/orion-visor-ui/src/views/host/command-snippet/components/command-snippet-drawer.vue b/orion-visor-ui/src/views/host/terminal/components/command-snippet/command-snippet-drawer.vue similarity index 97% rename from orion-visor-ui/src/views/host/command-snippet/components/command-snippet-drawer.vue rename to orion-visor-ui/src/views/host/terminal/components/command-snippet/command-snippet-drawer.vue index 26dbba7c..798921ba 100644 --- a/orion-visor-ui/src/views/host/command-snippet/components/command-snippet-drawer.vue +++ b/orion-visor-ui/src/views/host/terminal/components/command-snippet/command-snippet-drawer.vue @@ -76,15 +76,15 @@