diff --git a/assets/css/main.css b/assets/css/main.css index 8dc82d3..6c98c4a 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -39,7 +39,7 @@ html.dark body { } .full-label .el-form-item__label { - width: 100%; + width: 100%!important; padding-right: 0; } @@ -50,6 +50,13 @@ html.dark body { flex: 1; } +.el-select__selection { + /* display: none!important; */ + min-height: 20px!important; + flex-wrap: nowrap!important; + overflow: hidden!important; +} + .el-table { font-size: 12px !important; } diff --git a/composables/configJson.ts b/composables/configJson.ts index ead5485..72a650f 100644 --- a/composables/configJson.ts +++ b/composables/configJson.ts @@ -5,7 +5,7 @@ import { uniq, intersection, isNil } from "lodash-es"; import { bounce } from "~/utils"; const b = bounce(600); -export type ConfigServerUrlType = Array | string | null | undefined | null; +export type ConfigServerUrlType = Array; export const updateConfigJsonBounce = (configJsonSeverUrl?: ConfigServerUrlType) => { b(async () => { @@ -22,8 +22,10 @@ export const updateConfigJson = async (configJsonSeverUrl?: ConfigServerUrlType) if (isNil(configJsonSeverUrl)) { configJsonSeverUrl = []; } - const isArray = Array.isArray(configJsonSeverUrl); - const isString = typeof configJsonSeverUrl === "string"; + if(typeof(configJsonSeverUrl) == 'string') { + configJsonSeverUrl = [configJsonSeverUrl]; + } + configJsonSeverUrl = configJsonSeverUrl || []; try { const { proxyNetworks, @@ -43,20 +45,14 @@ export const updateConfigJson = async (configJsonSeverUrl?: ConfigServerUrlType) udpWhitelistEnable, ...otherConfig } = mainStore.config; - let writeServerUrl: Array | string = serverUrl; + let writeServerUrl: Array = serverUrl; let writeCustomListenerData: Array = (customListenerData || "").split("\n"); - if (isArray) { - writeServerUrl = intersection( - uniq([serverUrl, ...configJsonSeverUrl]).filter(boolean => boolean), - mainStore.basePeers - ); - } - if (isString && configJsonSeverUrl) { - writeServerUrl = intersection( - uniq([serverUrl, ...(configJsonSeverUrl as string).split(",")]).filter(boolean => boolean), - mainStore.basePeers - ).join(","); - } + + writeServerUrl = intersection( + uniq([...serverUrl, ...configJsonSeverUrl]).filter(boolean => boolean), + mainStore.basePeers + ); + await writeTextFile( path, JSON.stringify({ serverUrl: writeServerUrl, enableCustomListener, customListenerData: writeCustomListenerData, ...otherConfig }, null, 4), diff --git a/package.json b/package.json index da0f159..3d2c48e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "author": "leizi97", "description": "A simple network initiator based on Easytier", - "version": "1.4.8", + "version": "1.4.9", "scripts": { "dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0", "build": "nuxt generate --dotenv env/.env.prod", @@ -31,7 +31,7 @@ "element-plus": "2.10.7", "less": "4.2.1", "lodash-es": "^4.17.21", - "nuxt": "3.18.1", + "nuxt": "3.19.2", "pinia": "3.0.3", "pinia-plugin-persistedstate": "4.4.1", "postcss": "^8.4.38", diff --git a/pages/index.vue b/pages/index.vue index 183795f..d036ab2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -45,7 +45,7 @@