<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 ServerSettingLayout from "@/layouts/ServerSettingLayout.vue";
import ServerFeatureRequired from "@/components/server/ServerFeatureRequired.vue";
import HTTPHeaderPolicyBox from "@/components/server/HTTPHeaderPolicyBox.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<ServerSettingLayout :ctx="ctx">
		<div v-if="ctx.featureIsOn">
			<HTTPHeaderPolicyBox
				:v-request-header-policy="ctx.requestHeaderPolicy"
				:v-response-header-policy="ctx.responseHeaderPolicy"
				:v-params="'serverId=' + ctx.serverId"
				:v-has-group-request-config="ctx.hasGroupRequestConfig"
				:v-has-group-response-config="ctx.hasGroupResponseConfig"
				:v-group-setting-url="ctx.groupSettingURL"></HTTPHeaderPolicyBox>
		</div>
		<div v-if="!ctx.featureIsOn">
			<ServerFeatureRequired></ServerFeatureRequired>
		</div>
	</ServerSettingLayout>
</template>

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