update 2025-02-15 20:34:39
This commit is contained in:
parent
58e829d3ca
commit
09a8092354
|
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_MAINTAINER:=Thaolga <https://github.com/Thaolga/luci-app-nekobox>
|
||||
PKG_NAME:=luci-app-nekobox
|
||||
PKG_VERSION:=1.7.9
|
||||
PKG_VERSION:=1.8.0
|
||||
PKG_RELEASE:=cn
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="186" height="20" role="img" aria-label="Latest Version: v1.7.9">
|
||||
<title>Latest Version: v1.7.9</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="186" height="20" role="img" aria-label="Latest Version: v1.8.0">
|
||||
<title>Latest Version: v1.8.0</title>
|
||||
<linearGradient id="s" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||
<stop offset="1" stop-opacity=".1"/>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
||||
<text aria-hidden="true" x="495" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="700" style="letter-spacing: -5;">Latest Version</text>
|
||||
<text x="495" y="140" transform="scale(.1)" fill="#fff" textLength="700" style="letter-spacing: -5;">Latest Version</text>
|
||||
<text aria-hidden="true" x="1405" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="600" style="letter-spacing: -3;">v1.7.9</text>
|
||||
<text x="1405" y="140" transform="scale(.1)" fill="#fff" textLength="600" style="letter-spacing: -3;">v1.7.9</text>
|
||||
<text aria-hidden="true" x="1405" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="600" style="letter-spacing: -3;">v1.8.0</text>
|
||||
<text x="1405" y="140" transform="scale(.1)" fill="#fff" textLength="600" style="letter-spacing: -3;">v1.8.0</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -1,5 +1,5 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="186" height="20" role="img" aria-label="Current Version: v1.7.9">
|
||||
<title>Current Version: v1.7.9</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="186" height="20" role="img" aria-label="Current Version: v1.8.0">
|
||||
<title>Current Version: v1.8.0</title>
|
||||
<linearGradient id="s" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||
<stop offset="1" stop-opacity=".1"/>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
|
||||
<text aria-hidden="true" x="495" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="700" style="letter-spacing: -5;">Current Version</text>
|
||||
<text x="495" y="140" transform="scale(.1)" fill="#fff" textLength="700" style="letter-spacing: -5;">Current Version</text>
|
||||
<text aria-hidden="true" x="1405" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="600" style="letter-spacing: -3;">v1.7.9</text>
|
||||
<text x="1405" y="140" transform="scale(.1)" fill="#fff" textLength="600" style="letter-spacing: -3;">v1.7.9</text>
|
||||
<text aria-hidden="true" x="1405" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="600" style="letter-spacing: -3;">v1.8.0</text>
|
||||
<text x="1405" y="140" transform="scale(.1)" fill="#fff" textLength="600" style="letter-spacing: -3;">v1.8.0</text>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -17,6 +17,7 @@ $yacd_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/meta?h
|
|||
$zash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/zashboard?hostname=' . $neko_cfg['ctrl_host'] . '&port=' . $neko_cfg['ctrl_port'] . '&secret=' . $neko_cfg['secret'];
|
||||
$meta_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/metacubexd?hostname=' . $neko_cfg['ctrl_host'] . '&port=' . $neko_cfg['ctrl_port'] . '&secret=' . $neko_cfg['secret'];
|
||||
$dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashboard?hostname=' . $neko_cfg['ctrl_host'] . '&port=' . $neko_cfg['ctrl_port'] . '&secret=' . $neko_cfg['secret'];
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en" data-bs-theme="<?php echo substr($neko_theme,0,-4) ?>">
|
||||
|
@ -29,8 +30,6 @@ $dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashbo
|
|||
<link href="./assets/css/custom.css" rel="stylesheet">
|
||||
<link href="./assets/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
||||
<link href="./assets/theme/<?php echo $neko_theme ?>" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css?v=<?php echo time(); ?>" />
|
||||
<script src="script.js?v=<?php echo time(); ?>"></script>
|
||||
<script type="text/javascript" src="./assets/js/feather.min.js"></script>
|
||||
<script type="text/javascript" src="./assets/js/jquery-2.1.3.min.js"></script>
|
||||
<script type="text/javascript" src="./assets/js/bootstrap.min.js"></script>
|
||||
|
@ -79,49 +78,49 @@ $dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashbo
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- <button id="fullscreenToggle" class="btn btn-primary mb-2">全屏</button> -->
|
||||
<!-- <button id="fullscreenToggle" class="btn btn-primary mb-2">Fullscreen</button> -->
|
||||
<head>
|
||||
<div class="container-sm container-bg text-center callout border border-3 rounded-4 col-11">
|
||||
<div class="row">
|
||||
<a href="./index.php" class="col btn btn-lg"><i class="bi bi-house-door"></i> 首页</a>
|
||||
<a href="./dashboard.php" class="col btn btn-lg"><i class="bi bi-bar-chart"></i> 面板</a>
|
||||
<a href="./singbox.php" class="col btn btn-lg"><i class="bi bi-box"></i> 订阅</a>
|
||||
<a href="./settings.php" class="col btn btn-lg"><i class="bi bi-gear"></i> 设定</a>
|
||||
<a href="./index.php" class="col btn btn-lg text-nowrap"><i class="bi bi-house-door"></i> <span data-translate="home">Home</span></a>
|
||||
<a href="./dashboard.php" class="col btn btn-lg text-nowrap"><i class="bi bi-bar-chart"></i> <span data-translate="panel">Panel</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg text-nowrap"><i class="bi bi-box"></i> <span data-translate="document">Document</span></a>
|
||||
<a href="./settings.php" class="col btn btn-lg text-nowrap"><i class="bi bi-gear"></i> <span data-translate="settings">Settings</span></a>
|
||||
</div>
|
||||
<div class="container-fluid text-left p-3" style="max-width: 2400px; width: 100%;">
|
||||
<div class="h-100 mb-5">
|
||||
<iframe id="iframeMeta" class="border border-3 rounded-4 w-100" style="height: 75vh; width: 100%; max-width: 2400px;" src="http://<?php echo $zash_link; ?>" title="zash" allowfullscreen></iframe>
|
||||
<div class="mb-3 mt-3">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#panelModal">
|
||||
面板设置
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#panelModal" data-translate="panel_settings">
|
||||
Panel Settings
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal fade" id="panelModal" tabindex="-1" aria-labelledby="panelModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="panelModalLabel">选择面板</h5>
|
||||
<h5 class="modal-title" id="panelModalLabel" data-translate="select_panel">Select Panel</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div>
|
||||
<label for="panelSelect" class="form-label">选择面板</label>
|
||||
<label for="panelSelect" class="form-label" data-translate="select_panel">Select Panel</label>
|
||||
<select id="panelSelect" class="form-select" onchange="changeIframe(this.value)">
|
||||
<option value="http://<?php echo $zash_link; ?>">ZASHBOARD 面板</option>
|
||||
<option value="http://<?php echo $yacd_link; ?>">YACD-META 面板</option>
|
||||
<option value="http://<?php echo $dash_link; ?>">DASHBOARD 面板</option>
|
||||
<option value="http://<?php echo $meta_link; ?>">METACUBEXD 面板</option>
|
||||
<option value="http://<?php echo $zash_link; ?>" data-translate="zash_panel"></option>
|
||||
<option value="http://<?php echo $yacd_link; ?>" data-translate="yacd_panel"></option>
|
||||
<option value="http://<?php echo $dash_link; ?>" data-translate="dash_panel"></option>
|
||||
<option value="http://<?php echo $meta_link; ?>" data-translate="metacubexd_panel"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="d-flex justify-content-around mt-3">
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $yacd_link; ?>">YACD-META 面板</a>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $dash_link; ?>">DASHBOARD 面板</a>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $meta_link; ?>">METACUBEXD 面板</a>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $zash_link; ?>">ZASHBOARD 面板</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $yacd_link; ?>" data-translate="yacd_panel"></a>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $dash_link; ?>" data-translate="dash_panel"></a>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $meta_link; ?>" data-translate="metacubexd_panel"></a>
|
||||
<a class="btn btn-info btn-sm text-white" target="_blank" href="http://<?php echo $zash_link; ?>" data-translate="zash_panel"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-translate="close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -175,7 +174,7 @@ $dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashbo
|
|||
} else if (iframeContainer.msRequestFullscreen) {
|
||||
iframeContainer.msRequestFullscreen();
|
||||
}
|
||||
fullscreenToggle.textContent = '退出全屏';
|
||||
fullscreenToggle.textContent = 'Exit Fullscreen';
|
||||
isFullscreen = true;
|
||||
} else {
|
||||
if (document.exitFullscreen) {
|
||||
|
@ -187,7 +186,7 @@ $dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashbo
|
|||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
fullscreenToggle.textContent = '全屏';
|
||||
fullscreenToggle.textContent = 'Fullscreen';
|
||||
isFullscreen = false;
|
||||
}
|
||||
});
|
||||
|
@ -202,4 +201,4 @@ $dash_link = $neko_cfg['ctrl_host'] . ':' . $neko_cfg['ctrl_port'] . '/ui/dashbo
|
|||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include './cfg.php';
|
||||
date_default_timezone_set('Asia/Shanghai');
|
||||
|
||||
$str_cfg = substr($selected_config, strlen("$neko_dir/config") + 1);
|
||||
$_IMG = '/luci-static/ssr/';
|
||||
$singbox_bin = '/usr/bin/sing-box';
|
||||
|
@ -244,44 +244,43 @@ timestamp() {
|
|||
}
|
||||
|
||||
if [ -f "\$LOG_FILE" ] && [ \$(stat -c %s "\$LOG_FILE") -gt \$MAX_SIZE ]; then
|
||||
echo "\$(timestamp) Sing-box 日志文件 (\$LOG_FILE) 超过 \$MAX_SIZE 字节. 清理日志..." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Sing-box log file (\$LOG_FILE) exceeded \$MAX_SIZE bytes. Clearing log..." >> \$LOG_PATH 2>&1
|
||||
> "\$LOG_FILE"
|
||||
echo "\$(timestamp) Sing-box 日志文件 (\$LOG_FILE) 已清空." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Sing-box log file (\$LOG_FILE) has been cleared." >> \$LOG_PATH 2>&1
|
||||
else
|
||||
echo "\$(timestamp) Sing-box 日志文件 (\$LOG_FILE) 在大小限制内, 无需操作." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Sing-box log file (\$LOG_FILE) is within the size limit. No action needed." >> \$LOG_PATH 2>&1
|
||||
fi
|
||||
|
||||
if [ -f "\$TMP_LOG_FILE" ] && [ \$(stat -c %s "\$TMP_LOG_FILE") -gt \$MAX_SIZE ]; then
|
||||
echo "\$(timestamp) Mihomo 日志文件 (\$TMP_LOG_FILE) 超过 \$MAX_SIZE 字节. 清理日志..." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Mihomo log file (\$TMP_LOG_FILE) exceeded \$MAX_SIZE bytes. Clearing log..." >> \$LOG_PATH 2>&1
|
||||
> "\$TMP_LOG_FILE"
|
||||
echo "\$(timestamp) Mihomo 日志文件 (\$TMP_LOG_FILE) 已清空." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Mihomo log file (\$TMP_LOG_FILE) has been cleared." >> \$LOG_PATH 2>&1
|
||||
else
|
||||
echo "\$(timestamp) Mihomo 日志文件 (\$TMP_LOG_FILE) 在大小限制内, 无需操作." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Mihomo log file (\$TMP_LOG_FILE) is within the size limit. No action needed." >> \$LOG_PATH 2>&1
|
||||
fi
|
||||
|
||||
if [ -f "\$ADDITIONAL_LOG_FILE" ] && [ \$(stat -c %s "\$ADDITIONAL_LOG_FILE") -gt \$MAX_SIZE ]; then
|
||||
echo "\$(timestamp) NeKoBox 日志文件 (\$ADDITIONAL_LOG_FILE) 超过 \$MAX_SIZE 字节. 清理日志..." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) NeKoBox log file (\$ADDITIONAL_LOG_FILE) exceeded \$MAX_SIZE bytes. Clearing log..." >> \$LOG_PATH 2>&1
|
||||
> "\$ADDITIONAL_LOG_FILE"
|
||||
echo "\$(timestamp) NeKoBox 日志文件 (\$ADDITIONAL_LOG_FILE) 已清空." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) NeKoBox log file (\$ADDITIONAL_LOG_FILE) has been cleared." >> \$LOG_PATH 2>&1
|
||||
else
|
||||
echo "\$(timestamp) NeKoBox 日志文件 (\$ADDITIONAL_LOG_FILE) 在大小限制内, 无需操作." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) NeKoBox log file (\$ADDITIONAL_LOG_FILE) is within the size limit. No action needed." >> \$LOG_PATH 2>&1
|
||||
fi
|
||||
|
||||
echo "\$(timestamp) 日志轮换完成." >> \$LOG_PATH 2>&1
|
||||
echo "\$(timestamp) Log rotation completed." >> \$LOG_PATH 2>&1
|
||||
EOL;
|
||||
|
||||
$cronScriptPath = '/etc/neko/core/set_cron.sh';
|
||||
file_put_contents($cronScriptPath, $cronScriptContent);
|
||||
chmod($cronScriptPath, 0755);
|
||||
shell_exec("sh $cronScriptPath");
|
||||
echo '<div id="cron-success-message" style="display: none;" class="alert alert-success">已创建并执行定时任务脚本,添加或更新日志清理任务,清理 $log_file 和 $tmp_log_file 的日志。</div>';
|
||||
}
|
||||
|
||||
function rotateLogs($logFile, $maxSize = 1048576) {
|
||||
if (file_exists($logFile) && filesize($logFile) > $maxSize) {
|
||||
file_put_contents($logFile, '');
|
||||
chmod($logFile, 0644);
|
||||
// echo "Log file cleared successfully.\n";
|
||||
//echo "Log file cleared successfully.\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -396,32 +395,32 @@ if (isset($_POST['singbox'])) {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'disable':
|
||||
writeToLog("Stopping Sing-box");
|
||||
$pid = getSingboxPID();
|
||||
if ($pid) {
|
||||
writeToLog("Killing Sing-box PID: $pid");
|
||||
shell_exec("kill $pid");
|
||||
if (file_exists('/usr/sbin/fw4')) {
|
||||
shell_exec("nft flush ruleset");
|
||||
} else {
|
||||
shell_exec("iptables -t mangle -F");
|
||||
shell_exec("iptables -t mangle -X");
|
||||
}
|
||||
shell_exec("/etc/init.d/firewall restart");
|
||||
writeToLog("Cleared firewall rules and restarted firewall");
|
||||
sleep(1);
|
||||
if (!isSingboxRunning()) {
|
||||
writeToLog("Sing-box has been stopped successfully");
|
||||
} else {
|
||||
writeToLog("Force killing Sing-box");
|
||||
shell_exec("kill -9 $pid");
|
||||
writeToLog("Sing-box has been force stopped");
|
||||
}
|
||||
} else {
|
||||
writeToLog("Sing-box is not running");
|
||||
}
|
||||
break;
|
||||
case 'disable':
|
||||
writeToLog("Stopping Sing-box");
|
||||
$pid = getSingboxPID();
|
||||
if ($pid) {
|
||||
writeToLog("Killing Sing-box PID: $pid");
|
||||
shell_exec("kill $pid");
|
||||
if (file_exists('/usr/sbin/fw4')) {
|
||||
shell_exec("nft flush ruleset");
|
||||
} else {
|
||||
shell_exec("iptables -t mangle -F");
|
||||
shell_exec("iptables -t mangle -X");
|
||||
}
|
||||
shell_exec("/etc/init.d/firewall restart");
|
||||
writeToLog("Cleared firewall rules and restarted firewall");
|
||||
sleep(1);
|
||||
if (!isSingboxRunning()) {
|
||||
writeToLog("Sing-box has been stopped successfully");
|
||||
} else {
|
||||
writeToLog("Force killing Sing-box");
|
||||
shell_exec("kill -9 $pid");
|
||||
writeToLog("Sing-box has been force stopped");
|
||||
}
|
||||
} else {
|
||||
writeToLog("Sing-box is not running");
|
||||
}
|
||||
break;
|
||||
|
||||
case 'restart':
|
||||
if (isNekoBoxRunning()) {
|
||||
|
@ -466,7 +465,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cronTime'])) {
|
|||
$cronTime = $_POST['cronTime'];
|
||||
|
||||
if (empty($cronTime)) {
|
||||
$logMessage = "请提供有效的 Cron 时间格式!";
|
||||
$logMessage = "Please provide a valid Cron time format!";
|
||||
file_put_contents('/etc/neko/tmp/log.txt', date('Y-m-d H:i:s') . " - ERROR: $logMessage\n", FILE_APPEND);
|
||||
echo $logMessage;
|
||||
exit;
|
||||
|
@ -500,40 +499,40 @@ check_singbox() {
|
|||
|
||||
if pgrep -x "singbox" > /dev/null
|
||||
then
|
||||
echo "$(timestamp) Sing-box 正在运行,正在重启..." >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box is already running, restarting..." >> \$LOG_PATH
|
||||
kill $(pgrep -x "singbox")
|
||||
sleep 2
|
||||
start_singbox
|
||||
|
||||
RETRY_COUNT=0
|
||||
while ! check_singbox && [ \$RETRY_COUNT -lt \$MAX_RETRIES ]; do
|
||||
echo "$(timestamp) Sing-box 重启失败,正在尝试重新启动... (\$((RETRY_COUNT + 1))/\$MAX_RETRIES)" >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box restart failed, retrying... (\$((RETRY_COUNT + 1))/\$MAX_RETRIES)" >> \$LOG_PATH
|
||||
sleep \$RETRY_INTERVAL
|
||||
start_singbox
|
||||
((RETRY_COUNT++))
|
||||
done
|
||||
|
||||
if check_singbox; then
|
||||
echo "$(timestamp) Sing-box 重启成功!" >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box restarted successfully!" >> \$LOG_PATH
|
||||
else
|
||||
echo "$(timestamp) Sing-box 重启失败,已达到最大重试次数!" >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box restart failed, max retries reached!" >> \$LOG_PATH
|
||||
fi
|
||||
else
|
||||
echo "$(timestamp) Sing-box 没有运行, 启动 Sing-box..." >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box is not running, starting Sing-box..." >> \$LOG_PATH
|
||||
start_singbox
|
||||
|
||||
RETRY_COUNT=0
|
||||
while ! check_singbox && [ \$RETRY_COUNT -lt \$MAX_RETRIES ]; do
|
||||
echo "$(timestamp) Sing-box 启动失败,正在尝试重新启动... (\$((RETRY_COUNT + 1))/\$MAX_RETRIES)" >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box start failed, retrying... (\$((RETRY_COUNT + 1))/\$MAX_RETRIES)" >> \$LOG_PATH
|
||||
sleep \$RETRY_INTERVAL
|
||||
start_singbox
|
||||
((RETRY_COUNT++))
|
||||
done
|
||||
|
||||
if check_singbox; then
|
||||
echo "$(timestamp) Sing-box 启动成功!" >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box started successfully!" >> \$LOG_PATH
|
||||
else
|
||||
echo "$(timestamp) Sing-box 启动失败,已达到最大重试次数!" >> \$LOG_PATH
|
||||
echo "$(timestamp) Sing-box start failed, max retries reached!" >> \$LOG_PATH
|
||||
fi
|
||||
fi
|
||||
EOL;
|
||||
|
@ -546,9 +545,9 @@ EOL;
|
|||
exec("crontab -l | grep -v '$scriptPath' | crontab -");
|
||||
exec("(crontab -l 2>/dev/null; echo \"$cronSchedule\") | crontab -");
|
||||
|
||||
$logMessage = "定时任务已设置成功,Sing-box 将在 $cronTime 自动重启。";
|
||||
$logMessage = "Cron job successfully set. Sing-box will restart automatically at $cronTime.";
|
||||
file_put_contents('/etc/neko/tmp/log.txt', date('[ H:i:s ] ') . "$logMessage\n", FILE_APPEND);
|
||||
echo json_encode(['success' => true, 'message' => '定时任务已设置成功']);
|
||||
echo json_encode(['success' => true, 'message' => 'Cron job successfully set.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -563,6 +562,7 @@ if (isset($_POST['clear_plugin_log'])) {
|
|||
writeToLog("Nekobox log cleared");
|
||||
}
|
||||
|
||||
|
||||
$neko_status = exec("uci -q get neko.cfg.enabled");
|
||||
$singbox_status = isSingboxRunning() ? '1' : '0';
|
||||
exec("uci set neko.cfg.singbox_enabled='$singbox_status'");
|
||||
|
@ -577,28 +577,28 @@ if ($singbox_status == '1') {
|
|||
$str_cfg = htmlspecialchars(basename($runningConfigFile));
|
||||
//writeToLog("Running config file: $str_cfg");
|
||||
} else {
|
||||
$str_cfg = 'Sing-box 配置文件:未找到运行中的配置文件';
|
||||
$str_cfg = 'Sing-box configuration file: No running configuration file found';
|
||||
writeToLog("No running config file found");
|
||||
}
|
||||
}
|
||||
|
||||
function readRecentLogLines($filePath, $lines = 1000) {
|
||||
if (!file_exists($filePath)) {
|
||||
return "日志文件不存在: $filePath";
|
||||
return "The log file does not exist: $filePath";
|
||||
}
|
||||
if (!is_readable($filePath)) {
|
||||
return "无法读取日志文件: $filePath";
|
||||
return "Unable to read the log file: $filePath";
|
||||
}
|
||||
$command = "tail -n $lines " . escapeshellarg($filePath);
|
||||
$output = shell_exec($command);
|
||||
return $output ?: "日志为空";
|
||||
return $output ?: "The log is empty";
|
||||
}
|
||||
|
||||
function readLogFile($filePath) {
|
||||
if (file_exists($filePath)) {
|
||||
return nl2br(htmlspecialchars(readRecentLogLines($filePath, 1000), ENT_NOQUOTES));
|
||||
} else {
|
||||
return '日志文件不存在。';
|
||||
return 'The log file does not exist';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -652,7 +652,7 @@ if (isset($_GET['ajax'])) {
|
|||
'systemInfo' => "$devices - $fullOSInfo",
|
||||
'ramUsage' => "$ramUsage/$ramTotal MB",
|
||||
'cpuLoad' => "$cpuLoadAvg1Min $cpuLoadAvg5Min $cpuLoadAvg15Min",
|
||||
'uptime' => "{$days}天 {$hours}小时 {$minutes}分钟 {$seconds}秒",
|
||||
'uptime' => "{$days} days {$hours} hours {$minutes} minutes {$seconds} seconds",
|
||||
'cpuLoadAvg1Min' => $cpuLoadAvg1Min,
|
||||
'ramTotal' => $ramTotal,
|
||||
'ramUsageOnly' => $ramUsage,
|
||||
|
@ -671,12 +671,12 @@ if (!file_exists($current_config)) {
|
|||
$default_config_content = "external-controller: 0.0.0.0:9090\n";
|
||||
$default_config_content .= "secret: Akun\n";
|
||||
$default_config_content .= "external-ui: ui\n";
|
||||
$default_config_content .= "# 请根据需要编辑此文件\n";
|
||||
$default_config_content .= "# Please edit this file as needed\n";
|
||||
|
||||
file_put_contents($current_config, $default_config_content);
|
||||
file_put_contents('/www/nekobox/lib/selected_config.txt', $current_config);
|
||||
|
||||
$logMessage = "配置文件丢失,已创建默认配置文件。";
|
||||
$logMessage = "The configuration file is missing; a default configuration file has been created.";
|
||||
} else {
|
||||
$config_content = file_get_contents($current_config);
|
||||
|
||||
|
@ -696,7 +696,7 @@ if (!file_exists($current_config)) {
|
|||
|
||||
if ($missing_config) {
|
||||
file_put_contents($current_config, $config_content);
|
||||
$logMessage = "配置文件缺少某些选项,已自动添加缺失的配置项。";
|
||||
$logMessage = "The configuration file is missing some options; the missing configuration items have been added automatically";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -712,7 +712,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['selected_config'])) {
|
|||
if (file_exists($selected_file_path) && pathinfo($selected_file, PATHINFO_EXTENSION) == 'yaml') {
|
||||
file_put_contents('/www/nekobox/lib/selected_config.txt', $selected_file_path);
|
||||
} else {
|
||||
echo "<script>alert('无效的配置文件');</script>";
|
||||
echo "<script>alert('Invalid configuration file');</script>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -738,7 +738,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['selected_config'])) {
|
|||
<body>
|
||||
<?php if ($isNginx): ?>
|
||||
<div id="nginxWarning" class="alert alert-warning alert-dismissible fade show" role="alert" style="position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1050;">
|
||||
<strong>警告!</strong> 检测到您正在使用Nginx。本插件不支持Nginx,请使用Uhttpd构建固件。
|
||||
<strong data-translate="nginxWarningStrong"></strong>
|
||||
<span data-translate="nginxWarning"></span>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -755,10 +756,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['selected_config'])) {
|
|||
<?php endif; ?>
|
||||
<div class="container-sm container-bg callout border border-3 rounded-4 col-11">
|
||||
<div class="row">
|
||||
<a href="./index.php" class="col btn btn-lg"><i class="bi bi-house-door"></i> 首页</a>
|
||||
<a href="./dashboard.php" class="col btn btn-lg"><i class="bi bi-bar-chart"></i> 面板</a>
|
||||
<a href="./singbox.php" class="col btn btn-lg"><i class="bi bi-box"></i> 订阅</a>
|
||||
<a href="./settings.php" class="col btn btn-lg"><i class="bi bi-gear"></i> 设定</a>
|
||||
<a href="./index.php" class="col btn btn-lg text-nowrap"><i class="bi bi-house-door"></i> <span data-translate="home">Home</span></a>
|
||||
<a href="./dashboard.php" class="col btn btn-lg text-nowrap"><i class="bi bi-bar-chart"></i> <span data-translate="panel">Panel</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg text-nowrap"><i class="bi bi-box"></i> <span data-translate="document">Document</span></a>
|
||||
<a href="./settings.php" class="col btn btn-lg text-nowrap"><i class="bi bi-gear"></i> <span data-translate="settings">Settings</span></a>
|
||||
<div class="container-sm text-center col-8">
|
||||
<img src="./assets/img/nekobox.png">
|
||||
<div id="version-info">
|
||||
|
@ -915,32 +916,32 @@ $(document).ready(function() {
|
|||
<table class="table table-borderless mb-2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:150px; line-height: 2;"><i data-feather="activity"></i> 运行状态</td>
|
||||
<td style="width:150px" data-translate="status">Status</td>
|
||||
<td class="d-grid">
|
||||
<div class="btn-group w-100" role="group" aria-label="ctrl">
|
||||
<?php
|
||||
if ($neko_status == 1) {
|
||||
echo "<button type=\"button\" class=\"btn btn-success\">Mihomo 运行中</button>\n";
|
||||
echo "<button type=\"button\" class=\"btn btn-success\" data-translate=\"mihomoRunning\">Mihomo Running</button>\n";
|
||||
} else {
|
||||
echo "<button type=\"button\" class=\"btn btn-outline-danger\">Mihomo 未运行</button>\n";
|
||||
echo "<button type=\"button\" class=\"btn btn-outline-danger\" data-translate=\"mihomoNotRunning\">Mihomo Not Running</button>\n";
|
||||
}
|
||||
echo "<button type=\"button\" class=\"btn btn-deepskyblue\">$str_cfg</button>\n";
|
||||
if ($singbox_status == 1) {
|
||||
echo "<button type=\"button\" class=\"btn btn-success\">Sing-box 运行中</button>\n";
|
||||
echo "<button type=\"button\" class=\"btn btn-success\" data-translate=\"singboxRunning\">Sing-box Running</button>\n";
|
||||
} else {
|
||||
echo "<button type=\"button\" class=\"btn btn-outline-danger\">Sing-box 未运行</button>\n";
|
||||
echo "<button type=\"button\" class=\"btn btn-outline-danger\" data-translate=\"singboxNotRunning\">Sing-box Not Running</button>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px; line-height: 2;"><i class="fas fa-box custom-icon"></i> Mihomo</td>
|
||||
<tr>
|
||||
<td style="width:150px" data-translate="mihomoControl">Mihomo Control</td>
|
||||
<td class="d-grid">
|
||||
<form action="index.php" method="post" style="display: inline-block; width: 100%; margin-bottom: 10px;">
|
||||
<div class="form-group">
|
||||
<select id="configSelect" class="form-select" name="selected_config" onchange="saveConfigToLocalStorage(); this.form.submit()">
|
||||
<option value="">请选择配置文件</option>
|
||||
<option value="" data-translate="selectConfig">Please select a configuration file</option>
|
||||
<?php
|
||||
$config_dir = '/etc/neko/config';
|
||||
$files = array_diff(scandir($config_dir), array('..', '.'));
|
||||
|
@ -956,19 +957,20 @@ $(document).ready(function() {
|
|||
</form>
|
||||
<form action="index.php" method="post" style="display: inline-block; width: 100%;">
|
||||
<div class="btn-group w-100">
|
||||
<button type="submit" name="neko" value="start" class="btn btn<?php if ($neko_status == 1) echo "-outline" ?>-success <?php if ($neko_status == 1) echo "disabled" ?>">启用 Mihomo</button>
|
||||
<button type="submit" name="neko" value="disable" class="btn btn<?php if ($neko_status == 0) echo "-outline" ?>-danger <?php if ($neko_status == 0) echo "disabled" ?>">停用 Mihomo</button>
|
||||
<button type="submit" name="neko" value="restart" class="btn btn<?php if ($neko_status == 0) echo "-outline" ?>-warning <?php if ($neko_status == 0) echo "disabled" ?>">重启 Mihomo</button>
|
||||
<button type="submit" name="neko" value="start" class="btn btn<?php if ($neko_status == 1) echo "-outline" ?>-success <?php if ($neko_status == 1) echo "disabled" ?>" data-translate="enableMihomo">Enable Mihomo</button>
|
||||
<button type="submit" name="neko" value="disable" class="btn btn<?php if ($neko_status == 0) echo "-outline" ?>-danger <?php if ($neko_status == 0) echo "disabled" ?>" data-translate="disableMihomo">Disable Mihomo</button>
|
||||
<button type="submit" name="neko" value="restart" class="btn btn<?php if ($neko_status == 0) echo "-outline" ?>-warning <?php if ($neko_status == 0) echo "disabled" ?>" data-translate="restartMihomo">Restart Mihomo</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px; line-height: 2;"><i data-feather="codesandbox"></i> Singbox</td>
|
||||
<td style="width:150px" data-translate="singboxControl">Singbox Control</td>
|
||||
<td class="d-grid">
|
||||
<form action="index.php" method="post">
|
||||
<div class="input-group mb-2">
|
||||
<select name="config_file" id="config_file" class="form-select" onchange="saveConfigSelection()">
|
||||
<option value="" data-translate="selectConfig">Please select a configuration file</option>
|
||||
<?php foreach ($availableConfigs as $config): ?>
|
||||
<option value="<?= htmlspecialchars($config) ?>" <?= isset($_POST['config_file']) && $_POST['config_file'] === $config ? 'selected' : '' ?>>
|
||||
<?= htmlspecialchars(basename($config)) ?>
|
||||
|
@ -977,24 +979,24 @@ $(document).ready(function() {
|
|||
</select>
|
||||
</div>
|
||||
<div class="btn-group w-100">
|
||||
<button type="submit" name="singbox" value="start" class="btn btn<?php echo ($singbox_status == 1) ? "-outline" : "" ?>-success <?php echo ($singbox_status == 1) ? "disabled" : "" ?>">启用 Sing-box</button>
|
||||
<button type="submit" name="singbox" value="disable" class="btn btn<?php echo ($singbox_status == 0) ? "-outline" : "" ?>-danger <?php echo ($singbox_status == 0) ? "disabled" : "" ?>">停用 Sing-box</button>
|
||||
<button type="submit" name="singbox" value="restart" class="btn btn<?php echo ($singbox_status == 0) ? "-outline" : "" ?>-warning <?php echo ($singbox_status == 0) ? "disabled" : "" ?>">重启 Sing-box</button>
|
||||
<button type="submit" name="singbox" value="start" class="btn btn<?php echo ($singbox_status == 1) ? "-outline" : "" ?>-success <?php echo ($singbox_status == 1) ? "disabled" : "" ?>" data-translate="enableSingbox">Enable Sing-box</button>
|
||||
<button type="submit" name="singbox" value="disable" class="btn btn<?php echo ($singbox_status == 0) ? "-outline" : "" ?>-danger <?php echo ($singbox_status == 0) ? "disabled" : "" ?>" data-translate="disableSingbox">Disable Sing-box</button>
|
||||
<button type="submit" name="singbox" value="restart" class="btn btn<?php echo ($singbox_status == 0) ? "-outline" : "" ?>-warning <?php echo ($singbox_status == 0) ? "disabled" : "" ?>" data-translate="restartSingbox">Restart Sing-box</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px; line-height: 2;"><i class="fas fa-cog custom-icon"></i> 运行模式</td>
|
||||
<td style="width:150px" data-translate="runningMode">Running Mode</td>
|
||||
<td class="d-grid">
|
||||
<?php
|
||||
$mode_placeholder = '';
|
||||
if ($neko_status == 1) {
|
||||
$mode_placeholder = $neko_cfg['echanced'] . " | " . $neko_cfg['mode'];
|
||||
} elseif ($singbox_status == 1) {
|
||||
$mode_placeholder = "Rule 模式";
|
||||
$mode_placeholder = "Rule Mode";
|
||||
} else {
|
||||
$mode_placeholder = "未运行";
|
||||
$mode_placeholder = "Not Running";
|
||||
}
|
||||
?>
|
||||
<input class="form-control text-center" name="mode" type="text" placeholder="<?php echo $mode_placeholder; ?>" disabled>
|
||||
|
@ -1044,30 +1046,30 @@ window.onload = function() {
|
|||
</script>
|
||||
<div id="collapsibleHeader" style="cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<i id="toggleIcon" class="triangle-icon"></i>
|
||||
<h2 id="systemTitle" class="text-center" style="display: none; margin-top: 0;">系统状态</h2>
|
||||
<h2 id="systemTitle" class="text-center" style="display: none; margin-top: 0;" data-translate="systemInfo">System Status</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapsible" style="display: none; margin-top: 5px;">
|
||||
<table class="table table-borderless rounded-4 mb-2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:150px"><i data-feather="cpu"></i> 系统信息</td>
|
||||
<td style="width:150px"><span data-translate="systemInfo">System Info</span></td>
|
||||
<td id="systemInfo"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px"><i data-feather="database"></i> 系统内存</td>
|
||||
<td style="width:150px"><span data-translate="systemMemory">System Memory</span></td>
|
||||
<td id="ramUsage"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px"><i data-feather="zap"></i> 平均负载</td>
|
||||
<td style="width:150px"><span data-translate="avgLoad">Average Load</span></td>
|
||||
<td id="cpuLoad"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px"><i data-feather="clock"></i> 运行时间</td>
|
||||
<td style="width:150px"><span data-translate="uptime">Uptime</span></td>
|
||||
<td id="uptime"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:150px"><i data-feather="bar-chart-2"></i> 流量统计</td>
|
||||
<td style="width:150px"><span data-translate="trafficStats">Traffic Stats</span></td>
|
||||
<td>⬇️ <span id="downtotal"></span> | ⬆️ <span id="uptotal"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -1162,16 +1164,16 @@ window.onload = function() {
|
|||
}
|
||||
|
||||
</style>
|
||||
<h2 class="text-center">日志</h2>
|
||||
<h2 class="text-center"><?= $langData[$currentLang]['log'] ?></h2>
|
||||
<ul class="nav nav-pills mb-3" id="logTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="pluginLogTab" data-bs-toggle="pill" href="#pluginLog" role="tab" aria-controls="pluginLog" aria-selected="true">NeKoBox 日志</a>
|
||||
<a class="nav-link" id="pluginLogTab" data-bs-toggle="pill" href="#pluginLog" role="tab" aria-controls="pluginLog" aria-selected="true"><?= $langData[$currentLang]['nekoBoxLog'] ?></a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="mihomoLogTab" data-bs-toggle="pill" href="#mihomoLog" role="tab" aria-controls="mihomoLog" aria-selected="false">Mihomo 日志</a>
|
||||
<a class="nav-link" id="mihomoLogTab" data-bs-toggle="pill" href="#mihomoLog" role="tab" aria-controls="mihomoLog" aria-selected="false"><?= $langData[$currentLang]['mihomoLog'] ?></a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="singboxLogTab" data-bs-toggle="pill" href="#singboxLog" role="tab" aria-controls="singboxLog" aria-selected="false">Sing-box 日志</a>
|
||||
<a class="nav-link" id="singboxLogTab" data-bs-toggle="pill" href="#singboxLog" role="tab" aria-controls="singboxLog" aria-selected="false"><?= $langData[$currentLang]['singboxLog'] ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="logTabsContent">
|
||||
|
@ -1182,7 +1184,7 @@ window.onload = function() {
|
|||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<form action="index.php" method="post">
|
||||
<button type="submit" name="clear_plugin_log" class="btn btn-danger"><i class="bi bi-trash"></i> 清空日志</button>
|
||||
<button type="submit" name="clear_plugin_log" class="btn btn-danger"><i class="bi bi-trash"></i> <?= $langData[$currentLang]['clearLog'] ?></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1195,7 +1197,7 @@ window.onload = function() {
|
|||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<form action="index.php" method="post">
|
||||
<button type="submit" name="neko" value="clear" class="btn btn-danger"><i class="bi bi-trash"></i> 清空日志</button>
|
||||
<button type="submit" name="neko" value="clear" class="btn btn-danger"><i class="bi bi-trash"></i> <?= $langData[$currentLang]['clearLog'] ?></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1210,10 +1212,10 @@ window.onload = function() {
|
|||
<form action="index.php" method="post" class="form-inline">
|
||||
<div class="form-check form-check-inline mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="autoRefresh" checked>
|
||||
<label class="form-check-label" for="autoRefresh">自动刷新</label>
|
||||
<label class="form-check-label" for="autoRefresh"><?= $langData[$currentLang]['autoRefresh'] ?></label>
|
||||
</div>
|
||||
<button type="submit" name="clear_singbox_log" class="btn btn-danger me-2"><i class="bi bi-trash"></i> 清空日志</button>
|
||||
<button type="button" class="btn btn-primary me-2" data-toggle="modal" data-target="#cronModal"><i class="bi bi-clock"></i> 定时重启</button>
|
||||
<button type="submit" name="clear_singbox_log" class="btn btn-danger me-2"><i class="bi bi-trash"></i> <?= $langData[$currentLang]['clearLog'] ?></button>
|
||||
<button type="button" class="btn btn-primary me-2" data-toggle="modal" data-target="#cronModal"><i class="bi bi-clock"></i> <?= $langData[$currentLang]['scheduledRestart'] ?></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1224,36 +1226,37 @@ window.onload = function() {
|
|||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cronModalLabel">设置 Cron 任务时间</h5>
|
||||
<h5 class="modal-title" id="cronModalLabel"><?= $langData[$currentLang]['setCronTitle'] ?></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="cronForm" method="POST">
|
||||
<div class="form-group ">
|
||||
<label for="cronTime">设置 Sing-box 重启时间</label>
|
||||
<div class="form-group">
|
||||
<label for="cronTime"><?= $langData[$currentLang]['setRestartTime'] ?></label>
|
||||
<input type="text" class="form-control mt-3" id="cronTime" name="cronTime" value="0 3 * * *" required>
|
||||
</div>
|
||||
<div class="alert alert-info mt-3">
|
||||
<strong>提示:</strong> Cron 表达式格式:
|
||||
<strong><?= $langData[$currentLang]['tip'] ?>:</strong> <?= $langData[$currentLang]['cronFormat'] ?>:
|
||||
<ul>
|
||||
<li><code>分钟 小时 日 月 星期</code></li>
|
||||
<li>示例: 每天凌晨 2 点: <code>0 2 * * *</code></li>
|
||||
<li>每周一凌晨 3 点: <code>0 3 * * 1</code></li>
|
||||
<li>工作日(周一至周五)的上午 9 点: <code>0 9 * * 1-5</code></li>
|
||||
<li><?= $langData[$currentLang]['example1'] ?>: <code>0 2 * * *</code></li>
|
||||
<li><?= $langData[$currentLang]['example2'] ?>: <code>0 3 * * 1</code></li>
|
||||
<li><?= $langData[$currentLang]['example3'] ?>: <code>0 9 * * 1-5</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
<div id="resultMessage" class="mt-3"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary" form="cronForm">保存</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $langData[$currentLang]['cancel'] ?></button>
|
||||
<button type="submit" class="btn btn-primary" form="cronForm"><?= $langData[$currentLang]['save'] ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#cronForm').submit(function(event) {
|
||||
event.preventDefault();
|
||||
|
@ -1277,6 +1280,7 @@ window.onload = function() {
|
|||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function scrollToBottom(elementId) {
|
||||
var logElement = document.getElementById(elementId);
|
||||
|
|
|
@ -651,41 +651,40 @@ function getSubscriptionUrlFromFile($file) {
|
|||
</style>
|
||||
<div class="container-sm container-bg callout border border-3 rounded-4 col-11">
|
||||
<div class="row">
|
||||
<a href="./index.php" class="col btn btn-lg"><i class="bi bi-house-door d-none d-sm-inline"></i> 首页</a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg"><i class="bi bi-folder d-none d-sm-inline"></i> <span style="white-space: nowrap;">文件管理</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg"><i class="bi bi-shop d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 一</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg"><i class="bi bi-bank d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 二</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg"><i class="bi bi-building d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 三</span></a>
|
||||
<h1 class="text-center p-2" style="margin-top: 2rem; margin-bottom: 1rem;">Mihomo 转换模板</h1>
|
||||
<a href="./index.php" class="col btn btn-lg text-nowrap"><i class="bi bi-house-door"></i> <span data-translate="home">Home</span></a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg text-nowrap"><i class="bi bi-folder"></i> <span data-translate="manager">Manager</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg text-nowrap"><i class="bi bi-shop"></i> <span data-translate="template_i">Template I</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg text-nowrap"><i class="bi bi-bank"></i> <span data-translate="template_ii">Template II</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg text-nowrap"><i class="bi bi-building"></i> <span data-translate="template_iii">Template III</span></a>
|
||||
<h1 class="text-center p-2" style="margin-top: 2rem; margin-bottom: 1rem;"><?php echo $translations['mihomo_conversion_template']; ?></h1>
|
||||
|
||||
<div class="col-12 custom-padding">
|
||||
<div class="form-section">
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="subscription_url" class="form-label">输入订阅链接</label>
|
||||
<label for="subscription_url" class="form-label" data-translate="subscription_url_label"></label>
|
||||
<input type="text" class="form-control" id="subscription_url" name="subscription_url"
|
||||
value="<?php echo htmlspecialchars($current_subscription_url); ?>" placeholder="支持各种订阅链接或单节点链接,多个链接用 | 分隔" required>
|
||||
value="<?php echo htmlspecialchars($current_subscription_url); ?>" placeholder="" data-translate-placeholder="subscription_url_placeholder" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="filename" class="form-label">自定义文件名 (默认: config.yaml)</label>
|
||||
<label for="filename" class="form-label" data-translate="filename_label"></label>
|
||||
<input type="text" class="form-control" id="filename" name="filename"
|
||||
value="<?php echo htmlspecialchars(isset($_POST['filename']) ? $_POST['filename'] : ''); ?>"
|
||||
placeholder="config.yaml">
|
||||
placeholder="config.json">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="backend_url" class="form-label">选择后端地址</label>
|
||||
<label for="backend_url" class="form-label" data-translate="backend_url_label"></label>
|
||||
<select class="form-select" id="backend_url" name="backend_url" required>
|
||||
<option value="https://url.v1.mk/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://url.v1.mk/sub?' ? 'selected' : ''; ?>>
|
||||
肥羊增强型后端【vless reality+hy1+hy2】
|
||||
<?php echo $langData[$currentLang]['backend_url_option_1']; ?>
|
||||
</option>
|
||||
<option value="https://sub.d1.mk/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.d1.mk/sub?' ? 'selected' : ''; ?>>
|
||||
肥羊备用后端【vless reality+hy1+hy2】
|
||||
<?php echo $langData[$currentLang]['backend_url_option_2']; ?>
|
||||
</option>
|
||||
<option value="https://sub.xeton.dev/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.xeton.dev/sub?' ? 'selected' : ''; ?>>
|
||||
subconverter作者提供
|
||||
</option>
|
||||
<?php echo $langData[$currentLang]['backend_url_option_3']; ?>
|
||||
</option>
|
||||
<option value="https://www.tline.website/sub/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://www.tline.website/sub/sub?' ? 'selected' : ''; ?>>
|
||||
tline.website
|
||||
|
@ -694,7 +693,7 @@ function getSubscriptionUrlFromFile($file) {
|
|||
api.dler.io
|
||||
</option>
|
||||
<option value="https://v.id9.cc/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://v.id9.cc/sub?' ? 'selected' : ''; ?>>
|
||||
v.id9.cc(品云提供)
|
||||
<?php echo $langData[$currentLang]['backend_url_option_6']; ?>
|
||||
</option>
|
||||
<option value="https://sub.id9.cc/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.id9.cc/sub?' ? 'selected' : ''; ?>>
|
||||
sub.id9.cc
|
||||
|
@ -706,19 +705,19 @@ function getSubscriptionUrlFromFile($file) {
|
|||
subcloud.xyz
|
||||
</option>
|
||||
<option value="https://sub.maoxiongnet.com/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.maoxiongnet.com/sub?' ? 'selected' : ''; ?>>
|
||||
sub.maoxiongnet.com(猫熊提供)
|
||||
<?php echo $langData[$currentLang]['backend_url_option_10']; ?>
|
||||
</option>
|
||||
<option value="http://localhost:25500/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'http://localhost:25500/sub?' ? 'selected' : ''; ?>>
|
||||
localhost:25500 本地版
|
||||
<?php echo $langData[$currentLang]['backend_url_option_11']; ?>
|
||||
</option>
|
||||
<option value="custom" <?php echo ($_POST['backend_url'] ?? '') === 'custom' ? 'selected' : ''; ?>>
|
||||
自定义后端地址
|
||||
<?php echo $langData[$currentLang]['backend_url_option_custom']; ?>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3" id="custom_backend_url_input" style="display: none;">
|
||||
<label for="custom_backend_url" class="form-label">请输入自定义后端地址</label>
|
||||
<label for="custom_backend_url" class="form-label" data-translate="custom_backend_url_label"></label>
|
||||
<input type="text" class="form-control" id="custom_backend_url" name="custom_backend_url" value="<?php echo htmlspecialchars($_POST['custom_backend_url'] ?? '') . (empty($_POST['custom_backend_url']) ? '' : '?'); ?>" />
|
||||
</div>
|
||||
|
||||
|
@ -827,65 +826,65 @@ function getSubscriptionUrlFromFile($file) {
|
|||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">选择额外配置选项</label>
|
||||
<label class="form-label" data-translate="choose_additional_options"></label>
|
||||
<div class="d-flex flex-wrap align-items-center">
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="emoji" name="emoji" value="true"
|
||||
<?php echo isset($_POST['emoji']) && $_POST['emoji'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="emoji">启用 Emoji</label>
|
||||
<label class="form-check-label" for="emoji" data-translate="enable_emoji"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="udp" name="udp" value="true"
|
||||
<?php echo isset($_POST['udp']) && $_POST['udp'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="udp">启用 UDP</label>
|
||||
<label class="form-check-label" for="udp" data-translate="enable_udp"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="xudp" name="xudp" value="true"
|
||||
<?php echo isset($_POST['xudp']) && $_POST['xudp'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="xudp">启用 XUDP</label>
|
||||
<label class="form-check-label" for="xudp" data-translate="enable_xudp"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="fdn" name="fdn" value="true"
|
||||
<?php echo isset($_POST['fdn']) && $_POST['fdn'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="tls13">启用 FDN</label>
|
||||
<label class="form-check-label" for="tls13" data-translate="enable_fdn"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="sort" name="sort" value="true"
|
||||
<?php echo isset($_POST['sort']) && $_POST['sort'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="sort">启用 SORT</label>
|
||||
<label class="form-check-label" for="sort" data-translate="enable_sort"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="tls13" name="tls13" value="true"
|
||||
<?php echo isset($_POST['tls13']) && $_POST['tls13'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="tls13">启用 TLS_1.3</label>
|
||||
<label class="form-check-label" for="tls13" data-translate="enable_tls13"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="tfo" name="tfo" value="true"
|
||||
<?php echo isset($_POST['tfo']) && $_POST['tfo'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="tfo">启用 TFO</label>
|
||||
<label class="form-check-label" for="tfo" data-translate="enable_tfo"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="include" class="form-label">包含节点 (可选)</label>
|
||||
<label for="include" class="form-label" data-translate="include_nodes"></label>
|
||||
<input type="text" class="form-control" id="include" name="include"
|
||||
value="<?php echo htmlspecialchars($_POST['include'] ?? ''); ?>" placeholder="要保留的节点,支持正则 | 分隔">
|
||||
value="<?php echo htmlspecialchars($_POST['include'] ?? ''); ?>" placeholder="要保留的节点,支持正则 | 分隔" data-translate-placeholder="include_placeholder">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="exclude" class="form-label">排除节点 (可选)</label>
|
||||
<label for="exclude" class="form-label" data-translate="exclude_nodes"></label>
|
||||
<input type="text" class="form-control" id="exclude" name="exclude"
|
||||
value="<?php echo htmlspecialchars($_POST['exclude'] ?? ''); ?>" placeholder="要排除的节点,支持正则 | 分隔">
|
||||
value="<?php echo htmlspecialchars($_POST['exclude'] ?? ''); ?>" placeholder="要排除的节点,支持正则 | 分隔" data-translate-placeholder="exclude_placeholder">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="rename" class="form-label">节点命名</label>
|
||||
<label for="rename" class="form-label" data-translate="rename_nodes"></label>
|
||||
<input type="text" class="form-control" id="rename" name="rename"
|
||||
value="<?php echo htmlspecialchars(isset($_POST['rename']) ? $_POST['rename'] : ''); ?>"
|
||||
placeholder="输入重命名内容(举例:`a@b``1@2`,|符可用\转义)">
|
||||
placeholder="输入重命名内容(举例:`a@b``1@2`,|符可用\转义)" data-translate-placeholder="rename_placeholder">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" name="action" value="generate_subscription"><i class="bi bi-file-earmark-text"></i> 生成配置文件</button>
|
||||
<button type="submit" class="btn btn-primary" name="action" value="generate_subscription"><i class="bi bi-file-earmark-text"></i> <span data-translate="generate_configuration_file"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -893,20 +892,20 @@ function getSubscriptionUrlFromFile($file) {
|
|||
<div class="form-section mt-4 custom-padding">
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="cron_time" class="form-label">设置 Cron 时间 (例如: 0 3 * * *)</label>
|
||||
<label for="cron_time" class="form-label" data-translate="set_cron_time">设置 Cron 时间 (例如: 0 3 * * *)</label>
|
||||
<input type="text" class="form-control" id="cron_time" name="cron_time"
|
||||
value="<?php echo htmlspecialchars(isset($_POST['cron_time']) ? $_POST['cron_time'] : '0 3 * * *'); ?>"
|
||||
placeholder="0 3 * * *">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" name="action" value="update_cron"><i class="bi bi-clock"></i> 设置定时任务</button>
|
||||
<button type="submit" class="btn btn-primary" name="action" value="update_cron"><i class="bi bi-clock"></i> <span data-translate="set_scheduled_task"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="help mt-4 custom-padding">
|
||||
<p style="color: red;">注意:在线订阅转换存在隐私泄露风险</p>
|
||||
<p>订阅转换由肥羊提供</p>
|
||||
<p style="color: red;"><?php echo $translations['warning1']; ?></p>
|
||||
<p><?php echo $translations['subscription_conversion']; ?></p>
|
||||
<a href="https://github.com/youshandefeiyang/sub-web-modify" target="_blank" class="btn btn-primary" style="color: white;">
|
||||
<i data-feather="github"></i> 点击访问
|
||||
<i data-feather="github"></i> <?php echo $translations['visit_link']; ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -667,24 +667,24 @@ function displayUpdateNotification() {
|
|||
</script>
|
||||
<div class="container-sm container-bg callout border border-3 rounded-4 col-11">
|
||||
<div class="row">
|
||||
<a href="./index.php" class="col btn btn-lg"><i class="bi bi-house-door d-none d-sm-inline"></i> 首页</a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg"><i class="bi bi-folder d-none d-sm-inline"></i> <span style="white-space: nowrap;">文件管理</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg"><i class="bi bi-shop d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 一</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg"><i class="bi bi-bank d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 二</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg"><i class="bi bi-building d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 三</span></a>
|
||||
<a href="./index.php" class="col btn btn-lg text-nowrap"><i class="bi bi-house-door"></i> <span data-translate="home">Home</span></a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg text-nowrap"><i class="bi bi-folder"></i> <span data-translate="manager">Manager</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg text-nowrap"><i class="bi bi-shop"></i> <span data-translate="template_i">Template I</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg text-nowrap"><i class="bi bi-bank"></i> <span data-translate="template_ii">Template II</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg text-nowrap"><i class="bi bi-building"></i> <span data-translate="template_iii">Template III</span></a>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<h2 style="margin-top: 40px; margin-bottom: 20px;">文件管理</h2>
|
||||
<h2 style="margin-top: 40px; margin-bottom: 20px;" data-translate="fileManagement"></h2>
|
||||
<div class="container-fluid">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th style="width: 20%;">文件名</th>
|
||||
<th style="width: 10%;">大小</th>
|
||||
<th style="width: 20%;">最后修改时间</th>
|
||||
<th style="width: 10%;">文件类型</th>
|
||||
<th style="width: 30%;">执行操作</th>
|
||||
<th style="width: 20%;" data-translate="fileName"></th>
|
||||
<th style="width: 10%;" data-translate="fileSize"></th>
|
||||
<th style="width: 20%;" data-translate="lastModified"></th>
|
||||
<th style="width: 10%;" data-translate="fileType"></th>
|
||||
<th style="width: 30%;" data-translate="actions"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -695,8 +695,8 @@ function displayUpdateNotification() {
|
|||
}, $proxyFiles), array_map(function($file) use ($configDir) {
|
||||
return $configDir . $file;
|
||||
}, $configFiles));
|
||||
$fileTypes = array_merge(array_fill(0, count($proxyFiles), '代理文件'), array_fill(0, count($configFiles), '配置文件'));
|
||||
|
||||
$fileTypes = array_merge(array_fill(0, count($proxyFiles), 'Proxy File'), array_fill(0, count($configFiles), 'Config File'));
|
||||
|
||||
foreach ($allFiles as $index => $file) {
|
||||
$filePath = $allFilePaths[$index];
|
||||
$fileType = $fileTypes[$index];
|
||||
|
@ -716,51 +716,51 @@ function displayUpdateNotification() {
|
|||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="action-buttons">
|
||||
<?php if ($fileType == '代理文件'): ?>
|
||||
<?php if ($fileType == 'Proxy File'): ?>
|
||||
<form action="" method="post" class="d-inline mb-1">
|
||||
<input type="hidden" name="deleteFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="🗑️ 删除" onclick="return confirm('确定要删除这个文件吗?');"><i class="bi bi-trash"></i></button>
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="🗑️ 删除" onclick="return confirm('确定要删除这个文件吗?');" data-translate-title="delete"><i class="bi bi-trash"></i></button>
|
||||
</form>
|
||||
<form action="" method="post" class="d-inline mb-1">
|
||||
<input type="hidden" name="oldFileName" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="proxy">
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" title="✏️ 重命名" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>" data-filetype="proxy"><i class="bi bi-pencil"></i></button>
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" title="✏️ 重命名" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>" data-filetype="proxy" data-translate-title="rename"><i class="bi bi-pencil"></i></button>
|
||||
</form>
|
||||
<form action="" method="post" class="d-inline mb-1">
|
||||
<button type="button" class="btn btn-warning btn-sm" title="📝 编辑" onclick="openEditModal('<?php echo htmlspecialchars($file); ?>', 'proxy')"><i class="bi bi-pen"></i></button>
|
||||
<button type="button" class="btn btn-warning btn-sm" title="📝 编辑" onclick="openEditModal('<?php echo htmlspecialchars($file); ?>', 'proxy')" data-translate-title="edit"><i class="bi bi-pen"></i></button>
|
||||
</form>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="d-inline upload-btn mb-1">
|
||||
<input type="file" name="fileInput" class="form-control-file" required id="fileInput-<?php echo htmlspecialchars($file); ?>" style="display: none;" onchange="this.form.submit()">
|
||||
<button type="button" class="btn btn-info btn-sm" title="📤 上传" onclick="openUploadModal('proxy')"><i class="bi bi-upload"></i></button>
|
||||
<button type="button" class="btn btn-info btn-sm" title="📤 上传" onclick="openUploadModal('proxy')" data-translate-title="upload"><i class="bi bi-upload"></i></button>
|
||||
</form>
|
||||
<form action="" method="get" class="d-inline mb-1">
|
||||
<input type="hidden" name="downloadFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="proxy">
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="📥 下载" ><i class="bi bi-download"></i></button>
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="📥 下载" data-translate-title="download"><i class="bi bi-download"></i></button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form action="" method="post" class="d-inline mb-1">
|
||||
<input type="hidden" name="deleteConfigFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="🗑️ 删除" onclick="return confirm('确定要删除这个文件吗?');"><i class="bi bi-trash"></i></button>
|
||||
<button type="submit" class="btn btn-danger btn-sm" title="🗑️ 删除" onclick="return confirm('确定要删除这个文件吗?');" data-translate-title="delete"><i class="bi bi-trash"></i></button>
|
||||
</form>
|
||||
<form action="" method="post" class="d-inline mb-1">
|
||||
<input type="hidden" name="oldFileName" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" title="✏️ 重命名" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>" data-filetype="config"><i class="bi bi-pencil"></i></button>
|
||||
<button type="button" class="btn btn-success btn-sm btn-rename" title="✏️ 重命名" data-toggle="modal" data-target="#renameModal" data-filename="<?php echo htmlspecialchars($file); ?>" data-filetype="config" data-translate-title="rename"><i class="bi bi-pencil"></i></button>
|
||||
</form>
|
||||
<form action="" method="post" class="d-inline mb-1">
|
||||
<button type="button" class="btn btn-warning btn-sm" title="📝 编辑" onclick="openEditModal('<?php echo htmlspecialchars($file); ?>', 'config')"><i class="bi bi-pen"></i></button>
|
||||
<button type="button" class="btn btn-warning btn-sm" title="📝 编辑" onclick="openEditModal('<?php echo htmlspecialchars($file); ?>', 'config')" data-translate-title="edit"><i class="bi bi-pen"></i></button>
|
||||
</form>
|
||||
<form action="" method="post" enctype="multipart/form-data" class="d-inline upload-btn mb-1">
|
||||
<input type="file" name="configFileInput" class="form-control-file" required id="fileInput-<?php echo htmlspecialchars($file); ?>" style="display: none;" onchange="this.form.submit()">
|
||||
<button type="button" class="btn btn-info btn-sm" title="📤 上传" onclick="openUploadModal('config')"><i class="bi bi-upload"></i></button>
|
||||
<button type="button" class="btn btn-info btn-sm" title="📤 上传" onclick="openUploadModal('config')" data-translate-title="upload"><i class="bi bi-upload"></i></button>
|
||||
</form>
|
||||
<form action="" method="get" class="d-inline mb-1">
|
||||
<input type="hidden" name="downloadFile" value="<?php echo htmlspecialchars($file); ?>">
|
||||
<input type="hidden" name="fileType" value="config">
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="📥 下载" ><i class="bi bi-download"></i></button>
|
||||
<button type="submit" class="btn btn-primary btn-sm" title="📥 下载" data-translate-title="download"><i class="bi bi-download"></i></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -774,21 +774,21 @@ function displayUpdateNotification() {
|
|||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="uploadModalLabel">上传文件</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="关闭">
|
||||
<h5 class="modal-title" id="uploadModalLabel" data-translate="uploadFile">上传文件</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="dropZone" class="border border-primary rounded text-center py-4 position-relative">
|
||||
<i class="fas fa-cloud-upload-alt"></i>
|
||||
<p class="mb-0 mt-3">拖动文件到此区域上传<br>或者点击下方选择文件按钮</p>
|
||||
<i class="fas fa-cloud-upload-alt"></i>
|
||||
<p class="mb-0 mt-3" data-translate="dragOrClickToUpload">拖动文件到此区域上传<br>或者点击下方选择文件按钮</p>
|
||||
</div>
|
||||
<input type="file" id="fileInputModal" class="form-control mt-3" hidden>
|
||||
<button id="selectFileBtn" class="btn btn-primary btn-block mt-3 w-100">选择文件</button>
|
||||
<button id="selectFileBtn" class="btn btn-primary btn-block mt-3 w-100" data-translate="selectFile">选择文件</button>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-translate="close">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -831,7 +831,8 @@ function displayUpdateNotification() {
|
|||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="editModalLabel">编辑文件: <span id="editingFileName"></span></h5>
|
||||
<h5 class="modal-title" id="editModalLabel"><?php echo $langData[$currentLang]['editFile']; ?>: <span id="editingFileName"></span></h5>
|
||||
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
@ -842,8 +843,8 @@ function displayUpdateNotification() {
|
|||
<input type="hidden" name="fileName" id="hiddenFileName">
|
||||
<input type="hidden" name="fileType" id="hiddenFileType">
|
||||
<div class="mt-3 d-flex justify-content-start gap-2">
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
<button type="button" class="btn btn-pink" onclick="openFullScreenEditor()">高级编辑</button>
|
||||
<button type="submit" class="btn btn-primary" data-translate="save">保存</button>
|
||||
<button type="button" class="btn btn-pink" onclick="openFullScreenEditor()" data-translate="advancedEdit">高级编辑</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -856,7 +857,7 @@ function displayUpdateNotification() {
|
|||
<div class="modal-content" style="border: none;">
|
||||
<div class="modal-header d-flex justify-content-between align-items-center" style="border-bottom: none;">
|
||||
<div class="d-flex align-items-center">
|
||||
<h5 class="modal-title mr-3">高级编辑 - 全屏模式</h5>
|
||||
<h5 class="modal-title mr-3" data-translate="advancedEditorTitle"></h5>
|
||||
<select id="fontSize" onchange="changeFontSize()" class="form-select mx-1" style="width: auto; font-size: 0.8rem;">
|
||||
<option value="18px">18px</option>
|
||||
<option value="20px" selected>20px</option>
|
||||
|
@ -903,14 +904,14 @@ function displayUpdateNotification() {
|
|||
<option value="ace/theme/pastel_on_dark">Pastel on Dark</option>
|
||||
</select>
|
||||
|
||||
<button type="button" class="btn btn-success btn-sm mx-1" onclick="formatContent()">格式化缩进</button>
|
||||
<button type="button" class="btn btn-success btn-sm mx-1" id="yamlFormatBtn" onclick="formatYamlContent()" style="display: none;">格式化 YAML</button>
|
||||
<button type="button" class="btn btn-info btn-sm mx-1" id="jsonValidationBtn" onclick="validateJsonSyntax()">验证 JSON 语法</button>
|
||||
<button type="button" class="btn btn-info btn-sm mx-1" id="yamlValidationBtn" onclick="validateYamlSyntax()" style="display: none;">验证 YAML 语法</button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick="saveFullScreenContent()">保存并关闭</button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick="openSearch()">搜索</button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick="closeFullScreenEditor()">取消</button>
|
||||
<button type="button" class="btn btn-warning btn-sm mx-1" id="toggleFullscreenBtn" onclick="toggleFullscreen()">全屏</button>
|
||||
<button type="button" class="btn btn-success btn-sm mx-1" onclick="formatContent()" data-translate="formatIndentation">格式化缩进</button>
|
||||
<button type="button" class="btn btn-success btn-sm mx-1" id="yamlFormatBtn" onclick="formatYamlContent()" style="display: none;" data-translate="formatYaml">格式化 YAML</button>
|
||||
<button type="button" class="btn btn-info btn-sm mx-1" id="jsonValidationBtn" onclick="validateJsonSyntax()" data-translate="validateJson">验证 JSON 语法</button>
|
||||
<button type="button" class="btn btn-info btn-sm mx-1" id="yamlValidationBtn" onclick="validateYamlSyntax()" style="display: none;" data-translate="validateYaml">验证 YAML 语法</button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick="saveFullScreenContent()" data-translate="saveAndClose">保存并关闭</button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick="openSearch()" data-translate="search">搜索</button>
|
||||
<button type="button" class="btn btn-primary btn-sm mx-1" onclick="closeFullScreenEditor()" data-translate="cancel">取消</button>
|
||||
<button type="button" class="btn btn-warning btn-sm mx-1" id="toggleFullscreenBtn" onclick="toggleFullscreen()" data-translate="toggleFullscreen">全屏</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="closeFullScreenEditor()">
|
||||
|
@ -919,7 +920,7 @@ function displayUpdateNotification() {
|
|||
</div>
|
||||
|
||||
<div class="d-flex justify-content-center align-items-center my-1" id="editorStatus" style="font-weight: bold; font-size: 0.9rem;">
|
||||
<span id="lineColumnDisplay" style="color: blue; font-size: 1.1rem;">行: 1, 列: 1</span> <span id="charCountDisplay" style="color: blue; font-size: 1.1rem;">字符数: 0</span>
|
||||
<span id="lineColumnDisplay" style="color: blue; font-size: 1.1rem;" data-translate="lineColumnDisplay">行: 1, 列: 1</span> <span id="charCountDisplay" style="color: blue; font-size: 1.1rem;" data-translate="charCountDisplay">字符数: 0</span>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0; height: 100%;">
|
||||
<div id="aceEditorContainer" style="height: 100%; width: 100%;"></div>
|
||||
|
@ -994,7 +995,7 @@ function initializeAceEditor() {
|
|||
let annotations = [];
|
||||
try {
|
||||
JSON.parse(content);
|
||||
alert("JSON 语法正确");
|
||||
alert(langData[currentLang]['validateJson'] + " " + langData[currentLang]['jsonSyntaxCorrect']);
|
||||
} catch (e) {
|
||||
const line = e.lineNumber ? e.lineNumber - 1 : 0;
|
||||
annotations.push({
|
||||
|
@ -1004,7 +1005,7 @@ function initializeAceEditor() {
|
|||
type: "error"
|
||||
});
|
||||
aceEditorInstance.session.setAnnotations(annotations);
|
||||
alert("JSON 语法错误: " + e.message);
|
||||
alert(langData[currentLang]['validateJson'] + " " + langData[currentLang]['jsonSyntaxError'] + ": " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1014,7 @@ function initializeAceEditor() {
|
|||
let annotations = [];
|
||||
try {
|
||||
jsyaml.load(content);
|
||||
alert("YAML 语法正确");
|
||||
alert(langData[currentLang]['validateYaml'] + " " + langData[currentLang]['yamlSyntaxCorrect']);
|
||||
} catch (e) {
|
||||
const line = e.mark ? e.mark.line : 0;
|
||||
annotations.push({
|
||||
|
@ -1023,7 +1024,7 @@ function initializeAceEditor() {
|
|||
type: "error"
|
||||
});
|
||||
aceEditorInstance.session.setAnnotations(annotations);
|
||||
alert("YAML 语法错误: " + e.message);
|
||||
alert(langData[currentLang]['validateYaml'] + " " + langData[currentLang]['yamlSyntaxError'] + ": " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1036,16 +1037,16 @@ function initializeAceEditor() {
|
|||
if (mode === "ace/mode/json") {
|
||||
formattedContent = JSON.stringify(JSON.parse(content), null, 4);
|
||||
aceEditorInstance.setValue(formattedContent, -1);
|
||||
alert("JSON 格式化成功");
|
||||
alert(langData[currentLang]['formatIndentation'] + " " + langData[currentLang]['jsonFormatSuccess']);
|
||||
} else if (mode === "ace/mode/javascript") {
|
||||
formattedContent = js_beautify(content, { indent_size: 4 });
|
||||
aceEditorInstance.setValue(formattedContent, -1);
|
||||
alert("JavaScript 格式化成功");
|
||||
alert(langData[currentLang]['formatIndentation'] + " " + langData[currentLang]['jsFormatSuccess']);
|
||||
} else {
|
||||
alert("当前模式不支持格式化缩进");
|
||||
alert(langData[currentLang]['formatIndentation'] + " " + langData[currentLang]['unsupportedMode']);
|
||||
}
|
||||
} catch (e) {
|
||||
alert("格式化错误: " + e.message);
|
||||
alert(langData[currentLang]['formatIndentation'] + " " + langData[currentLang]['formatError'] + ": " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1057,9 +1058,9 @@ function initializeAceEditor() {
|
|||
const yamlObject = jsyaml.load(content);
|
||||
const formattedYaml = jsyaml.dump(yamlObject, { indent: 4 });
|
||||
aceEditorInstance.setValue(formattedYaml, -1);
|
||||
alert("YAML 格式化成功");
|
||||
alert(langData[currentLang]['yamlFormatSuccess']);
|
||||
} catch (e) {
|
||||
alert("YAML 格式化错误: " + e.message);
|
||||
alert(langData[currentLang]['yamlSyntaxError'] + ": " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1116,8 +1117,11 @@ function initializeAceEditor() {
|
|||
const column = cursor.column + 1;
|
||||
const charCount = aceEditorInstance.getValue().length;
|
||||
|
||||
document.getElementById('lineColumnDisplay').textContent = `行: ${line}, 列: ${column}`;
|
||||
document.getElementById('charCountDisplay').textContent = `字符数: ${charCount}`;
|
||||
const lineColumnText = langData[currentLang]['lineColumnDisplay'].replace("{line}", line).replace("{column}", column);
|
||||
const charCountText = langData[currentLang]['charCountDisplay'].replace("{charCount}", charCount);
|
||||
|
||||
document.getElementById('lineColumnDisplay').textContent = lineColumnText;
|
||||
document.getElementById('charCountDisplay').textContent = charCountText;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -1212,7 +1216,7 @@ function initializeAceEditor() {
|
|||
}
|
||||
|
||||
</script>
|
||||
<h2 class="text-center mt-4 mb-4">Mihomo订阅管理</h2>
|
||||
<h2 class="text-center mt-4 mb-4"><?php echo $langData[$currentLang]['subscriptionManagement']; ?></h2>
|
||||
|
||||
<?php if (isset($message) && $message): ?>
|
||||
<div class="alert alert-info">
|
||||
|
@ -1234,16 +1238,16 @@ function initializeAceEditor() {
|
|||
<form method="post" class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<h5 for="subscription_url_<?php echo $displayIndex; ?>" class="mb-2">订阅链接 <?php echo $displayIndex; ?></h5>
|
||||
<input type="text" name="subscription_url" id="subscription_url_<?php echo $displayIndex; ?>" value="<?php echo htmlspecialchars($url); ?>" class="form-control" placeholder="请输入订阅链接">
|
||||
<h5 for="subscription_url_<?php echo $displayIndex; ?>" class="mb-2"><?php echo $langData[$currentLang]['subscriptionLink']; ?> <?php echo $displayIndex; ?></h5>
|
||||
<input type="text" name="subscription_url" id="subscription_url_<?php echo $displayIndex; ?>" value="<?php echo htmlspecialchars($url); ?>" class="form-control" placeholder="<?php echo $langData[$currentLang]['enterSubscriptionUrl']; ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="custom_file_name_<?php echo $displayIndex; ?>">自定义文件名</label>
|
||||
<label for="custom_file_name_<?php echo $displayIndex; ?>"><?php echo $langData[$currentLang]['customFileName']; ?></label>
|
||||
<input type="text" name="custom_file_name" id="custom_file_name_<?php echo $displayIndex; ?>" value="<?php echo htmlspecialchars($fileName); ?>" class="form-control">
|
||||
</div>
|
||||
<input type="hidden" name="index" value="<?php echo $i; ?>">
|
||||
<div class="text-center mt-3">
|
||||
<button type="submit" name="update" class="btn btn-info btn-block"><i class="bi bi-arrow-repeat"></i> 更新订阅 <?php echo $displayIndex; ?></button>
|
||||
<button type="submit" name="update" class="btn btn-info btn-block"><i class="bi bi-arrow-repeat"></i> <?php echo $langData[$currentLang]['updateSubscription']; ?> <?php echo $displayIndex; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1267,20 +1271,20 @@ function initializeAceEditor() {
|
|||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2 class="mt-4 mb-4 text-center">自动更新</h2>
|
||||
<h2 class="mt-4 mb-4 text-center" data-translate="auto_update_title"></h2>
|
||||
<form method="post" class="text-center">
|
||||
<div class="d-flex flex-wrap justify-content-center gap-2">
|
||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#cronModal">
|
||||
<i class="bi bi-clock"></i> 设置定时任务
|
||||
<i class="bi bi-clock"></i> <span data-translate="set_cron_job"></span>
|
||||
</button>
|
||||
<button type="submit" name="createShellScript" value="true" class="btn btn-success">
|
||||
<i class="bi bi-terminal"></i> 生成更新脚本
|
||||
<i class="bi bi-terminal"></i> <span data-translate="generate_update_script"></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-info" data-bs-toggle="modal" data-bs-target="#downloadModal">
|
||||
<i class="bi bi-download"></i> 更新数据库
|
||||
<i class="bi bi-download"></i> <span data-translate="update_database"></span>
|
||||
</button>
|
||||
<a class="btn btn-pink btn-sm text-white" target="_blank" href="./filekit.php" style="font-size: 14px; font-weight: bold;">
|
||||
<i class="bi bi-file-earmark-text"></i> 打开文件助手
|
||||
<i class="bi bi-file-earmark-text"></i> <span data-translate="open_file_helper"></span>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1290,7 +1294,7 @@ function initializeAceEditor() {
|
|||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="downloadModalLabel">选择数据库下载</h5>
|
||||
<h5 class="modal-title" id="downloadModalLabel" data-translate="select_database_download"></h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
@ -1298,7 +1302,7 @@ function initializeAceEditor() {
|
|||
<div class="modal-body">
|
||||
<form method="GET" action="">
|
||||
<div class="mb-3">
|
||||
<label for="fileSelect" class="form-label">选择文件</label>
|
||||
<label for="fileSelect" class="form-label" data-translate="select_file"></label>
|
||||
<select class="form-select" id="fileSelect" name="file">
|
||||
<option value="geoip">geoip.metadb</option>
|
||||
<option value="geosite">geosite.dat</option>
|
||||
|
@ -1306,8 +1310,8 @@ function initializeAceEditor() {
|
|||
</select>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary me-2">下载</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary me-2" data-translate="download_button"></button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-translate="cancel_button"></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1321,27 +1325,27 @@ function initializeAceEditor() {
|
|||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cronModalLabel">设置 Cron 计划任务</h5>
|
||||
<h5 class="modal-title" id="cronModalLabel" data-translate="cron_task_title">设置 Cron 计划任务</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="cronExpression" class="form-label">Cron 表达式</label>
|
||||
<label for="cronExpression" class="form-label" data-translate="cron_expression_label">Cron 表达式</label>
|
||||
<input type="text" class="form-control" id="cronExpression" name="cronExpression" value="0 2 * * *" required>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<strong>提示:</strong> Cron 表达式格式:
|
||||
<strong data-translate="cron_hint">提示:</strong> <span data-translate="cron_expression_format">Cron 表达式格式:</span>
|
||||
<ul>
|
||||
<li><code>分钟 小时 日 月 星期</code></li>
|
||||
<li>示例: 每天凌晨 2 点: <code>0 2 * * *</code></li>
|
||||
<li><span data-translate="cron_example">示例: 每天凌晨 2 点: </span><code>0 2 * * *</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex justify-content-end gap-3">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
|
||||
<button type="submit" name="createCronJob" class="btn btn-primary">保存</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-translate="cancel_button">取消</button>
|
||||
<button type="submit" name="createCronJob" class="btn btn-primary" data-translate="save_button">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -163,120 +163,118 @@ EOL;
|
|||
</style>
|
||||
<div class="container-sm container-bg callout border border-3 rounded-4 col-11">
|
||||
<div class="row">
|
||||
<a href="./index.php" class="col btn btn-lg"><i class="bi bi-house-door d-none d-sm-inline"></i> 首页</a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg"><i class="bi bi-folder d-none d-sm-inline"></i> <span style="white-space: nowrap;">文件管理</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg"><i class="bi bi-shop d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 一</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg"><i class="bi bi-bank d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 二</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg"><i class="bi bi-building d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 三</span></a>
|
||||
<a href="./index.php" class="col btn btn-lg text-nowrap"><i class="bi bi-house-door"></i> <span data-translate="home">Home</span></a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg text-nowrap"><i class="bi bi-folder"></i> <span data-translate="manager">Manager</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg text-nowrap"><i class="bi bi-shop"></i> <span data-translate="template_i">Template I</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg text-nowrap"><i class="bi bi-bank"></i> <span data-translate="template_ii">Template II</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg text-nowrap"><i class="bi bi-building"></i> <span data-translate="template_iii">Template III</span></a>
|
||||
<div class="outer-container">
|
||||
<div class="container-fluid">
|
||||
<h1 class="title text-center" style="margin-top: 3rem; margin-bottom: 2rem;">Sing-box 转换模板 一</h1>
|
||||
<h1 class="title text-center" style="margin-top: 3rem; margin-bottom: 2rem;" data-translate="title">Sing-box Conversion Template One</h1>
|
||||
<div class="alert alert-info">
|
||||
<h4 class="alert-heading">帮助信息</h4>
|
||||
<h4 class="alert-heading" data-translate="helpInfoHeading">Help Information</h4>
|
||||
<ul>
|
||||
<li><strong>模板 1</strong>:无地区 无分组 。</li>
|
||||
<li><strong>模板 2</strong>:无地区 带分流规则 。</li>
|
||||
<li><strong>模板 3</strong>:香港 台湾 新加坡 日本 美国 韩国 分组 带分流规则。</li>
|
||||
<li><strong>模板 4</strong>:同上多规则。</li>
|
||||
<li data-translate="template1"><strong>Template 1</strong>: No Region, No Groups.</li>
|
||||
<li data-translate="template2"><strong>Template 2</strong>: No Region, With Routing Rules.</li>
|
||||
<li data-translate="template3"><strong>Template 3</strong>: Hong Kong, Taiwan, Singapore, Japan, USA, South Korea, With Routing Rules.</li>
|
||||
<li data-translate="template4"><strong>Template 4</strong>: Same As Above, Multiple Rules.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post" action="">
|
||||
<div class="mb-3">
|
||||
<label for="subscribeUrl" class="form-label">订阅链接地址</label>
|
||||
<input type="text" class="form-control" id="subscribeUrl" name="subscribeUrl" value="<?php echo htmlspecialchars($lastSubscribeUrl); ?>" placeholder="输入订阅链接,多个链接用 | 分隔" required>
|
||||
<label for="subscribeUrl" class="form-label" data-translate="subscribeUrlLabel">Subscription URL</label>
|
||||
<input type="text" class="form-control" id="subscribeUrl" name="subscribeUrl" value="<?php echo htmlspecialchars($lastSubscribeUrl); ?>" placeholder="Enter subscription URL, multiple URLs separated by |" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="customFileName" class="form-label">自定义文件名(默认:sing-box.json)</label>
|
||||
<label for="customFileName" class="form-label" data-translate="customFileNameLabel">Custom Filename (Default: sing-box.json)</label>
|
||||
<input type="text" class="form-control" id="customFileName" name="customFileName" placeholder="sing-box.json">
|
||||
</div>
|
||||
<fieldset class="mb-3">
|
||||
<legend class="form-label">选择模板</legend>
|
||||
<legend class="form-label" data-translate="chooseTemplateLabel">Choose Template</legend>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate0" name="defaultTemplate" value="0" checked>
|
||||
<label class="form-check-label" for="useDefaultTemplate0">默认模板</label>
|
||||
<label class="form-check-label" for="useDefaultTemplate0" data-translate="defaultTemplateLabel">Default Template</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate1" name="defaultTemplate" value="1" checked>
|
||||
<label class="form-check-label" for="useDefaultTemplate1">模板 1</label>
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate1" name="defaultTemplate" value="1">
|
||||
<label class="form-check-label" for="useDefaultTemplate1" data-translate="template1Label">Template 1</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate2" name="defaultTemplate" value="2">
|
||||
<label class="form-check-label" for="useDefaultTemplate2">模板 2</label>
|
||||
<label class="form-check-label" for="useDefaultTemplate2" data-translate="template2Label">Template 2</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate3" name="defaultTemplate" value="3">
|
||||
<label class="form-check-label" for="useDefaultTemplate3">模板 3</label>
|
||||
<label class="form-check-label" for="useDefaultTemplate3" data-translate="template3Label">Template 3</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate4" name="defaultTemplate" value="4">
|
||||
<label class="form-check-label" for="useDefaultTemplate4">模板 4</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="radio" class="form-check-input" id="useDefaultTemplate5" name="defaultTemplate" value="5">
|
||||
<label class="form-check-label" for="useDefaultTemplate4">模板 5</label>
|
||||
<label class="form-check-label" for="useDefaultTemplate4" data-translate="template4Label">Template 4</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<input type="radio" class="form-check-input" id="useCustomTemplate" name="templateOption" value="custom">
|
||||
<label class="form-check-label mb-3" for="useCustomTemplate">使用自定义模板URL</label>
|
||||
<input type="text" class="form-control" id="customTemplateUrl" name="customTemplateUrl" placeholder="输入自定义模板URL">
|
||||
<label class="form-check-label mb-3" for="useCustomTemplate" data-translate="useCustomTemplateLabel">Use Custom Template URL</label>
|
||||
<input type="text" class="form-control" id="customTemplateUrl" name="customTemplateUrl" placeholder="Enter custom template URL" data-translate-placeholder="customTemplateUrlPlaceholder">
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="d-flex flex-wrap gap-2 mb-4">
|
||||
<div class="col-auto">
|
||||
<form method="post" action="">
|
||||
<button type="submit" name="generateConfig" class="btn btn-info">
|
||||
<i class="bi bi-file-earmark-text"></i> 生成配置文件
|
||||
<i class="bi bi-file-earmark-text"></i> <span data-translate="generateConfigLabel">Generate Configuration File</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#cronModal">
|
||||
<i class="bi bi-clock"></i> 设置定时任务
|
||||
<i class="bi bi-clock"></i> <span data-translate="setCronLabel">Set Cron Job</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<form method="post" action="">
|
||||
<button type="submit" name="createShellScript" class="btn btn-primary">
|
||||
<i class="bi bi-terminal"></i> 生成更新脚本
|
||||
<i class="bi bi-terminal"></i> <span data-translate="generateShellLabel">Generate Update Script</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal fade" id="cronModal" tabindex="-1" aria-labelledby="cronModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cronModalLabel">设置定时任务</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form method="post" action="">
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="cronExpression" class="form-label">Cron 表达式</label>
|
||||
<input type="text" class="form-control" id="cronExpression" name="cronExpression" value="0 2 * * *" required>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<strong>提示:</strong> Cron 表达式格式:
|
||||
<ul>
|
||||
<li><code>分钟 小时 日 月 星期</code></li>
|
||||
<li>示例: 每天凌晨 2 点: <code>0 2 * * *</code></li>
|
||||
<li>每周一凌晨 3 点: <code>0 3 * * 1</code></li>
|
||||
<li>工作日(周一至周五)的上午 9 点: <code>0 9 * * 1-5</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cronModalLabel" data-translate="setCronModalTitle">Set Cron Job</h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form method="post" action="">
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="cronExpression" class="form-label" data-translate="cronExpressionLabel">Cron Expression</label>
|
||||
<input type="text" class="form-control" id="cronExpression" name="cronExpression" value="0 2 * * *" required>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<strong data-translate="cron_hint">提示:</strong> <span data-translate="cron_expression_format">Cron 表达式格式:</span>
|
||||
<ul>
|
||||
<li><code>分钟 小时 日 月 星期</code></li>
|
||||
<li><span data-translate="cron_example">示例: 每天凌晨 2 点: </span><code>0 2 * * *</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-translate="cancelButton">Cancel</button>
|
||||
<button type="submit" name="setCron" class="btn btn-primary" data-translate="saveButton">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
|
||||
<button type="submit" name="setCron" class="btn btn-primary">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.querySelectorAll('input[name="defaultTemplate"]').forEach((elem) => {
|
||||
elem.addEventListener('change', function () {
|
||||
|
@ -387,23 +385,23 @@ EOL;
|
|||
|
||||
$tmpFileSavePath = '/etc/neko/proxy_provider/' . $fixedFileName;
|
||||
if (file_put_contents($tmpFileSavePath, $completeSubscribeUrl) === false) {
|
||||
$logMessages[] = "无法保存订阅URL到文件: " . $tmpFileSavePath;
|
||||
$logMessages[] = $translations['save_subscribe_url_failed'] . $tmpFileSavePath;
|
||||
} else {
|
||||
$logMessages[] = "订阅URL已成功保存到文件: " . $tmpFileSavePath;
|
||||
$logMessages[] = $translations['subscribe_url_saved'] . $tmpFileSavePath;
|
||||
}
|
||||
|
||||
$configFilePath = '/etc/neko/config/' . $customFileName;
|
||||
if (file_put_contents($configFilePath, $downloadedContent) === false) {
|
||||
$logMessages[] = "无法保存修改后的内容到: " . $configFilePath;
|
||||
$logMessages[] = $translations['save_config_failed'] . $configFilePath;
|
||||
} else {
|
||||
$logMessages[] = "配置文件生成并保存成功: " . $configFilePath;
|
||||
$logMessages[] = $translations['config_saved'] . $configFilePath;
|
||||
}
|
||||
|
||||
if (file_exists($tempFilePath)) {
|
||||
unlink($tempFilePath);
|
||||
$logMessages[] = "临时文件已被清理: " . $tempFilePath;
|
||||
$logMessages[] = $translations['temp_file_cleaned'] . $tempFilePath;
|
||||
} else {
|
||||
$logMessages[] = "未找到临时文件以进行清理: " . $tempFilePath;
|
||||
$logMessages[] = $translations['temp_file_not_found'] . $tempFilePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -414,9 +412,9 @@ EOL;
|
|||
echo "<textarea id='configContent' name='configContent' class='form-control' style='height: 300px;'>" . htmlspecialchars($downloadedContent) . "</textarea>";
|
||||
echo "</div>";
|
||||
echo "<div class='text-center' mb-3>";
|
||||
echo "<button class='btn btn-info me-3' type='button' onclick='copyToClipboard()'><i class='bi bi-clipboard'></i> 复制到剪贴</button>";
|
||||
echo "<button class='btn btn-info me-3' type='button' onclick='copyToClipboard()'><i class='bi bi-clipboard'></i> " . $translations['copy_to_clipboard'] . "</button>";
|
||||
echo "<input type='hidden' name='saveContent' value='1'>";
|
||||
echo "<button class='btn btn-success' type='submit'><i class='bi bi-save'></i> 保存修改</button>";
|
||||
echo "<button class='btn btn-success' type='submit'><i class='bi bi-save'></i> " . $translations['save_changes'] . "</button>";
|
||||
echo "</div>";
|
||||
echo "</form>";
|
||||
echo "</div>";
|
||||
|
@ -431,9 +429,9 @@ EOL;
|
|||
if (isset($_POST['configContent'])) {
|
||||
$editedContent = trim($_POST['configContent']);
|
||||
if (file_put_contents($configFilePath, $editedContent) === false) {
|
||||
echo "<div class='alert alert-danger'>无法保存修改后的内容到: " . htmlspecialchars($configFilePath) . "</div>";
|
||||
echo "<div class='alert alert-danger'>" . $translations['error_save_content'] . htmlspecialchars($configFilePath) . "</div>";
|
||||
} else {
|
||||
echo "<div class='alert alert-success'>内容已成功保存到: " . htmlspecialchars($configFilePath) . "</div>";
|
||||
echo "<div class='alert alert-success'>" . $translations['success_save_content'] . htmlspecialchars($configFilePath) . "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -441,7 +439,7 @@ EOL;
|
|||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['clearData'])) {
|
||||
if (file_exists($dataFilePath)) {
|
||||
file_put_contents($dataFilePath, '');
|
||||
echo "<div class='alert alert-success'>保存的数据已清空。</div>";
|
||||
echo "<div class='alert alert-success'>" . $translations['save_data_cleared'] . "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -449,10 +447,10 @@ EOL;
|
|||
$savedData = file_get_contents($dataFilePath);
|
||||
echo "<div class='card'>";
|
||||
echo "<div class='card-body'>";
|
||||
echo "<h2 class='card-title'>保存的数据</h2>";
|
||||
echo "<h2 class='card-title'>" . $translations['data_saved'] . "</h2>";
|
||||
echo "<pre>" . htmlspecialchars($savedData) . "</pre>";
|
||||
echo "<form method='post' action=''>";
|
||||
echo '<button class="btn btn-danger" type="submit" name="clearData"><i class="bi bi-trash"></i> 清空数据</button>';
|
||||
echo '<button class="btn btn-danger" type="submit" name="clearData"><i class="bi bi-trash"></i> ' . $translations['clear_data'] . '</button>';
|
||||
echo "</form>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
|
|
|
@ -539,40 +539,40 @@ EOL;
|
|||
</style>
|
||||
<div class="container-sm container-bg callout border border-3 rounded-4 col-11">
|
||||
<div class="row">
|
||||
<a href="./index.php" class="col btn btn-lg"><i class="bi bi-house-door d-none d-sm-inline"></i> 首页</a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg"><i class="bi bi-folder d-none d-sm-inline"></i> <span style="white-space: nowrap;">文件管理</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg"><i class="bi bi-shop d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 一</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg"><i class="bi bi-bank d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 二</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg"><i class="bi bi-building d-none d-sm-inline"></i> <span style="white-space: nowrap;">模板 三</span></a>
|
||||
<h1 class="text-center p-2" style="margin-top: 2rem; margin-bottom: 1rem;">Sing-box 转换模板 二</h1>
|
||||
<a href="./index.php" class="col btn btn-lg text-nowrap"><i class="bi bi-house-door"></i> <span data-translate="home">Home</span></a>
|
||||
<a href="./mihomo_manager.php" class="col btn btn-lg text-nowrap"><i class="bi bi-folder"></i> <span data-translate="manager">Manager</span></a>
|
||||
<a href="./singbox.php" class="col btn btn-lg text-nowrap"><i class="bi bi-shop"></i> <span data-translate="template_i">Template I</span></a>
|
||||
<a href="./subscription.php" class="col btn btn-lg text-nowrap"><i class="bi bi-bank"></i> <span data-translate="template_ii">Template II</span></a>
|
||||
<a href="./mihomo.php" class="col btn btn-lg text-nowrap"><i class="bi bi-building"></i> <span data-translate="template_iii">Template III</span></a>
|
||||
<h1 class="text-center p-2" style="margin-top: 2rem; margin-bottom: 1rem;" data-translate="form_title"></h1>
|
||||
|
||||
<div class="col-12 custom-padding">
|
||||
<div class="form-section">
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="subscription_url" class="form-label">输入订阅链接</label>
|
||||
<label for="subscription_url" class="form-label" data-translate="subscription_url_label"></label>
|
||||
<input type="text" class="form-control" id="subscription_url" name="subscription_url"
|
||||
value="<?php echo htmlspecialchars($current_subscription_url); ?>"placeholder="支持各种订阅链接或单节点链接,多个链接用 | 分隔" required>
|
||||
value="<?php echo htmlspecialchars($current_subscription_url); ?>" placeholder="" data-translate-placeholder="subscription_url_placeholder" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="filename" class="form-label">自定义文件名 (默认: config.json)</label>
|
||||
<label for="filename" class="form-label" data-translate="filename_label"></label>
|
||||
<input type="text" class="form-control" id="filename" name="filename"
|
||||
value="<?php echo htmlspecialchars(isset($_POST['filename']) ? $_POST['filename'] : ''); ?>"
|
||||
placeholder="config.json">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="backend_url" class="form-label">选择后端地址</label>
|
||||
<label for="backend_url" class="form-label" data-translate="backend_url_label"></label>
|
||||
<select class="form-select" id="backend_url" name="backend_url" required>
|
||||
<option value="https://url.v1.mk/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://url.v1.mk/sub?' ? 'selected' : ''; ?>>
|
||||
肥羊增强型后端【vless reality+hy1+hy2】
|
||||
<?php echo $langData[$currentLang]['backend_url_option_1']; ?>
|
||||
</option>
|
||||
<option value="https://sub.d1.mk/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.d1.mk/sub?' ? 'selected' : ''; ?>>
|
||||
肥羊备用后端【vless reality+hy1+hy2】
|
||||
<?php echo $langData[$currentLang]['backend_url_option_2']; ?>
|
||||
</option>
|
||||
<option value="https://sub.xeton.dev/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.xeton.dev/sub?' ? 'selected' : ''; ?>>
|
||||
subconverter作者提供
|
||||
<?php echo $langData[$currentLang]['backend_url_option_3']; ?>
|
||||
</option>
|
||||
<option value="https://www.tline.website/sub/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://www.tline.website/sub/sub?' ? 'selected' : ''; ?>>
|
||||
tline.website
|
||||
|
@ -581,7 +581,7 @@ EOL;
|
|||
api.dler.io
|
||||
</option>
|
||||
<option value="https://v.id9.cc/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://v.id9.cc/sub?' ? 'selected' : ''; ?>>
|
||||
v.id9.cc(品云提供)
|
||||
<?php echo $langData[$currentLang]['backend_url_option_6']; ?>
|
||||
</option>
|
||||
<option value="https://sub.id9.cc/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.id9.cc/sub?' ? 'selected' : ''; ?>>
|
||||
sub.id9.cc
|
||||
|
@ -593,19 +593,19 @@ EOL;
|
|||
subcloud.xyz
|
||||
</option>
|
||||
<option value="https://sub.maoxiongnet.com/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'https://sub.maoxiongnet.com/sub?' ? 'selected' : ''; ?>>
|
||||
sub.maoxiongnet.com(猫熊提供)
|
||||
<?php echo $langData[$currentLang]['backend_url_option_10']; ?>
|
||||
</option>
|
||||
<option value="http://localhost:25500/sub?" <?php echo ($_POST['backend_url'] ?? '') === 'http://localhost:25500/sub?' ? 'selected' : ''; ?>>
|
||||
localhost:25500 本地版
|
||||
<?php echo $langData[$currentLang]['backend_url_option_11']; ?>
|
||||
</option>
|
||||
<option value="custom" <?php echo ($_POST['backend_url'] ?? '') === 'custom' ? 'selected' : ''; ?>>
|
||||
自定义后端地址
|
||||
<?php echo $langData[$currentLang]['backend_url_option_custom']; ?>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3" id="custom_backend_url_input" style="display: none;">
|
||||
<label for="custom_backend_url" class="form-label">请输入自定义后端地址</label>
|
||||
<label for="custom_backend_url" class="form-label" data-translate="custom_backend_url_label"></label>
|
||||
<input type="text" class="form-control" id="custom_backend_url" name="custom_backend_url" value="<?php echo htmlspecialchars($_POST['custom_backend_url'] ?? '') . (empty($_POST['custom_backend_url']) ? '' : '?'); ?>" />
|
||||
</div>
|
||||
|
||||
|
@ -714,94 +714,94 @@ EOL;
|
|||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">选择额外配置选项</label>
|
||||
<label class="form-label" data-translate="choose_additional_options"></label>
|
||||
<div class="d-flex flex-wrap align-items-center">
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="emoji" name="emoji" value="true"
|
||||
<?php echo isset($_POST['emoji']) && $_POST['emoji'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="emoji">启用 Emoji</label>
|
||||
<label class="form-check-label" for="emoji" data-translate="enable_emoji"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="udp" name="udp" value="true"
|
||||
<?php echo isset($_POST['udp']) && $_POST['udp'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="udp">启用 UDP</label>
|
||||
<label class="form-check-label" for="udp" data-translate="enable_udp"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="xudp" name="xudp" value="true"
|
||||
<?php echo isset($_POST['xudp']) && $_POST['xudp'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="xudp">启用 XUDP</label>
|
||||
<label class="form-check-label" for="xudp" data-translate="enable_xudp"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="tfo" name="tfo" value="true"
|
||||
<?php echo isset($_POST['tfo']) && $_POST['tfo'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="tfo">启用 TFO</label>
|
||||
<label class="form-check-label" for="tfo" data-translate="enable_tfo"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="fdn" name="fdn" value="true"
|
||||
<?php echo isset($_POST['fdn']) && $_POST['fdn'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="tls13">启用 FDN</label>
|
||||
<label class="form-check-label" for="tls13" data-translate="enable_fdn"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="sort" name="sort" value="true"
|
||||
<?php echo isset($_POST['sort']) && $_POST['sort'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="sort">启用 SORT</label>
|
||||
<label class="form-check-label" for="sort" data-translate="enable_sort"></label>
|
||||
</div>
|
||||
<div class="form-check me-3">
|
||||
<input type="checkbox" class="form-check-input" id="tls13" name="tls13" value="true"
|
||||
<?php echo isset($_POST['tls13']) && $_POST['tls13'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="tls13">启用 TLS_1.3</label>
|
||||
<label class="form-check-label" for="tls13" data-translate="enable_tls13"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="ipv6" name="ipv6" value="true"
|
||||
<?php echo isset($_POST['ipv6']) && $_POST['ipv6'] == 'true' ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="ipv6">启用 IPv6</label>
|
||||
<label class="form-check-label" for="ipv6" data-translate="enable_ipv6"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="include" class="form-label">包含节点 (可选)</label>
|
||||
<label for="include" class="form-label" data-translate="include_nodes"></label>
|
||||
<input type="text" class="form-control" id="include" name="include"
|
||||
value="<?php echo htmlspecialchars($_POST['include'] ?? ''); ?>" placeholder="要保留的节点,支持正则 | 分隔">
|
||||
value="<?php echo htmlspecialchars($_POST['include'] ?? ''); ?>" placeholder="要保留的节点,支持正则 | 分隔" data-translate-placeholder="include_placeholder">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="exclude" class="form-label">排除节点 (可选)</label>
|
||||
<label for="exclude" class="form-label" data-translate="exclude_nodes"></label>
|
||||
<input type="text" class="form-control" id="exclude" name="exclude"
|
||||
value="<?php echo htmlspecialchars($_POST['exclude'] ?? ''); ?>" placeholder="要排除的节点,支持正则 | 分隔">
|
||||
value="<?php echo htmlspecialchars($_POST['exclude'] ?? ''); ?>" placeholder="要排除的节点,支持正则 | 分隔" data-translate-placeholder="exclude_placeholder">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="rename" class="form-label">节点命名</label>
|
||||
<label for="rename" class="form-label" data-translate="rename_nodes"></label>
|
||||
<input type="text" class="form-control" id="rename" name="rename"
|
||||
value="<?php echo htmlspecialchars(isset($_POST['rename']) ? $_POST['rename'] : ''); ?>"
|
||||
placeholder="输入重命名内容(举例:`a@b``1@2`,|符可用\转义)">
|
||||
placeholder="输入重命名内容(举例:`a@b``1@2`,|符可用\转义)" data-translate-placeholder="rename_placeholder">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="download_option">选择要下载的数据库</label>
|
||||
<label class="form-label" for="download_option" data-translate="choose_download_database"></label>
|
||||
<select class="form-select" id="download_option" name="download_option">
|
||||
<option value="geoip" <?php echo isset($_POST['download_option']) && $_POST['download_option'] === 'geoip' ? 'selected' : ''; ?>>GeoIP 数据库 (geoip.db)</option>
|
||||
<option value="geosite" <?php echo isset($_POST['download_option']) && $_POST['download_option'] === 'geosite' ? 'selected' : ''; ?>>Geosite 数据库 (geosite.db)</option>
|
||||
<option value="geoip" <?php echo isset($_POST['download_option']) && $_POST['download_option'] === 'geoip' ? 'selected' : ''; ?>data-translate="geoip_database">GeoIP 数据库 (geoip.db)</option>
|
||||
<option value="geosite" <?php echo isset($_POST['download_option']) && $_POST['download_option'] === 'geosite' ? 'selected' : ''; ?>data-translate="geosite_database">Geosite 数据库 (geosite.db)</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary col mx-2" name="action" value="generate_subscription"><i class="bi bi-file-earmark-text"></i> 生成配置文件</button>
|
||||
<button type="submit" class="btn btn-success" name="download_action" value="download_files"><i class="bi bi-download"></i> 下载数据库</button>
|
||||
<button type="submit" class="btn btn-primary col mx-2" name="action" value="generate_subscription"><i class="bi bi-file-earmark-text"></i> <span data-translate="generate_configuration_file"></span></button>
|
||||
<button type="submit" class="btn btn-success" name="download_action" value="download_files"><i class="bi bi-download"></i> <span data-translate="download_database"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container custom-padding">
|
||||
<form method="post">
|
||||
<h5 style="margin-top: 20px;">定时任务</h5>
|
||||
<button type="button" class="btn btn-primary mx-2" data-bs-toggle="modal" data-bs-target="#cronModal"><i class="bi bi-clock"></i> 设置定时任务</button>
|
||||
<button type="submit" name="createShellScript" value="true" class="btn btn-success"><i class="bi bi-terminal"></i> 生成更新脚本</button>
|
||||
<h5 style="margin-top: 20px;" data-translate="scheduled_tasks"></h5>
|
||||
<button type="button" class="btn btn-primary mx-2" data-bs-toggle="modal" data-bs-target="#cronModal"><i class="bi bi-clock"></i> <span data-translate="set_scheduled_task"></span></button>
|
||||
<button type="submit" name="createShellScript" value="true" class="btn btn-success"><i class="bi bi-terminal"></i> <span data-translate="generate_update_script"></span></button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal fade" id="cronModal" tabindex="-1" aria-labelledby="cronModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cronModalLabel">设置 Cron 计划任务</h5>
|
||||
<h5 class="modal-title" id="cronModalLabel" data-translate="cron_task_title"></h5>
|
||||
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
@ -809,22 +809,22 @@ EOL;
|
|||
<div class="modal-body">
|
||||
<form method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="cronExpression" class="form-label">Cron 表达式</label>
|
||||
<label for="cronExpression" class="form-label" data-translate="cron_expression_label"></label>
|
||||
<input type="text" class="form-control" id="cronExpression" name="cronExpression" value="0 2 * * *" required>
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<strong>提示:</strong> Cron 表达式格式:
|
||||
<strong data-translate="cron_hint">提示:</strong> <span data-translate="cron_expression_format">Cron 表达式格式:</span>
|
||||
<ul>
|
||||
<li><code>分钟 小时 日 月 星期</code></li>
|
||||
<li>示例: 每天凌晨 2 点: <code>0 2 * * *</code></li>
|
||||
<li>每周一凌晨 3 点: <code>0 3 * * 1</code></li>
|
||||
<li>工作日(周一至周五)的上午 9 点: <code>0 9 * * 1-5</code></li>
|
||||
<li><?= $langData[$currentLang]['example1'] ?>: <code>0 2 * * *</code></li>
|
||||
<li><?= $langData[$currentLang]['example2'] ?>: <code>0 3 * * 1</code></li>
|
||||
<li><?= $langData[$currentLang]['example3'] ?>: <code>0 9 * * 1-5</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
|
||||
<button type="submit" name="createCronJob" class="btn btn-primary">保存</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-translate="cancel_button"></button>
|
||||
<button type="submit" name="createCronJob" class="btn btn-primary" data-translate="save_button"></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -832,11 +832,11 @@ EOL;
|
|||
</div>
|
||||
</div>
|
||||
<div class="help mt-4 custom-padding">
|
||||
<strong>1. 对于首次使用 Sing-box 的用户,必须将核心更新至版本 v1.10.0 或更高版本。确保将出站和入站/转发防火墙规则都设置为“接受”并启用它们。<p>
|
||||
<p style="color: red;">注意:在线订阅转换存在隐私泄露风险,请确保使用 Sing-box 的通道一版本,通道二版本不支持此功能。同时,需要下载 geoip 和 geosite 文件以确保正常使用。</p>
|
||||
<p>订阅转换由肥羊提供</p>
|
||||
<strong>1. <?php echo $translations['first_time_singbox_user']; ?><p>
|
||||
<p style="color: red;"><?php echo $translations['warning']; ?></p>
|
||||
<p><?php echo $translations['subscription_conversion']; ?></p>
|
||||
<a href="https://github.com/youshandefeiyang/sub-web-modify" target="_blank" class="btn btn-primary" style="color: white;">
|
||||
<i data-feather="github"></i> 点击访问
|
||||
<i data-feather="github"></i> <?php echo $translations['visit_link']; ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="result mt-4 custom-padding">
|
||||
|
|
|
@ -1 +1 @@
|
|||
V1.7.9-cn
|
||||
V1.8.0
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -33,8 +33,8 @@
|
|||
name="theme-color"
|
||||
content="#FFFFFF"
|
||||
/>
|
||||
<script type="module" crossorigin src="./assets/index-gFJTRz2_.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-BQkN__cg.css">
|
||||
<script type="module" crossorigin src="./assets/index-CslxrP3j.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-D98RqCLX.css">
|
||||
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
|
||||
<body class="overflow-hidden overscroll-none">
|
||||
<div id="app"></div>
|
||||
|
|
|
@ -1 +1 @@
|
|||
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(n,r)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(i[f])return;let o={};const d=e=>s(e,f),t={module:{uri:f},exports:o,require:d};i[f]=Promise.all(n.map((e=>t[e]||d(e)))).then((e=>(r(...e),o)))}}define(["./workbox-3e8df8c8"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-BQkN__cg.css",revision:null},{url:"assets/index-gFJTRz2_.js",revision:null},{url:"index.html",revision:"19971424244515e8e4d7b4ee52332321"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"7f1c4521acc10694fefef8f72dd2ea5f"},{url:"pwa-192x192.png",revision:"021df52501f4357c03eebd808f40dc6a"},{url:"pwa-512x512.png",revision:"d2f759aaabcb2c44ff52b27fde3de6e0"},{url:"pwa-maskable-192x192.png",revision:"7cd11dc5f0490b349d23eef5591d10e5"},{url:"pwa-maskable-512x512.png",revision:"8c97dc367a85a5a1eba523b24f79d03b"},{url:"manifest.webmanifest",revision:"c452912633990899ffe790f985ad0db9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
|
||||
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(n,r)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(i[f])return;let c={};const o=e=>s(e,f),d={module:{uri:f},exports:c,require:o};i[f]=Promise.all(n.map((e=>d[e]||o(e)))).then((e=>(r(...e),c)))}}define(["./workbox-3e8df8c8"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-CslxrP3j.js",revision:null},{url:"assets/index-D98RqCLX.css",revision:null},{url:"index.html",revision:"a3c6fa973c435211888c6045494d40a4"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"7f1c4521acc10694fefef8f72dd2ea5f"},{url:"pwa-192x192.png",revision:"021df52501f4357c03eebd808f40dc6a"},{url:"pwa-512x512.png",revision:"d2f759aaabcb2c44ff52b27fde3de6e0"},{url:"pwa-maskable-192x192.png",revision:"7cd11dc5f0490b349d23eef5591d10e5"},{url:"pwa-maskable-512x512.png",revision:"8c97dc367a85a5a1eba523b24f79d03b"},{url:"manifest.webmanifest",revision:"c452912633990899ffe790f985ad0db9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
|
||||
|
|
|
@ -1 +1 @@
|
|||
v1.63.1
|
||||
v1.64.0
|
|
@ -3,7 +3,7 @@ msgstr ""
|
|||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-08-13 16:16+0200\n"
|
||||
"PO-Revision-Date: 2025-01-17 09:01+0000\n"
|
||||
"PO-Revision-Date: 2025-02-13 13:09+0000\n"
|
||||
"Last-Translator: Максим Горпиніч <maksimgorpinic2005a@gmail.com>\n"
|
||||
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/openwrt/"
|
||||
"luciapplicationstransmission/uk/>\n"
|
||||
|
@ -89,7 +89,7 @@ msgstr "DHT увімкнено"
|
|||
|
||||
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:151
|
||||
msgid "Debug"
|
||||
msgstr "Зневаджування"
|
||||
msgstr "Налагодження"
|
||||
|
||||
#: applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js:97
|
||||
msgid "Download directory"
|
||||
|
|
|
@ -11,7 +11,7 @@ PKG_NAME:=luci-theme-$(THEME_NAME)
|
|||
LUCI_TITLE:=Kucat Theme by sirpdboy
|
||||
LUCI_DEPENDS:=
|
||||
PKG_VERSION:=2.4.11
|
||||
PKG_RELEASE:=20250213
|
||||
PKG_RELEASE:=20250215
|
||||
|
||||
define Package/luci-theme-$(THEME_NAME)/postinst
|
||||
#!/bin/sh
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
--primary-solid: #fd8c73;
|
||||
--primarytextcolor: #677087;
|
||||
--primary-title-color: #4d4d5d;
|
||||
--menu-color: #f5f5f5f5;
|
||||
--menu-color: #fff;
|
||||
--menu-hover-color: #fff;
|
||||
--menu-item-color: #5a636b;
|
||||
--menu-item-titlebg-color: rgba(var(--primary-rgbm),0.22);
|
||||
|
@ -54,7 +54,7 @@
|
|||
--primary-solid: #fd8c73;
|
||||
--primarytextcolor: #bbb;
|
||||
--primary-title-color: #bbb;
|
||||
--menu-color: #bbb;
|
||||
--menu-color: #f5f5f5f5;
|
||||
--menu-hover-color: #e9eff3;
|
||||
--menu-item-color: #b4c9e3;
|
||||
--menu-item-titlebg-color: rgba(var(--primary-rgbm),0.4);
|
||||
|
@ -204,7 +204,7 @@ html, body {
|
|||
}
|
||||
body {
|
||||
letter-spacing: 0.050em;
|
||||
font-size: var(--font-x);
|
||||
font-size: var(--font-z);
|
||||
color: var(--body-color);
|
||||
background-position: top center;
|
||||
-webkit-background-size: cover;
|
||||
|
@ -1760,7 +1760,6 @@ button:hover, .btn:hover, .cbi-button:hover ,.item:hover{
|
|||
overflow-y: auto;
|
||||
width: 100%;
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
outline: 0;
|
||||
}
|
||||
|
@ -1841,8 +1840,8 @@ button:hover, .btn:hover, .cbi-button:hover ,.item:hover{
|
|||
max-width: none;
|
||||
max-height: 200px ;
|
||||
box-shadow: 0 0 4px #918e8c;
|
||||
border-top-left-radius: .25rem;
|
||||
border-top-right-radius: .25rem;
|
||||
/*border-top-left-radius: var(--radius2);
|
||||
border-top-right-radius: var(--radius2); */
|
||||
border: 0px solid var(--inputborder-color);
|
||||
background: rgba(var(--primary-rgbbody), 1);
|
||||
color: var(--inputtext-color);
|
||||
|
@ -1862,7 +1861,7 @@ button:hover, .btn:hover, .cbi-button:hover ,.item:hover{
|
|||
display: initial;
|
||||
}
|
||||
.cbi-dropdown.btn>ul:not(.dropdown), .cbi-dropdown.cbi-button>ul:not(.dropdown) {
|
||||
margin: 0 0 0 .75rem !important;
|
||||
margin: 0 0 0 .85rem !important;
|
||||
}
|
||||
|
||||
.cbi-dropdown.btn.cbi-button>ul{
|
||||
|
@ -1912,9 +1911,8 @@ button:hover, .btn:hover, .cbi-button:hover ,.item:hover{
|
|||
}
|
||||
|
||||
.cbi-dropdown[open]>ul.dropdown>li[selected] {
|
||||
background: rgba(var(--primary-rgbm), 0.3);
|
||||
background: rgba(var(--primary-rgbm), 0.22);
|
||||
color: var(--inputtext-color);
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.cbi-dropdown[open]>ul.dropdown>li.focus {
|
||||
|
@ -1973,9 +1971,7 @@ select[multiple="multiple"] {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.cbi-button-apply>ul:first-child li {
|
||||
color: var(--inputtext-color);
|
||||
}
|
||||
|
||||
/* progressbar */
|
||||
.cbi-progressbar {
|
||||
position: relative;
|
||||
|
@ -2268,9 +2264,9 @@ body.modal-overlay-active #modal_overlay {
|
|||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.2rem;
|
||||
padding: 0.4rem 0.8rem;
|
||||
padding: 0.3rem 0.8rem;
|
||||
box-shadow: inset 0 1px 0px rgba(255, 255, 255, .4), 0 1px 1px rgba(0, 0, 0, .2);
|
||||
background-color: rgba(255, 255, 255, .1);
|
||||
background-color: rgba(var(--primary-rgbm), .12);
|
||||
border-radius: var(--radius2);
|
||||
}
|
||||
|
||||
|
@ -3312,10 +3308,6 @@ pre.command-output {
|
|||
border-bottom-color: #dee2e6
|
||||
}
|
||||
|
||||
[data-page^="admin-services-openclash"] .cbi-tabmenu>li {
|
||||
border-right: none !important;
|
||||
margin: 0 .4rem 0 0 !important
|
||||
}
|
||||
|
||||
[data-page^="admin-services-openclash"] .cbi-tabmenu>li:last-child {
|
||||
margin-right: 0 !important
|
||||
|
@ -3336,16 +3328,7 @@ pre.command-output {
|
|||
padding: 1rem !important
|
||||
}
|
||||
|
||||
[data-page^="admin-services-openclash"] #diag-rc-output>pre,
|
||||
[data-page^="admin-services-openclash"] #dns-rc-output>pre {
|
||||
font-size: .875rem;
|
||||
color: #8898aa;
|
||||
border: 1px solid #dee2e6;
|
||||
background-color: transparent;
|
||||
border-radius: .25rem;
|
||||
font-family: 'Google Sans' !important;
|
||||
box-shadow: none
|
||||
}
|
||||
|
||||
|
||||
[data-page^="admin-services-openclash"] #debug-rc-output>textarea {
|
||||
font-family: 'Google Sans' !important
|
||||
|
@ -3353,13 +3336,14 @@ pre.command-output {
|
|||
|
||||
[data-page^="admin-services-openclash"] .CodeMirror {
|
||||
font-size: inherit;
|
||||
background-color: rgba(0,0,0,0.8)!important;
|
||||
color: var(--body-color)!important;
|
||||
font-family: 'Google Sans' !important
|
||||
}
|
||||
|
||||
[data-page^="admin-services-openclash"] .cbi-button-up,
|
||||
[data-page^="admin-services-openclash"] .cbi-button-down {
|
||||
padding: .8rem 1.5rem;
|
||||
background-color: #f1f1f1;
|
||||
font-size: 0
|
||||
}
|
||||
|
||||
|
@ -3368,39 +3352,30 @@ pre.command-output {
|
|||
width: auto
|
||||
}
|
||||
|
||||
@media all and (-ms-high-contrast:none) {
|
||||
.main>.main-left>.nav>.slide>.menu::before {
|
||||
top: 30.25%
|
||||
}
|
||||
|
||||
.main>.main-left>.nav>li:last-child::before {
|
||||
top: 20%
|
||||
}
|
||||
|
||||
.showSide::before {
|
||||
top: -12px
|
||||
}
|
||||
}
|
||||
|
||||
#cbi-openclash .CodeMirror.cm-s-idea.CodeMirror-wrap {
|
||||
background: rgba(0,0,0,0.1)!important;
|
||||
color: var(--body-color)!important;
|
||||
}
|
||||
#cbi-openclash .cbi-section>div>ul>li {
|
||||
[data-page^="admin-services-openclash"] .cbi-section>div>ul>li {
|
||||
width: auto!important;
|
||||
padding: 0rem 0.5rem!important;
|
||||
|
||||
}
|
||||
|
||||
#cbi-openclash .CodeMirror-merge,#cbi-openclash .CodeMirror-merge-2pane {
|
||||
[data-page^="admin-services-openclash"] .CodeMirror-merge,#cbi-openclash .CodeMirror-merge-2pane {
|
||||
height: auto!important;
|
||||
border: none!important
|
||||
}
|
||||
#cbi-openclash .cm-s-idea span.cm-variable {
|
||||
[data-page^="admin-services-openclash"] .cm-s-idea span.cm-variable {
|
||||
color: #fd8c73!important;
|
||||
}
|
||||
|
||||
#cbi-openclash .CodeMirror-scroll>.CodeMirror-gutters {
|
||||
[data-page^="admin-services-openclash"] .CodeMirror-merge-scrolllock-wrap>.CodeMirror-merge-scrolllock
|
||||
{
|
||||
color: var(--inputtext-color)!important;
|
||||
}
|
||||
|
||||
[data-page^="admin-services-openclash"] .CodeMirror-merge>.CodeMirror-merge-gap {
|
||||
background-color: rgba(255,255,255,0.12)!important;
|
||||
}
|
||||
|
||||
[data-page^="admin-services-openclash"] .CodeMirror-scroll>.CodeMirror-gutters {
|
||||
background-color: rgba(255,255,255,0.1)!important;
|
||||
border-right: 1px solid #777!important;
|
||||
}
|
||||
|
@ -3439,6 +3414,7 @@ pre.command-output {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* IE hacks */
|
||||
@media all and (-ms-high-contrast: none) {
|
||||
.main > .main-left > .nav > .slide > .menu::before {
|
||||
|
@ -3452,12 +3428,6 @@ pre.command-output {
|
|||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1600px) {
|
||||
.btn:not(button), .label {
|
||||
padding: .5rem .75rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1280px) {
|
||||
.main>.main-left>.nav>li, .main>.main-left>.nav>li>a, .main .main-left .nav>li>a:first-child, .main>.main-left>.nav>.slide>.menu{
|
||||
font-size: var(--font-d);
|
||||
|
@ -3643,7 +3613,7 @@ input[name="ping"], input[name="traceroute"], input[name="nslookup"] {
|
|||
margin: 2.1px 3px;
|
||||
}
|
||||
.cbi-section > h3:first-child, .panel-title {
|
||||
font-size: var(--font-z);
|
||||
font-size: var(--font-d);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
.commandbox {
|
||||
|
@ -3788,7 +3758,7 @@ footer a {
|
|||
display: none
|
||||
}
|
||||
select, input {
|
||||
font-size: var(--font-x);
|
||||
font-size: var(--font-z);
|
||||
box-sizing: border-box;
|
||||
min-width: unset
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
kucat='kucat'
|
||||
[ -s "/etc/config/advancedplus" ] &&kucat='advancedplus'
|
||||
background="$(uci -q get $kucat.@basic[0].background || echo '0')"
|
||||
KUCATTMP="/var/kucat_date_${background}.tmp"
|
||||
BGURL="/www/luci-static/kucat/img/down${background}.jpg"
|
||||
REBGURL="/luci-static/kucat/img/down${background}.jpg"
|
||||
DFBGURL="/luci-static/kucat/img/bg1.jpg"
|
||||
|
@ -77,19 +78,16 @@ bgurl_down() {
|
|||
}
|
||||
|
||||
check_url() {
|
||||
if [ -f "$BGURL" ]; then
|
||||
local bgurltime=$(($(date '+%s') - $(date -r "$BGURL" '+%s' 2>/dev/null || echo '0')))
|
||||
if [ -s "$BGURL" ]; then
|
||||
if [ $bgurltime -le 43200 ]; then
|
||||
echo -ne $REBGURL
|
||||
return
|
||||
if [ -s $KUCATTMP ]; then
|
||||
localtime=`cat $KUCATTMP | grep $(date +%Y%m%d) `
|
||||
if [ $localtime ]; then
|
||||
if [ -s $BGURL ] ; then
|
||||
echo -ne $REBGURL
|
||||
return
|
||||
fi
|
||||
else
|
||||
if [ $bgurltime -le 120 ]; then
|
||||
return
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# local checknet=$(test_url "https://www.baidu.com")
|
||||
checknet=`ping -c 1 -W 1 223.5.5.5 > /dev/null 2>&1 &&echo 1 || echo 2`
|
||||
if [ "x$checknet" == "x1" ]; then
|
||||
bgurl_down
|
||||
|
|
Loading…
Reference in New Issue