<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 "./setting.js"
import Menu from "./@menu.vue"
import ServerSettingLayout from "@/layouts/ServerSettingLayout.vue";
import PostForm from "@/components/form/PostForm.vue";
import ReverseProxyBox from "@/components/server/ReverseProxyBox.vue";
import SubmitButton from "@/components/form/SubmitButton.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<ServerSettingLayout :ctx="ctx">
		<Menu :ctx="ctx" active-tab="setting"></Menu>

		<PostForm action="$" @success="ctx.success">
			<input type="hidden" name="serverId" :value="ctx.serverId"/>
			<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(ctx.reverseProxyRef)"/>
			<ReverseProxyBox :v-reverse-proxy-ref="ctx.reverseProxyRef" :v-reverse-proxy-config="ctx.reverseProxyConfig" :v-family="ctx.serverFamily"></ReverseProxyBox>
			<SubmitButton class="mt-4"></SubmitButton>
		</PostForm>
	</ServerSettingLayout>
</template>

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