fuc/storage/framework/smarty/compile/b026093217b1f36182fa9e6fe43a9d722fdfbeb6_0.file_edit.tpl.php
2025-03-13 17:13:42 +08:00

335 lines
17 KiB
PHP
Executable File

<?php
/* Smarty version 5.3.1, created on 2025-02-04 10:24:09
from 'file:admin/user/edit.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.3.1',
'unifunc' => 'content_67a17a491a06f8_63360161',
'has_nocache_code' => false,
'file_dependency' =>
array (
'b026093217b1f36182fa9e6fe43a9d722fdfbeb6' =>
array (
0 => 'admin/user/edit.tpl',
1 => 1712762115,
2 => 'file',
),
),
'includes' =>
array (
'file:admin/header.tpl' => 1,
'file:admin/footer.tpl' => 1,
),
))) {
function content_67a17a491a06f8_63360161 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/user';
$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
?>
<div class="page-wrapper">
<div class="container-xl">
<div class="page-header d-print-none text-white">
<div class="row align-items-center">
<div class="col">
<h2 class="page-title">
<span class="home-title">用户 #<?php echo $_smarty_tpl->getValue('edit_user')->id;?>
</span>
</h2>
<div class="page-pretitle my-3">
<span class="home-subtitle">用户编辑</span>
</div>
</div>
<div class="col-auto">
<div class="btn-list">
<a id="save_changes" href="#" class="btn btn-primary">
<i class="icon ti ti-device-floppy"></i>
保存
</a>
</div>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="container-xl">
<div class="row row-deck row-cards">
<div class="col-md-4 col-sm-12">
<div class="card">
<div class="card-header card-header-light">
<h3 class="card-title">基础信息</h3>
</div>
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">注册邮箱</label>
<div class="col">
<input id="email" type="email" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->email;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">用户名</label>
<div class="col">
<input id="user_name" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->user_name;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">备注</label>
<div class="col">
<input id="remark" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->remark;?>
"
placeholder="仅管理员可见">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">账户密码</label>
<div class="col">
<input id="pass" type="text" class="form-control"
placeholder="若需为此用户重置密码, 填写此栏">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">账户余额</label>
<div class="col">
<input id="money" type="number" step="0.1" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->money;?>
">
</div>
</div>
<div class="hr-text">
<span>时间设置</span>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">等级过期时间</label>
<div class="col">
<input id="class_expire" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->class_expire;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">免费用户流量重置日</label>
<div class="col">
<input id="auto_reset_day" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->auto_reset_day;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">
重置的免费流量(GB)
</label>
<div class="col">
<input id="auto_reset_bandwidth" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->auto_reset_bandwidth;?>
">
</div>
</div>
<div class="hr-text">
<span>邀请注册</span>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">邀请人</label>
<div class="col">
<input id="ref_by" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->ref_by;?>
">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="card">
<div class="card-header card-header-light">
<h3 class="card-title">其他信息</h3>
</div>
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">流量限制</label>
<div class="col">
<input id="transfer_enable" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->enableTraffic();?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">当期用量</label>
<div class="col">
<input id="usedTraffic" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->usedTraffic();?>
" disabled/>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-4 col-form-label">累计用量</label>
<div class="col">
<input id="usedTraffic" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->totalTraffic();?>
" disabled/>
</div>
</div>
<div class="hr-text">
<span>高级选项</span>
</div>
<div class="form-group mb-3 row">
<span class="col">管理员</span>
<span class="col-auto">
<label class="form-check form-check-single form-switch">
<input id="is_admin" class="form-check-input" type="checkbox"
<?php if ($_smarty_tpl->getValue('edit_user')->is_admin) {?>checked="" <?php }?>>
</label>
</span>
</div>
<div class="form-group mb-3 row">
<span class="col">两步认证</span>
<span class="col-auto">
<label class="form-check form-check-single form-switch">
<input id="ga_enable" class="form-check-input" type="checkbox"
<?php if ($_smarty_tpl->getValue('edit_user')->ga_enable) {?>checked="" <?php }?>>
</label>
</span>
</div>
<div class="form-group mb-3 row">
<span class="col">账户异常状态</span>
<span class="col-auto form-check-single form-switch">
<input id="is_shadow_banned" class="form-check-input" type="checkbox"
<?php if ($_smarty_tpl->getValue('edit_user')->is_shadow_banned) {?>checked=""<?php }?>>
</span>
</div>
<div class="form-group mb-3 row">
<span class="col">封禁用户</span>
<span class="col-auto">
<label class="form-check form-check-single form-switch">
<input id="is_banned" class="form-check-input" type="checkbox"
<?php if ($_smarty_tpl->getValue('edit_user')->is_banned) {?>checked=""<?php }?>>
</label>
</span>
</div>
<div class="form-group mb-3 row">
<span class="col">手动封禁理由</span>
<span class="col-auto">
<input id="banned_reason" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->banned_reason;?>
">
</span>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12">
<div class="card">
<div class="card-header card-header-light">
<h3 class="card-title">连接设置</h3>
</div>
<div class="card-body">
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">端口</label>
<div class="col">
<input id="port" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->port;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">密码</label>
<div class="col">
<input id="passwd" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->passwd;?>
" disabled/>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">加密</label>
<div class="col">
<input id="method" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->method;?>
">
</div>
</div>
<div class="hr-text">
<span>使用限制</span>
</div>
<div class="form-group mb-3 col-12">
<label class="form-label col-12 col-form-label">节点群组</label>
<div class="col">
<input id="node_group" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->node_group;?>
">
</div>
</div>
<div class="form-group mb-3 col-12">
<label class="form-label col-12 col-form-label">账户等级</label>
<div class="col">
<input id="class" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('edit_user')->class;?>
">
</div>
</div>
<div class="form-group mb-3 col-12">
<label class="form-label col-12 col-form-label">速度限制 (Mbps)</label>
<div class="col">
<input id="node_speedlimit" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->node_speedlimit;?>
">
</div>
</div>
<div class="form-group mb-3 col-12">
<label class="form-label col-12 col-form-label">同時连接 IP 限制</label>
<div class="col">
<input id="node_iplimit" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('edit_user')->node_iplimit;?>
">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo '<script'; ?>
>
$("#save_changes").click(function () {
$.ajax({
url: '/admin/user/<?php echo $_smarty_tpl->getValue('edit_user')->id;?>
',
type: 'PUT',
dataType: "json",
data: {
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('update_field'), 'key');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('key')->value) {
$foreach0DoElse = false;
?>
<?php echo $_smarty_tpl->getValue('key');?>
: $('#<?php echo $_smarty_tpl->getValue('key');?>
').val(),
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
is_admin: $("#is_admin").is(":checked"),
is_banned: $("#is_banned").is(":checked"),
ga_enable: $("#ga_enable").is(":checked"),
is_shadow_banned: $("#is_shadow_banned").is(":checked"),
},
success: function (data) {
if (data.ret === 1) {
$('#success-message').text(data.msg);
$('#success-dialog').modal('show');
window.setTimeout("location.href=top.document.referrer", <?php echo $_smarty_tpl->getValue('config')['jump_delay'];?>
);
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
});
<?php echo '</script'; ?>
>
<?php $_smarty_tpl->renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
}
}