<script setup>
// Copyright 2024 FlexCDN root@flexcdn.cn. All rights reserved. Official site: https://flexcdn.cn .

import ctxRef from "@/utils/ctx_ref.js"
import Context from "./index.js"
import ChildLayout from "@/layouts/ChildLayout.vue";
import CopyToClipboard from "@/components/common/CopyToClipboard.vue";
import DefinitionTable from "@/components/common/DefinitionTable.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<ChildLayout :ctx="ctx" :has-tab="true">
		<DefinitionTable>
			<tbody>
			<tr>
				<td class="title">当前网站CNAME</td>
				<td>
					<span id="cname-text"><span v-if="ctx.dnsName.length > 0">{{ ctx.dnsName }}</span><span v-else>子域名</span>.<span v-if="ctx.dnsDomain.length > 0">{{ ctx.dnsDomain }}</span><span v-else>根域名</span></span> &nbsp;
					<CopyToClipboard :text="ctx.dnsName + '.' + ctx.dnsDomain"></CopyToClipboard>
					<p class="comment">可以在DNS设置一个CNAME记录，名字为你自己的域名，值为上面这个值。</p>
				</td>
			</tr>
			</tbody>
		</DefinitionTable>
	</ChildLayout>
</template>

<style lang="postcss" scoped>
</style>