From ef10c8b8b61568ee34b7bf47347a8f1f7a485a88 Mon Sep 17 00:00:00 2001 From: lijiahang Date: Mon, 24 Jun 2024 09:57:33 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=8C=85=E7=BB=93=E6=9E=84.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/enums/EndpointDefine.java | 40 ++++++++ .../main/resources/theme/terminal.theme.json | 96 +++++++++---------- .../asset/meta/TerminalThemeGenerator.java | 2 +- .../components}/ssh-config-form.vue | 9 +- .../drawer/index.vue} | 7 +- .../config/ssh => host-config}/types/const.ts | 12 +++ .../types/ssh-form.rules.ts} | 0 .../components}/host-transfer.vue | 0 .../drawer/index.vue} | 2 +- .../src/views/asset/host-list/index.vue | 4 +- .../src/views/asset/host-list/types/const.ts | 14 --- 11 files changed, 112 insertions(+), 74 deletions(-) create mode 100644 orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/enums/EndpointDefine.java rename orion-visor-ui/src/views/asset/{host-list/components/config/ssh => host-config/components}/ssh-config-form.vue (97%) rename orion-visor-ui/src/views/asset/{host-list/components/config/host-config-drawer.vue => host-config/drawer/index.vue} (92%) rename orion-visor-ui/src/views/asset/{host-list/components/config/ssh => host-config}/types/const.ts (82%) rename orion-visor-ui/src/views/asset/{host-list/components/config/ssh/types/form.rules.ts => host-config/types/ssh-form.rules.ts} (100%) rename orion-visor-ui/src/views/asset/{host-list/components/group => host-group/components}/host-transfer.vue (100%) rename orion-visor-ui/src/views/asset/{host-list/components/group/host-group-drawer.vue => host-group/drawer/index.vue} (98%) diff --git a/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/enums/EndpointDefine.java b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/enums/EndpointDefine.java new file mode 100644 index 00000000..1be17c53 --- /dev/null +++ b/orion-visor-framework/orion-visor-framework-common/src/main/java/com/orion/visor/framework/common/enums/EndpointDefine.java @@ -0,0 +1,40 @@ +package com.orion.visor.framework.common.enums; + +import com.orion.lang.utils.Strings; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 端点定义 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2024/6/21 19:15 + */ +@Getter +@AllArgsConstructor +public enum EndpointDefine { + + /** + * 上传临时分区 + */ + UPLOAD_SWAP("/upload/swap/{}"), + + ; + + /** + * 端点 + */ + private final String endpoint; + + /** + * 格式化 + * + * @param params params + * @return path + */ + public String format(Object... params) { + return Strings.format(this.endpoint, params); + } + +} diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/resources/theme/terminal.theme.json b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/resources/theme/terminal.theme.json index 3c4ec4a5..a1c8d50c 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/main/resources/theme/terminal.theme.json +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/main/resources/theme/terminal.theme.json @@ -1,4 +1,52 @@ [ + { + "name": "Dracula", + "dark": true, + "schema": { + "background": "#1E1F29", + "foreground": "#F8F8F2", + "cursor": "#BBBBBB", + "selectionBackground": "#44475A", + "black": "#000000", + "red": "#FF5555", + "green": "#50FA7B", + "yellow": "#F1FA8C", + "blue": "#BD93F9", + "cyan": "#8BE9FD", + "white": "#BBBBBB", + "brightBlack": "#555555", + "brightRed": "#FF5555", + "brightGreen": "#50FA7B", + "brightYellow": "#F1FA8C", + "brightBlue": "#BD93F9", + "brightCyan": "#8BE9FD", + "brightWhite": "#FFFFFF" + } + }, + { + "name": "Atom", + "dark": true, + "schema": { + "background": "#161719", + "foreground": "#C5C8C6", + "cursor": "#D0D0D0", + "selectionBackground": "#444444", + "black": "#000000", + "red": "#FD5FF1", + "green": "#87C38A", + "yellow": "#FFD7B1", + "blue": "#85BEFD", + "cyan": "#85BEFD", + "white": "#E0E0E0", + "brightBlack": "#000000", + "brightRed": "#FD5FF1", + "brightGreen": "#94FA36", + "brightYellow": "#F5FFA8", + "brightBlue": "#96CBFE", + "brightCyan": "#85BEFD", + "brightWhite": "#E0E0E0" + } + }, { "name": "catppuccin-mocha", "dark": true, @@ -95,54 +143,6 @@ "brightWhite": "#DCDFE4" } }, - { - "name": "Dracula", - "dark": true, - "schema": { - "background": "#1E1F29", - "foreground": "#F8F8F2", - "cursor": "#BBBBBB", - "selectionBackground": "#44475A", - "black": "#000000", - "red": "#FF5555", - "green": "#50FA7B", - "yellow": "#F1FA8C", - "blue": "#BD93F9", - "cyan": "#8BE9FD", - "white": "#BBBBBB", - "brightBlack": "#555555", - "brightRed": "#FF5555", - "brightGreen": "#50FA7B", - "brightYellow": "#F1FA8C", - "brightBlue": "#BD93F9", - "brightCyan": "#8BE9FD", - "brightWhite": "#FFFFFF" - } - }, - { - "name": "Atom", - "dark": true, - "schema": { - "background": "#161719", - "foreground": "#C5C8C6", - "cursor": "#D0D0D0", - "selectionBackground": "#444444", - "black": "#000000", - "red": "#FD5FF1", - "green": "#87C38A", - "yellow": "#FFD7B1", - "blue": "#85BEFD", - "cyan": "#85BEFD", - "white": "#E0E0E0", - "brightBlack": "#000000", - "brightRed": "#FD5FF1", - "brightGreen": "#94FA36", - "brightYellow": "#F5FFA8", - "brightBlue": "#96CBFE", - "brightCyan": "#85BEFD", - "brightWhite": "#E0E0E0" - } - }, { "name": "Apple System Colors", "dark": true, diff --git a/orion-visor-module-asset/orion-visor-module-asset-service/src/test/java/com/orion/visor/module/asset/meta/TerminalThemeGenerator.java b/orion-visor-module-asset/orion-visor-module-asset-service/src/test/java/com/orion/visor/module/asset/meta/TerminalThemeGenerator.java index cb4b30d1..97b832ab 100644 --- a/orion-visor-module-asset/orion-visor-module-asset-service/src/test/java/com/orion/visor/module/asset/meta/TerminalThemeGenerator.java +++ b/orion-visor-module-asset/orion-visor-module-asset-service/src/test/java/com/orion/visor/module/asset/meta/TerminalThemeGenerator.java @@ -28,9 +28,9 @@ public class TerminalThemeGenerator { List files = Files1.listFiles("D:\\idea-project\\iTerm2-Color-Schemes\\vhs"); // 过滤的 theme List schemaFilter = Lists.of( + "Dracula", "Atom", "catppuccin-mocha", "MaterialDesignColors", "catppuccin-macchiato", "OneHalfDark", - "Dracula", "Atom", "Apple System Colors", "Builtin Tango Light", "Duotone Dark", "BlulocoLight", "Chester", "CLRS", diff --git a/orion-visor-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue b/orion-visor-ui/src/views/asset/host-config/components/ssh-config-form.vue similarity index 97% rename from orion-visor-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue rename to orion-visor-ui/src/views/asset/host-config/components/ssh-config-form.vue index 6019f92d..c0ed63e1 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue +++ b/orion-visor-ui/src/views/asset/host-config/components/ssh-config-form.vue @@ -13,6 +13,7 @@ :before-change="s => updateStatus(s as number)" /> + import type { FieldRule } from '@arco-design/web-vue'; - import type { HostSshConfig } from './types/const'; + import type { HostSshConfig } from '../types/const'; import { reactive, ref, watch } from 'vue'; import { updateHostConfigStatus, updateHostConfig } from '@/api/asset/host-config'; - import { sshAuthTypeKey, sshOsTypeKey, SshAuthType, SshOsType } from './types/const'; - import rules from './types/form.rules'; + import { sshAuthTypeKey, sshOsTypeKey, SshAuthType, SshOsType } from '../types/const'; + import rules from '../types/ssh-form.rules'; import { Message } from '@arco-design/web-vue'; import useLoading from '@/hooks/loading'; import { useDictStore } from '@/store'; import { EnabledStatus } from '@/types/const'; - import { HostConfigType } from '../../../types/const'; + import { HostConfigType } from '../types/const'; import HostKeySelector from '@/components/asset/host-key/selector/index.vue'; import HostIdentitySelector from '@/components/asset/host-identity/selector/index.vue'; diff --git a/orion-visor-ui/src/views/asset/host-list/components/config/host-config-drawer.vue b/orion-visor-ui/src/views/asset/host-config/drawer/index.vue similarity index 92% rename from orion-visor-ui/src/views/asset/host-list/components/config/host-config-drawer.vue rename to orion-visor-ui/src/views/asset/host-config/drawer/index.vue index 9ea24856..1cf80c66 100644 --- a/orion-visor-ui/src/views/asset/host-list/components/config/host-config-drawer.vue +++ b/orion-visor-ui/src/views/asset/host-config/drawer/index.vue @@ -30,16 +30,15 @@