<script setup>
// Copyright 2024 FlexCDN root@flexcdn.cn. All rights reserved. Official site: https://flexcdn.cn .

import PopupLayout from "@/layouts/PopupLayout.vue";
import ctxRef from "@/utils/ctx_ref.js"
import Context from "./updatePopup.js"
import TCheckboxBinary from "@/components/ui/TCheckboxBinary.vue";
import TInputText from "@/components/ui/TInputText.vue";
import PostForm from "@/components/form/PostForm.vue";
import SubmitButton from "@/components/form/SubmitButton.vue";
import DefinitionTable from "@/components/common/DefinitionTable.vue";

const ctx = ctxRef(new Context())

</script>

<template>
	<PopupLayout>
		<header>修改分组</header>
		<PostForm action="$" @success="ctx.success">
			<input type="hidden" name="groupId" :value="ctx.group.id"/>
			<DefinitionTable>
				<tbody>
				<tr>
					<td class="title">分组名称 *</td>
					<td>
						<TInputText name="name" maxlength="100" autofocus v-model="ctx.group.name" class="w-full"/>
					</td>
				</tr>
				<tr>
					<td>启用</td>
					<td>
						<TCheckboxBinary name="isOn" v-model="ctx.group.isOn"></TCheckboxBinary>
					</td>
				</tr>
				</tbody>
			</DefinitionTable>
			<SubmitButton></SubmitButton>
		</PostForm>
	</PopupLayout>
</template>

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