style: Update NetTestView to use webp format for Slack logo
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -2,7 +2,7 @@
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import douban from '@images/logos/douban.png'
|
import douban from '@images/logos/douban.png'
|
||||||
import github from '@images/logos/github.png'
|
import github from '@images/logos/github.png'
|
||||||
import slack from '@images/logos/slack.png'
|
import slack from '@images/logos/slack.webp'
|
||||||
import telegram from '@images/logos/telegram.webp'
|
import telegram from '@images/logos/telegram.webp'
|
||||||
import tmdb from '@images/logos/tmdb.png'
|
import tmdb from '@images/logos/tmdb.png'
|
||||||
import wechat from '@images/logos/wechat.png'
|
import wechat from '@images/logos/wechat.png'
|
||||||
@@ -157,36 +157,26 @@ async function netTest(index: number) {
|
|||||||
if (result.success) {
|
if (result.success) {
|
||||||
target.status = 'OK'
|
target.status = 'OK'
|
||||||
target.message = '正常'
|
target.message = '正常'
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
target.status = 'Fail'
|
target.status = 'Fail'
|
||||||
target.message = result.message
|
target.message = result.message
|
||||||
}
|
}
|
||||||
target.time = result.data?.time
|
target.time = result.data?.time
|
||||||
target.btndisable = false
|
target.btndisable = false
|
||||||
}
|
} catch (error) {
|
||||||
catch (error) {
|
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载时测试所有连接
|
// 加载时测试所有连接
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
for (let i = 0; i < targets.value.length; i++)
|
for (let i = 0; i < targets.value.length; i++) await netTest(i)
|
||||||
await netTest(i)
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VList
|
<VList lines="two" border rounded>
|
||||||
lines="two"
|
<template v-for="(target, index) of targets" :key="target.name">
|
||||||
border
|
|
||||||
rounded
|
|
||||||
>
|
|
||||||
<template
|
|
||||||
v-for="(target, index) of targets"
|
|
||||||
:key="target.name"
|
|
||||||
>
|
|
||||||
<VListItem>
|
<VListItem>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VAvatar :image="target.image" />
|
<VAvatar :image="target.image" />
|
||||||
@@ -195,30 +185,14 @@ onMounted(async () => {
|
|||||||
{{ target.name }}
|
{{ target.name }}
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<VListItemSubtitle class="mt-1 me-2">
|
<VListItemSubtitle class="mt-1 me-2">
|
||||||
<VBadge
|
<VBadge dot location="start center" offset-x="2" :color="resolveStatusColor[target.status]" class="me-3">
|
||||||
dot
|
|
||||||
location="start center"
|
|
||||||
offset-x="2"
|
|
||||||
:color="resolveStatusColor[target.status]"
|
|
||||||
class="me-3"
|
|
||||||
>
|
|
||||||
<span class="ms-4">{{ target.message }}</span>
|
<span class="ms-4">{{ target.message }}</span>
|
||||||
</VBadge>
|
</VBadge>
|
||||||
|
|
||||||
<span
|
<span v-if="target.time" class="text-xs text-wrap text-disabled"> {{ target.time }} ms </span>
|
||||||
v-if="target.time"
|
|
||||||
class="text-xs text-wrap text-disabled"
|
|
||||||
>
|
|
||||||
{{ target.time }} ms
|
|
||||||
</span>
|
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
<template #append>
|
<template #append>
|
||||||
<VBtn
|
<VBtn size="small" icon="mdi-connection" :disabled="target.btndisable" @click="netTest(index)" />
|
||||||
size="small"
|
|
||||||
icon="mdi-connection"
|
|
||||||
:disabled="target.btndisable"
|
|
||||||
@click="netTest(index)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
<VDivider v-if="index !== targets.length - 1" />
|
<VDivider v-if="index !== targets.length - 1" />
|
||||||
|
|||||||