fuc/storage/framework/smarty/compile/8a4a96cc30f8d77573b273c82931dc0f8a0b3009_0.file_create.tpl.php
2025-03-27 19:56:30 +08:00

291 lines
15 KiB
PHP
Executable File

<?php
/* Smarty version 5.3.1, created on 2025-03-15 12:26:13
from 'file:admin/node/create.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.3.1',
'unifunc' => 'content_67d50165f165f5_00455396',
'has_nocache_code' => false,
'file_dependency' =>
array (
'8a4a96cc30f8d77573b273c82931dc0f8a0b3009' =>
array (
0 => 'admin/node/create.tpl',
1 => 1741954578,
2 => 'file',
),
),
'includes' =>
array (
'file:admin/header.tpl' => 1,
'file:admin/footer.tpl' => 1,
),
))) {
function content_67d50165f165f5_00455396 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/node';
$_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);
?>
<?php echo '<script'; ?>
src="//<?php echo $_smarty_tpl->getValue('config')['jsdelivr_url'];?>
/npm/jsoneditor@latest/dist/jsoneditor.min.js"><?php echo '</script'; ?>
>
<link href="//<?php echo $_smarty_tpl->getValue('config')['jsdelivr_url'];?>
/npm/jsoneditor@latest/dist/jsoneditor.min.css" rel="stylesheet" type="text/css">
<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">创建节点</span>
</h2>
<div class="page-pretitle my-3">
<span class="home-subtitle">创建各类节点</span>
</div>
</div>
<div class="col-auto ms-auto d-print-none">
<div class="btn-list">
<a id="create-node" 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-6 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 required">名称</label>
<div class="col">
<input id="name" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">连接地址</label>
<div class="col">
<input id="server" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">流量倍率</label>
<div class="col">
<input id="traffic_rate" type="text" class="form-control"
value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">接入类型</label>
<div class="col">
<select id="sort" class="col form-select">
<option value="14">Trojan</option>
<option value="11">Vmess</option>
<option value="2">TUIC</option>
<option value="1">Shadowsocks2022</option>
<option value="0">Shadowsocks</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">自定义配置</label>
<div id="custom_config"></div>
<label class="form-label col-form-label">
请参考
<a href="//wiki.sspanel.org/#/custom-config" target="_blank">
wiki.sspanel.org/#/custom-config
</a>
修改节点自定义配置
</label>
</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="type" class="form-check-input" type="checkbox" checked="">
</label>
</span>
</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_dynamic_rate" class="form-check-input" type="checkbox" checked="">
</label>
</span>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">动态流量倍率计算方式</label>
<div class="col">
<select id="dynamic_rate_type" class="col form-select">
<option value="0">Logistic</option>
<option value="1">Linear</option>
</select>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">最大倍率</label>
<div class="col">
<input id="max_rate" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">最大倍率时间(时)</label>
<div class="col">
<input id="max_rate_time" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">最小倍率</label>
<div class="col">
<input id="min_rate" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">最小倍率时间(时)</label>
<div class="col">
<input id="min_rate_time" type="text" class="form-control" value="">
</div>
<label class="form-label col-form-label">
最大倍率时间必须大于最小倍率时间,否则将不会生效
</label>
</div>
</div>
</div>
</div>
<div class="col-md-6 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 required">等级</label>
<div class="col">
<input id="node_class" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">组别</label>
<div class="col">
<input id="node_group" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">排序组</label>
<div class="col">
<input id="order_group" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">转发 code</label>
<div class="col">
<input id="zhuanfa_code" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">duck code</label>
<div class="col">
<input id="duck_code" type="text" class="form-control" value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">备注</label>
<div class="col">
<input id="memo" type="text" class="form-control" value="">
</div>
</div>
<div class="hr-text">
<span>流量设置</span>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">可用流量 (GB)</label>
<div class="col">
<input id="node_bandwidth_limit" type="text" class="form-control"
value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">流量重置日</label>
<div class="col">
<input id="bandwidthlimit_resetday" type="text" class="form-control"
value="">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label required">速率限制 (Mbps)</label>
<div class="col">
<input id="node_speedlimit" type="text" class="form-control"
value="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo '<script'; ?>
>
const container = document.getElementById('custom_config');
let options = {
modes: ['code', 'tree'],
};
const editor = new JSONEditor(container, options);
$("#create-node").click(function () {
$.ajax({
url: '/admin/node',
type: 'POST',
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);?>
type: $("#type").is(":checked"),
custom_config: JSON.stringify(editor.get()),
},
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);
}
}