diff --git a/easytier-web/frontend-lib/src/components/Config.vue b/easytier-web/frontend-lib/src/components/Config.vue
index eaa14286..0e49ada4 100644
--- a/easytier-web/frontend-lib/src/components/Config.vue
+++ b/easytier-web/frontend-lib/src/components/Config.vue
@@ -11,6 +11,8 @@ import {
} from '../types/network'
import { ref, onMounted, onUnmounted } from 'vue'
import { useI18n } from 'vue-i18n'
+import UrlInput from './UrlInput.vue'
+import UrlListInput from './UrlListInput.vue'
const props = defineProps<{
configInvalid?: boolean
@@ -32,57 +34,18 @@ const networking_methods = ref([
{ value: NetworkingMethod.Standalone, label: () => t('standalone') },
])
-const protos: { [proto: string]: number } = { tcp: 11010, udp: 11010, wg: 11011, ws: 11011, wss: 11012 }
-
-function searchUrlSuggestions(e: { query: string }): string[] {
- const query = e.query
- const ret = []
- // if query match "^\w+:.*", then no proto prefix
- if (query.match(/^\w+:.*/)) {
- // if query is a valid url, then add to suggestions
- try {
- // eslint-disable-next-line no-new
- new URL(query)
- ret.push(query)
- }
- catch { }
- }
- else {
- for (const proto in protos) {
- let item = `${proto}://${query}`
- // if query match ":\d+$", then no port suffix
- if (!query.match(/:\d+$/)) {
- item += `:${protos[proto]}`
- }
- ret.push(item)
- }
- }
-
- return ret
-}
-
-const publicServerSuggestions = ref([''])
-
-function searchPresetPublicServers(e: { query: string }) {
- const presetPublicServers = [
- 'tcp://public.easytier.top:11010',
- ]
-
- const query = e.query
- // if query is sub string of presetPublicServers, add to suggestions
- let ret = presetPublicServers.filter(item => item.includes(query))
- // add additional suggestions
- if (query.length > 0) {
- ret = ret.concat(searchUrlSuggestions(e))
- }
-
- publicServerSuggestions.value = ret
-}
-
-const peerSuggestions = ref([''])
-
-function searchPeerSuggestions(e: { query: string }) {
- peerSuggestions.value = searchUrlSuggestions(e)
+const protos: { [proto: string]: number } = {
+ tcp: 11010,
+ udp: 11010,
+ wg: 11011,
+ ws: 11011,
+ wss: 11012,
+ quic: 11012,
+ faketcp: 11013,
+ http: 80,
+ https: 443,
+ txt: 0,
+ srv: 0,
}
const inetSuggestions = ref([''])
@@ -99,34 +62,6 @@ function searchInetSuggestions(e: { query: string }) {
}
}
-const listenerSuggestions = ref([''])
-
-function searchListenerSuggestions(e: { query: string }) {
- const ret = []
-
- for (const proto in protos) {
- let item = `${proto}://0.0.0.0:`
- // if query is a number, use it as port
- if (e.query.match(/^\d+$/)) {
- item += e.query
- }
- else {
- item += protos[proto]
- }
-
- if (item.includes(e.query)) {
- ret.push(item)
- }
- }
-
- if (ret.length === 0) {
- ret.push(e.query)
- }
-
- listenerSuggestions.value = ret
-}
-
-
const exitNodesSuggestions = ref([''])
function searchExitNodesSuggestions(e: { query: string }) {
@@ -266,14 +201,12 @@ onMounted(() => {