👔 完成历史记录功能优化多语言
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import {useStyleStore} from "~/stores/style";
|
||||
import {AdjustTimeToUTCOffset} from "~/utils/utc";
|
||||
import {useTimeStore} from "~/stores/time";
|
||||
|
||||
const {t} = useI18n()
|
||||
|
||||
@@ -15,9 +17,25 @@ const {data, pending, error, refresh} = await useAsyncData(
|
||||
})
|
||||
)
|
||||
|
||||
const timeStore = useTimeStore()
|
||||
const styleStore = useStyleStore()
|
||||
|
||||
styleStore.setIsPage(true)
|
||||
|
||||
const localePath = useLocalePath()
|
||||
|
||||
if (!error.value) {
|
||||
styleStore.addOrUpdateHistory(
|
||||
{
|
||||
id: domainData,
|
||||
type: 'dns',
|
||||
domain: domainData,
|
||||
path: localePath(`/dns/${domain}.html`),
|
||||
date: AdjustTimeToUTCOffset(new Date().toString(), timeStore.timeZones)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
useHead({
|
||||
title: `${domainData} - ${t('dns.title')}`,
|
||||
meta: [
|
||||
@@ -36,10 +54,10 @@ useHead({
|
||||
<div class="mt-5">
|
||||
<div class="bg-white shadow-lg rounded-lg overflow-hidden">
|
||||
<div class="p-6">
|
||||
<h2 class="text-2xl font-bold text-gray-800 mb-6">DNS查询结果</h2>
|
||||
<h2 class="text-2xl font-bold text-gray-800 mb-6">{{ t('dns.dnsResult') }}</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="font-semibold text-lg text-blue-600 mb-2">A记录</h3>
|
||||
<h3 class="font-semibold text-lg text-blue-600 mb-2">{{ t('dns.aRecord') }}</h3>
|
||||
<div class="border rounded-lg p-4 bg-blue-50">
|
||||
<ul class="list-none space-y-2">
|
||||
<li v-for="(record, index) in data.A" :key="'a-record-' + index" class="flex justify-between items-center">
|
||||
@@ -51,7 +69,7 @@ useHead({
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-semibold text-lg text-green-600 mb-2">NS记录</h3>
|
||||
<h3 class="font-semibold text-lg text-green-600 mb-2">{{ t('dns.nsRecord') }}</h3>
|
||||
<div class="border rounded-lg p-4 bg-green-50">
|
||||
<ul class="list-none space-y-2">
|
||||
<li v-for="(record, index) in data.NS" :key="'ns-record-' + index" class="flex justify-between items-center">
|
||||
@@ -62,7 +80,7 @@ useHead({
|
||||
</div>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<h3 class="font-semibold text-lg text-purple-600 mb-2">SOA记录</h3>
|
||||
<h3 class="font-semibold text-lg text-purple-600 mb-2">{{ t('dns.soaRecord') }}</h3>
|
||||
<div class="border rounded-lg p-4 bg-purple-50">
|
||||
<ul class="list-none space-y-2">
|
||||
<li><span class="font-medium text-gray-700">MName:</span> <span class="font-normal text-gray-600">{{ data.SOA.MName }}</span></li>
|
||||
|
||||
@@ -11,6 +11,12 @@ const {t} = useI18n()
|
||||
|
||||
const domainData = domain.replace(/_/g, '.')
|
||||
|
||||
const showRawData = ref(false);
|
||||
const timeStore = useTimeStore()
|
||||
const styleStore = useStyleStore()
|
||||
|
||||
const localePath = useLocalePath()
|
||||
|
||||
const {data, pending, error, refresh} = await useAsyncData(
|
||||
'mountains',
|
||||
() => $fetch('/api/whois', {
|
||||
@@ -19,12 +25,20 @@ const {data, pending, error, refresh} = await useAsyncData(
|
||||
})
|
||||
)
|
||||
|
||||
const parsedInfo = ParseWhois(data.value);
|
||||
const showRawData = ref(false);
|
||||
const timeStore = useTimeStore()
|
||||
const styleStore = useStyleStore()
|
||||
styleStore.setIsPage(true)
|
||||
if (!error.value) {
|
||||
styleStore.addOrUpdateHistory(
|
||||
{
|
||||
id: domainData,
|
||||
type: 'whois',
|
||||
domain: domainData,
|
||||
path: localePath(`/whois/${domain}.html`),
|
||||
date: AdjustTimeToUTCOffset(new Date().toString(), timeStore.timeZones)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const parsedInfo = ParseWhois(data.value);
|
||||
styleStore.setIsPage(true)
|
||||
useHead({
|
||||
title: `${domainData} - ${t('whois.title')}`,
|
||||
meta: [
|
||||
@@ -37,7 +51,6 @@ useHead({
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user