<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 Menu from "@/views/lb/server/settings/reverseProxy/@menu.vue";
import WarningMessage from "@/components/common/WarningMessage.vue";
import OriginListBox from "@/components/server/OriginListBox.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<ChildLayout :ctx="ctx" :has-tab="true">
		<Menu :ctx="ctx" active-tab="index"></Menu>

		<div v-if="!ctx.reverseProxyRef.isOn">
			<WarningMessage class="mt-0">当前反向代理服务没有开启，可以通过点击 <a :href="'/lb/server/settings/reverseProxy/setting?serverId=' + ctx.serverId">[更多设置]</a> 开启 。</WarningMessage>
		</div>

		<OriginListBox :v-primary-origins="ctx.primaryOrigins" :v-backup-origins="ctx.backupOrigins"
					   :v-server-type="ctx.serverType"
					   :v-params="'type=server&serverId=' + ctx.serverId + '&reverseProxyId=' + ctx.reverseProxyConfig.id"></OriginListBox>
	</ChildLayout>
</template>

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