📝 更新i18n

This commit is contained in:
7836246
2024-03-18 00:37:32 +08:00
parent 4c6250b1f9
commit 5b84925176
7 changed files with 67 additions and 15 deletions
+10 -6
View File
@@ -1,17 +1,20 @@
<template>
<div class="px-4 space-y-4">
<div class="flex gap-2 items-center">
<UInput v-model="newDomainSuffix" @input="searchSuffix" placeholder="域名后缀,如 .cn" class="flex-grow rounded shadow transition duration-200 ease-in-out" />
<UInput v-model="newWhoisServer" placeholder="Whois服务器,如 whois.cnnic.net.cn" class="flex-grow border-gray-300 rounded shadow transition duration-200 ease-in-out" />
<UButton @click="addSuffix" type="button" :disabled="suffixExists" class="p-2 bg-blue-500 text-white rounded hover:bg-blue-700 shadow disabled:bg-gray-400 disabled:cursor-not-allowed transition duration-200 ease-in-out">添加</UButton>
<UInput v-model="newDomainSuffix" @input="searchSuffix" :placeholder="t('settings.suffixPlaceholder')" class="flex-grow rounded shadow transition duration-200 ease-in-out" />
<UInput v-model="newWhoisServer" :placeholder="t('settings.whoisPlaceholder')" class="flex-grow border-gray-300 rounded shadow transition duration-200 ease-in-out" />
<UButton @click="addSuffix" type="button" :disabled="suffixExists" class="p-2 bg-blue-500 text-white rounded hover:bg-blue-700 shadow disabled:bg-gray-400 disabled:cursor-not-allowed transition duration-200 ease-in-out">
{{ t('common.actions.add') }}</UButton>
</div>
<div class="text-sm" v-if="suffixExists">
<span class="text-red-500">后缀已存在</span>
<span class="text-red-500">{{ t('common.actions.suffixExist') }}</span>
</div>
<div class="overflow-auto h-64 mt-4 bg-gray-50 rounded shadow">
<div v-for="(server, suffix) in domainStore.SupportedTLDs" :key="suffix" class="flex items-center justify-between p-2 border-b border-gray-200 last:border-b-0">
<div>{{ suffix }}: {{ server }}</div>
<UButton @click="removeSuffix(suffix)" type="button" class="bg-red-500 hover:bg-red-700 text-white p-1 rounded shadow transition duration-200 ease-in-out">删除</UButton>
<UButton @click="removeSuffix(suffix)" type="button" class="bg-red-500 hover:bg-red-700 text-white p-1 rounded shadow transition duration-200 ease-in-out">
{{ t('common.actions.delete') }}
</UButton>
</div>
</div>
</div>
@@ -24,6 +27,7 @@ const newWhoisServer = ref('');
const suffixExists = computed(() => newDomainSuffix.value in domainStore.SupportedTLDs);
const toast = useToast()
const {t} = useI18n();
const addSuffix = async () => {
if (newDomainSuffix.value && newWhoisServer.value && !suffixExists.value) {
@@ -31,7 +35,7 @@ const addSuffix = async () => {
newDomainSuffix.value = '';
newWhoisServer.value = '';
toast.add(
{ title: '添加成功' }
{ title: '`添加成功`' }
);
}
};