mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 检查cname是否正确配置
This commit is contained in:
+10
@@ -24,3 +24,13 @@ export async function GetByDomain(domain: string) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function DoVerify(id: number) {
|
||||
return await request({
|
||||
url: apiPrefix + "/verify",
|
||||
method: "post",
|
||||
data: {
|
||||
id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+38
-30
@@ -1,34 +1,34 @@
|
||||
<template>
|
||||
<tbody v-if="cnameRecord" class="cname-record-info">
|
||||
<tr>
|
||||
<!-- <td class="domain">-->
|
||||
<!-- {{ props.domain }}-->
|
||||
<!-- </td>-->
|
||||
<td class="host-record" :title="'域名:' + props.domain">
|
||||
<fs-copyable v-model="cnameRecord.hostRecord"></fs-copyable>
|
||||
</td>
|
||||
<td class="record-value">
|
||||
<fs-copyable v-model="cnameRecord.recordValue"></fs-copyable>
|
||||
</td>
|
||||
<td class="status center flex-center">
|
||||
<fs-values-format v-model="cnameRecord.status" :dict="statusDict"/>
|
||||
<fs-icon icon="ion:refresh-outline" class="pointer" @click="doRefresh"></fs-icon>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <td class="domain">-->
|
||||
<!-- {{ props.domain }}-->
|
||||
<!-- </td>-->
|
||||
<td class="host-record" :title="'域名:' + props.domain">
|
||||
<fs-copyable v-model="cnameRecord.hostRecord"></fs-copyable>
|
||||
</td>
|
||||
<td class="record-value">
|
||||
<fs-copyable v-model="cnameRecord.recordValue"></fs-copyable>
|
||||
</td>
|
||||
<td class="status center flex-center">
|
||||
<fs-values-format v-model="cnameRecord.status" :dict="statusDict" />
|
||||
<fs-icon icon="ion:refresh-outline" class="pointer" @click="doVerify"></fs-icon>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {CnameRecord, GetByDomain} from "/@/components/plugins/cert/domains-verify-plan-editor/api";
|
||||
import {ref, watch} from "vue";
|
||||
import {dict} from "@fast-crud/fast-crud";
|
||||
|
||||
import { CnameRecord, GetByDomain } from "/@/components/plugins/cert/domains-verify-plan-editor/api";
|
||||
import { ref, watch } from "vue";
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import * as api from "./api.js";
|
||||
const statusDict = dict({
|
||||
data: [
|
||||
{label: "待设置CNAME", value: "cname", color: "warning"},
|
||||
{label: "验证中", value: "validating", color: "primary"},
|
||||
{label: "验证成功", value: "valid", color: "success"},
|
||||
{label: "验证失败", value: "failed", color: "error"}
|
||||
{ label: "待设置CNAME", value: "cname", color: "warning" },
|
||||
{ label: "验证中", value: "validating", color: "primary" },
|
||||
{ label: "验证成功", value: "valid", color: "success" },
|
||||
{ label: "验证失败", value: "failed", color: "error" }
|
||||
]
|
||||
});
|
||||
|
||||
@@ -65,14 +65,22 @@ async function doRefresh() {
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.domain,
|
||||
async (value) => {
|
||||
await doRefresh();
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
() => props.domain,
|
||||
async (value) => {
|
||||
await doRefresh();
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
|
||||
async function doVerify() {
|
||||
if (!cnameRecord.value || !cnameRecord.value.id) {
|
||||
return;
|
||||
}
|
||||
await api.DoVerify(cnameRecord.value.id);
|
||||
await doRefresh();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
+5
-7
@@ -1,13 +1,11 @@
|
||||
<template>
|
||||
<table class="cname-verify-plan">
|
||||
<thead>
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="width: 160px">主机记录</td>
|
||||
<td style="width: 250px">请设置CNAME记录</td>
|
||||
<td style="width: 120px" class="center">状态</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 160px">主机记录</td>
|
||||
<td style="width: 250px">请设置CNAME记录(设置以后不要删除)</td>
|
||||
<td style="width: 120px" class="center">状态</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<template v-for="key in domains" :key="key">
|
||||
<cname-record-info :domain="key" @change="onRecordChange(key, $event)" />
|
||||
|
||||
+44
-45
@@ -8,55 +8,55 @@
|
||||
</div>
|
||||
<table class="plan-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>域名</th>
|
||||
<th>验证方式</th>
|
||||
<th>验证计划</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>域名</th>
|
||||
<th>验证方式</th>
|
||||
<th>验证计划</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, key) of planRef" :key="key" class="row">
|
||||
<td>{{ item.domain }}</td>
|
||||
<td>
|
||||
<div class="type">
|
||||
<a-select v-model:value="item.type" size="small" :options="challengeTypeOptions" @change="onPlanChanged"></a-select>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding: 0">
|
||||
<div class="plan">
|
||||
<div v-if="item.type === 'dns'" class="plan-dns">
|
||||
<div class="form-item">
|
||||
<span class="label">DNS类型:</span>
|
||||
<span class="input">
|
||||
<fs-dict-select
|
||||
v-model="item.dnsProviderType"
|
||||
size="small"
|
||||
:dict="dnsProviderTypeDict"
|
||||
placeholder="DNS提供商"
|
||||
@change="onPlanChanged"
|
||||
></fs-dict-select>
|
||||
</span>
|
||||
<tr v-for="(item, key) of planRef" :key="key" class="row">
|
||||
<td>{{ item.domain }}</td>
|
||||
<td>
|
||||
<div class="type">
|
||||
<a-select v-model:value="item.type" size="small" :options="challengeTypeOptions" @change="onPlanChanged"></a-select>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding: 0">
|
||||
<div class="plan">
|
||||
<div v-if="item.type === 'dns'" class="plan-dns">
|
||||
<div class="form-item">
|
||||
<span class="label">DNS类型:</span>
|
||||
<span class="input">
|
||||
<fs-dict-select
|
||||
v-model="item.dnsProviderType"
|
||||
size="small"
|
||||
:dict="dnsProviderTypeDict"
|
||||
placeholder="DNS提供商"
|
||||
@change="onPlanChanged"
|
||||
></fs-dict-select>
|
||||
</span>
|
||||
</div>
|
||||
<a-divider type="vertical" />
|
||||
<div class="form-item">
|
||||
<span class="label">DNS授权:</span>
|
||||
<span class="input">
|
||||
<access-selector
|
||||
v-model="item.dnsProviderAccessId"
|
||||
size="small"
|
||||
:type="item.dnsProviderType"
|
||||
placeholder="请选择"
|
||||
@change="onPlanChanged"
|
||||
></access-selector>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<a-divider type="vertical" />
|
||||
<div class="form-item">
|
||||
<span class="label">DNS授权:</span>
|
||||
<span class="input">
|
||||
<access-selector
|
||||
v-model="item.dnsProviderAccessId"
|
||||
size="small"
|
||||
:type="item.dnsProviderType"
|
||||
placeholder="请选择"
|
||||
@change="onPlanChanged"
|
||||
></access-selector>
|
||||
</span>
|
||||
<div v-if="item.type === 'cname'" class="plan-cname">
|
||||
<cname-verify-plan v-model="item.cnameVerifyPlan" @change="onPlanChanged" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.type === 'cname'" class="plan-cname">
|
||||
<cname-verify-plan v-model="item.cnameVerifyPlan" @change="onPlanChanged" />
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="error">
|
||||
@@ -119,7 +119,6 @@ const dnsProviderTypeDict = dict({
|
||||
url: "pi/dnsProvider/dnsProviderTypeDict"
|
||||
});
|
||||
function onPlanChanged() {
|
||||
debugger;
|
||||
emit("update:modelValue", planRef.value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user