refactor(super_manage/image_hosting): uoj_form_v2

This commit is contained in:
Baoshuo Ren 2023-01-16 22:14:43 +08:00
parent ac45c82f44
commit 7f97630abf
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -1019,14 +1019,10 @@ if ($cur_tab == 'index') {
dieWithAlert('删除成功!');
}
$change_user_image_total_size_limit_form = new UOJBs4Form('change_user_image_total_size_limit');
$change_user_image_total_size_limit_form->submit_button_config['align'] = 'compressed';
$change_user_image_total_size_limit_form->addInput(
'change_user_image_total_size_limit_username',
'text',
'用户名',
'',
function ($x, &$vdata) {
$change_user_image_total_size_limit_form = new UOJForm('change_user_image_total_size_limit');
$change_user_image_total_size_limit_form->addInput('change_user_image_total_size_limit_username', [
'label' => '用户名',
'validator_php' => function ($x, &$vdata) {
if (!validateUsername($x)) {
return '用户名不合法';
}
@ -1039,14 +1035,13 @@ if ($cur_tab == 'index') {
return '';
},
null
);
$change_user_image_total_size_limit_form->addInput(
'change_user_image_total_size_limit_limit',
'text',
'存储限制单位Byte',
'104857600',
function ($x, &$vdata) {
]);
$change_user_image_total_size_limit_form->addInput('change_user_image_total_size_limit_limit', [
'div_class' => 'mt-3',
'label' => '存储限制',
'default_value' => '104857600',
'help' => '限制单位为 Byte。',
'validator_php' => function ($x, &$vdata) {
if (!validateUInt($x, 10)) {
return '限制不合法';
}
@ -1059,8 +1054,7 @@ if ($cur_tab == 'index') {
return '';
},
null
);
]);
$change_user_image_total_size_limit_form->handle = function (&$vdata) {
DB::update([
"update user_info",
@ -1084,7 +1078,6 @@ if ($cur_tab == 'index') {
<?= UOJLocale::get('system manage') ?>
</h1>
<div class="row mt-4">
<!-- left col -->
<div class="col-md-3">