🐛 修复一个会导致 500的Bug

This commit is contained in:
7836246
2024-03-03 08:03:42 +08:00
parent 2fbaf88ce2
commit e74f8b1e24
8 changed files with 128 additions and 34 deletions
+6 -2
View File
@@ -59,7 +59,9 @@ useHead({
<div>
<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">
<ul
v-if="data.A.length > 0"
class="list-none space-y-2">
<li v-for="(record, index) in data.A" :key="'a-record-' + index" class="flex justify-between items-center">
<span class="font-medium text-gray-700">IP:</span>
<span class="font-normal text-gray-600">{{ record.Record }}</span>
@@ -71,7 +73,9 @@ useHead({
<div>
<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">
<ul
v-if="data.NS.length > 0"
class="list-none space-y-2">
<li v-for="(record, index) in data.NS" :key="'ns-record-' + index" class="flex justify-between items-center">
<span class="font-normal text-gray-600">{{ record.Record }}</span>
<span class="text-sm text-gray-500">TTL: {{ record.TTL }}</span>
+29 -10
View File
@@ -57,7 +57,8 @@ useHead({
<table
class="w-full bg-[#fffffe] p-4 shadow-lg rounded-lg mt-5 dark:bg-gray-800 dark:text-gray-200 text-white hover:bg-none">
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr v-if="parsedInfo.domainName"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">
{{ t('result.domain') }}
</th>
@@ -70,47 +71,65 @@ useHead({
</p>
</td>
</tr>
<tr class="hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.registrar"
class="hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.registrar') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">{{ parsedInfo.registrar }}</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.updatedDate"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.updateDate') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">
{{ AdjustTimeToUTCOffset(parsedInfo.updatedDate, timeStore.timeZones) }}
</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.creationDate"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.createDate') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">
{{ AdjustTimeToUTCOffset(parsedInfo.creationDate, timeStore.timeZones) }}
</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.registryExpiryDate"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.expirationDate') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">
{{ AdjustTimeToUTCOffset(parsedInfo.registryExpiryDate, timeStore.timeZones) }}
</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.registrarIANAID"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.ianaId') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">{{ parsedInfo.registrarIANAID }}</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.domainStatus"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.status') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">{{ parsedInfo.domainStatus?.join(', ') }}</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.nameServers"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.dns') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">
<p v-for="item in parsedInfo.nameServers">{{ item }}</p>
</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="parsedInfo.dnssec"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.dnssec') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">{{ parsedInfo.dnssec }}</td>
</tr>
<tr class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<tr
v-if="data"
class="hover:bg-gray-100 text-gray-900 dark:hover:bg-gray-700 text-gray-200">
<th class="p-4 text-left font-semibold text-gray-900 dark:text-gray-200">{{ t('result.rawData') }}</th>
<td class="p-4 text-gray-900 dark:text-gray-200">
<UToggle color="sky" v-model="showRawData"/>