From c8aeaad963ceb64ff2c995190f5b08a2fbbabbbc Mon Sep 17 00:00:00 2001 From: lingling <1077478963@qq.com> Date: Fri, 6 Dec 2024 18:25:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=AF=E5=8F=A3=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=96=B0=E5=90=8E=E7=AB=AFapi=E5=AF=B9=E6=8E=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quasar.config.js | 1 + src/components/OriginalLinkItem.vue | 16 +++++----------- src/pages/IndexPage.vue | 9 +++++++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/quasar.config.js b/quasar.config.js index db15878..a094f80 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -80,6 +80,7 @@ module.exports = configure(function (/* ctx */) { // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer devServer: { // https: true + port: 9090, open: true, // opens browser window automatically }, diff --git a/src/components/OriginalLinkItem.vue b/src/components/OriginalLinkItem.vue index c6a45de..886885e 100644 --- a/src/components/OriginalLinkItem.vue +++ b/src/components/OriginalLinkItem.vue @@ -41,14 +41,6 @@ export default defineComponent({ const outtext = ref('') const signal_style = computed(() => { - // let tmp = '' - // if (time.value >= 0 && time.value <= 700) { - // tmp = 'green' - // } else if (time.value > 700 && time.value < 1400) { - // tmp = '#FF9800' - // } else { - // tmp = 'red' - // } return getColorForDelay(time.value) }) @@ -61,9 +53,11 @@ export default defineComponent({ vless.name = props.names[index] vless.host = ip vless.port = 9000 - vless.params.path = '/' - vless.params.security = 'none' - api.get_server_ms(ip, 9000, ip, 0).then((res) => { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + vless.params!.path = '/' + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + vless.params!.security = 'none' + api.get_server_ms(ip, 9000, '', 0).then((res) => { console.log(res) time.value = res.time online.value = res.is_online diff --git a/src/pages/IndexPage.vue b/src/pages/IndexPage.vue index 6c5f56e..bff3deb 100644 --- a/src/pages/IndexPage.vue +++ b/src/pages/IndexPage.vue @@ -47,8 +47,8 @@ export default defineComponent({ const names = ref([]) onMounted(() => { api.get_server().then((res) => { - for (let index = 0; index < res.data.length; index++) { - serves.value.push(res.data[index]); + for (let index = 0; index < res.data.data.length; index++) { + serves.value.push(res.data.data[index]); } }) }) @@ -74,6 +74,11 @@ export default defineComponent({ } // eslint-disable-next-line vue/no-side-effects-in-computed-properties if (tmp.name) { names.value.push(tmp.name) } + // eslint-disable-next-line vue/no-async-in-computed-properties + api.get_server_ms(tmp.server, tmp.port, tmp.query.path, 0).then((res) => { + console.log(res) + online.value = res.is_online + }) } }