<script setup>

import useUtils from "@/utils/utils.js"
import {ref} from "vue"
import DefinitionTable from "@/components/common/DefinitionTable.vue";

const utils = useUtils()

const props = defineProps(["v-scheduling", "v-params"])

const {scheduling} = (function () {
	let scheduling = props.vScheduling
	if (scheduling == null) {
		scheduling = {}
	}
	return {
		scheduling: ref(scheduling)
	}
})()

const update = function () {
	utils.popup("/servers/server/settings/reverseProxy/updateSchedulingPopup?" + props.vParams, {
		callback: function () {
			utils.success("保存成功", () => {
				utils.reload()
			})
		},
	})
}


</script>

<template>
	<div>
		<DefinitionTable>
			<tbody>
			<tr>
				<td class="title">当前正在使用的算法</td>
				<td>
					{{ scheduling.name }} &nbsp; <a href="" @click.prevent="update()"><span>修改</span></a>
					<p class="comment">{{ scheduling.description }}</p>
				</td>
			</tr>
			</tbody>
		</DefinitionTable>
	</div>
</template>

<style lang="postcss" scoped src="@/views/servers/style/server.pcss"></style>
<style scoped>
.title {
	font-family: Source Han Sans SC;
	font-weight: 400;
	font-size: 14px;
	line-height: 24px;
}
</style>
