fuc/storage/framework/smarty/compile/933b7b5b66c1e2891bbdc1dcb6629578648ef5c1_0.file_edit.tpl.php
2025-03-27 19:56:30 +08:00

403 lines
21 KiB
PHP
Executable File

<?php
/* Smarty version 5.3.1, created on 2025-03-14 20:37:06
from 'file:admin/node/edit.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.3.1',
'unifunc' => 'content_67d422f233a1c2_03544758',
'has_nocache_code' => false,
'file_dependency' =>
array (
'933b7b5b66c1e2891bbdc1dcb6629578648ef5c1' =>
array (
0 => 'admin/node/edit.tpl',
1 => 1741954578,
2 => 'file',
),
),
'includes' =>
array (
'file:admin/header.tpl' => 1,
'file:admin/footer.tpl' => 1,
),
))) {
function content_67d422f233a1c2_03544758 (\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">节点 #<?php echo $_smarty_tpl->getValue('node')->id;?>
</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="save-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">名称</label>
<div class="col">
<input id="name" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->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="server" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->server;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">IPv4地址</label>
<div class="col">
<input type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->ipv4;?>
" disabled>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">IPv6地址</label>
<div class="col">
<input type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->ipv6;?>
" 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="traffic_rate" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('node')->traffic_rate;?>
">
</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" value="<?php echo $_smarty_tpl->getValue('node')->sort;?>
">
<option value="14" <?php if ($_smarty_tpl->getValue('node')->sort === 14) {?>selected<?php }?>>Trojan</option>
<option value="11" <?php if ($_smarty_tpl->getValue('node')->sort === 11) {?>selected<?php }?>>Vmess</option>
<option value="2" <?php if ($_smarty_tpl->getValue('node')->sort === 2) {?>selected<?php }?>>TUIC</option>
<option value="1" <?php if ($_smarty_tpl->getValue('node')->sort === 1) {?>selected<?php }?>>Shadowsocks2022</option>
<option value="0" <?php if ($_smarty_tpl->getValue('node')->sort === 0) {?>selected<?php }?>>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" <?php if ($_smarty_tpl->getValue('node')->type) {?>checked="" <?php }?>>
</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" <?php if ($_smarty_tpl->getValue('node')->is_dynamic_rate) {?>checked="" <?php }?>>
</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" value="<?php echo $_smarty_tpl->getValue('node')->dynamic_rate_type;?>
">
<option value="0" <?php if ($_smarty_tpl->getValue('node')->dynamic_rate_type === 0) {?>selected<?php }?>>Logistic</option>
<option value="1" <?php if ($_smarty_tpl->getValue('node')->dynamic_rate_type === 1) {?>selected<?php }?>>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="<?php echo $_smarty_tpl->getValue('node')->max_rate;?>
">
</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="<?php echo $_smarty_tpl->getValue('node')->max_rate_time;?>
">
</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="<?php echo $_smarty_tpl->getValue('node')->min_rate;?>
">
</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="<?php echo $_smarty_tpl->getValue('node')->min_rate_time;?>
">
</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">等级</label>
<div class="col">
<input id="node_class" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->node_class;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">组别</label>
<div class="col">
<input id="node_group" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->node_group;?>
">
</div>
</div>
<div class="order-group mb-3 row">
<label class="form-label col-3 col-form-label">排序组</label>
<div class="col">
<input id="order_group" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->order_group;?>
">
</div>
</div>
<div class="zhuanfa-group mb-3 row">
<label class="form-label col-3 col-form-label">转发 code</label>
<div class="col">
<input id="zhuanfa_code" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->zhuanfa_code;?>
">
</div>
</div>
<div class="duck-group mb-3 row">
<label class="form-label col-3 col-form-label">duck code</label>
<div class="col">
<input id="duck_code" type="text" class="form-control" value="<?php echo $_smarty_tpl->getValue('node')->duck_code;?>
">
</div>
</div>
<div class="duck-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="<?php echo $_smarty_tpl->getValue('node')->memo;?>
">
</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">已用流量</label>
<div class="col">
<input id="node_bandwidth" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('node')->node_bandwidth;?>
" disabled="">
</div>
<div class="col-auto">
<button id="reset-bandwidth" class="btn btn-red">重置</button>
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">可用流量 (GB)</label>
<div class="col">
<input id="node_bandwidth_limit" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('node')->node_bandwidth_limit;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">流量重置日</label>
<div class="col">
<input id="bandwidthlimit_resetday" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('node')->bandwidthlimit_resetday;?>
">
</div>
</div>
<div class="form-group mb-3 row">
<label class="form-label col-3 col-form-label">速率限制 (Mbps)</label>
<div class="col">
<input id="node_speedlimit" type="text" class="form-control"
value="<?php echo $_smarty_tpl->getValue('node')->node_speedlimit;?>
">
</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">节点通讯密钥</label>
<input type="text" class="form-control" id="password" value="<?php echo $_smarty_tpl->getValue('node')->password;?>
"
disabled="">
<div class="row my-3">
<div class="col">
<button id="reset-password" class="btn btn-red">重置</button>
<button id="copy-password" class="copy btn btn-primary"
data-clipboard-text="<?php echo $_smarty_tpl->getValue('node')->password;?>
">
复制
</button>
</div>
</div>
<label class="form-label col-form-label">
通讯密钥用于 NodeAPI 鉴权,如需更改请点击重置
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo '<script'; ?>
>
let clipboard = new ClipboardJS('.copy');
clipboard.on('success', function (e) {
$('#success-noreload-message').text('已复制到剪切板');
$('#success-noreload-dialog').modal('show');
});
const container = document.getElementById('custom_config');
let options = {
modes: ['code', 'tree'],
};
const editor = new JSONEditor(container, options);
editor.set(<?php echo $_smarty_tpl->getValue('node')->custom_config;?>
)
$("#reset-bandwidth").click(function () {
$.ajax({
url: '/admin/node/<?php echo $_smarty_tpl->getValue('node')->id;?>
/reset_bandwidth',
type: 'POST',
dataType: "json",
success: function (data) {
if (data.ret === 1) {
$('#success-message').text(data.msg);
$('#success-dialog').modal('show');
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
});
$("#reset-password").click(function () {
$.ajax({
url: '/admin/node/<?php echo $_smarty_tpl->getValue('node')->id;?>
/reset_password',
type: 'POST',
dataType: "json",
success: function (data) {
if (data.ret === 1) {
$('#success-message').text(data.msg);
$('#success-dialog').modal('show');
} else {
$('#fail-message').text(data.msg);
$('#fail-dialog').modal('show');
}
}
})
});
$("#save-node").click(function () {
$.ajax({
url: '/admin/node/<?php echo $_smarty_tpl->getValue('node')->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);?>
type: $("#type").is(":checked"),
is_dynamic_rate: $("#is_dynamic_rate").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);
}
}