File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11<template >
22 <ServiceBase v-bind =" props" >
33 <template #description >
4- <template v-if =" ping ?.time >= 0 " >
5- {{ $t('service.ping.description') }} <span class =" border-b border-dashed" >{{ ping .time }} {{ $t('service.ping.units') }}</span >
4+ <template v-if =" data && data ?.time >= 0 " >
5+ {{ $t('service.ping.description') }} <span class =" border-b border-dashed" >{{ data .time }} {{ $t('service.ping.units') }}</span >
66 </template >
77 <template v-else >
88 {{ $t('service.ping.error') }}
@@ -16,7 +16,7 @@ import type { PingService } from '~/types/services'
1616
1717const props = defineProps <PingService >()
1818
19- const { data : ping , refresh } = await useFetch (' /api/services/ping' , { query: { id: props .id } })
19+ const { data, refresh } = await useFetch <{ time : number }> (' /api/services/ping' , { query: { id: props .id } })
2020const { pause } = useIntervalFn (refresh , props ?.options ?.interval || 10000 , { immediate: true })
2121
2222onBeforeUnmount (pause )
You can’t perform that action at this time.
0 commit comments