<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 "./healthCheck.js"
import DomainMenu from "@/views/ns/domains/@menu_domain.vue";
import SubmitButton from "@/components/form/SubmitButton.vue";
import PostForm from "@/components/form/PostForm.vue";
import WarningMessage from "@/components/common/WarningMessage.vue";
import NSRecordsHealthCheckConfigBox from "@/components/ns/NSRecordsHealthCheckConfigBox.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<DomainMenu :ctx="ctx" activeTab="healthCheck"></DomainMenu>

	<WarningMessage disable-spacing v-if="!ctx.canUpdate">当前用户没有权限修改健康检查设置，请检查用户所属套餐。</WarningMessage>

	<PostForm action="$" @success="ctx.success">
		<input type="hidden" name="domainId" :value="ctx.domainId"/>

		<NSRecordsHealthCheckConfigBox v-model="ctx.config"></NSRecordsHealthCheckConfigBox>

		<SubmitButton :disabled="!ctx.canUpdate" class="mt-4"></SubmitButton>
	</PostForm>
</template>

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