<script setup>
import Navbar from "@/components/common/Navbar.vue";
import NavTab from "@/components/common/NavTab.vue";

const props = defineProps(["ctx"])
</script>

<template>
	<Navbar>
		<template #tabs>
			<NavTab :href="'/servers/server/settings/waf?serverId=' + ctx.serverId" value="index" name="设置"></NavTab>
			<NavTab :href="'/servers/server/settings/waf/groups?serverId=' + ctx.serverId + '&type=inbound&firewallPolicyId='+ctx.firewallPolicyId" value="inbound" v-if="ctx.firewallPolicyId > 0" name="入站规则"></NavTab>
			<NavTab :href="'/servers/server/settings/waf/groups?serverId=' + ctx.serverId + '&type=outbound&firewallPolicyId='+ctx.firewallPolicyId" value="outbound" v-if="ctx.firewallPolicyId > 0" name="出站规则"></NavTab>

			<NavTab separator></NavTab>
			<NavTab :href="'/servers/server/settings/waf/ipadmin/countries?serverId=' + ctx.serverId + '&firewallPolicyId='+ctx.firewallPolicyId" value="country" v-if="ctx.firewallPolicyId > 0" name="国家/地区封禁"></NavTab>
			<NavTab :href="'/servers/server/settings/waf/ipadmin/provinces?serverId=' + ctx.serverId + '&firewallPolicyId='+ctx.firewallPolicyId" value="province" v-if="ctx.firewallPolicyId > 0" name="省份封禁"></NavTab>

			<NavTab separator></NavTab>
			<NavTab :href="'/servers/server/settings/waf/ipadmin/allowList?serverId=' + ctx.serverId + '&firewallPolicyId='+ctx.firewallPolicyId" value="allowList" v-if="ctx.firewallPolicyId > 0" name="白名单"></NavTab>
			<NavTab :href="'/servers/server/settings/waf/ipadmin/denyList?serverId=' + ctx.serverId + '&firewallPolicyId='+ctx.firewallPolicyId" value="denyList" v-if="ctx.firewallPolicyId > 0" name="黑名单"></NavTab>
			<NavTab :href="'/servers/server/settings/waf/ipadmin/greyList?serverId=' + ctx.serverId + '&firewallPolicyId='+ctx.firewallPolicyId" value="greyList" v-if="ctx.firewallPolicyId > 0" name="灰名单"></NavTab>
			<NavTab :href="'/servers/server/settings/waf/ipadmin/test?serverId=' + ctx.serverId + '&firewallPolicyId='+ctx.firewallPolicyId" value="test">IP检查</NavTab>
		</template>
	</Navbar>
</template>

<style scoped lang="postcss">

</style>