<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 "./importRecords.js"
import Menu from "@/views/ns/domains/batch/@menu.vue";
import PostForm from "@/components/form/PostForm.vue";
import TTextarea from "@/components/ui/TTextarea.vue";
import CodeLabel from "@/components/common/CodeLabel.vue";
import SubmitButton from "@/components/form/SubmitButton.vue";
import DefinitionTable from "@/components/common/DefinitionTable.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<Menu :ctx="ctx"></Menu>

	<PostForm action="$" @success="ctx.success">
		<DefinitionTable>
			<tbody>
			<tr>
				<td class="title">解析记录 *</td>
				<td>
					<TTextarea rows="15" name="records" placeholder="每行一个解析记录
example.com www A 192.168.1.100 600" autofocus class="w-full"></TTextarea>
					<p class="comment">每行一个解析记录，格式：<CodeLabel>域名 记录名 记录类型 记录值 TTL</CodeLabel>，比如<CodeLabel>example.com www A 192.168.1.100 600</CodeLabel>，各项用空格隔开。</p>
				</td>
			</tr>
			</tbody>
		</DefinitionTable>
		<SubmitButton>批量导入</SubmitButton>
	</PostForm>
</template>

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