From 3562b6d53a9b6ff2d6b21eeeb7aa5d4f7b48f1b4 Mon Sep 17 00:00:00 2001 From: kenzok8 Date: Tue, 19 Nov 2024 09:38:06 +0800 Subject: [PATCH] update 2024-11-19 09:38:06 --- luci-app-nekobox/Makefile | 2 +- luci-app-nekobox/htdocs/nekobox/assets/img/curent.svg | 8 ++++---- luci-app-nekobox/htdocs/nekobox/fetch_logs.php | 4 ++++ luci-app-nekobox/htdocs/nekobox/ping.php | 5 ++++- luci-app-nekobox/root/etc/neko/core/neko | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/luci-app-nekobox/Makefile b/luci-app-nekobox/Makefile index c60d046dff8..f8d46d91374 100644 --- a/luci-app-nekobox/Makefile +++ b/luci-app-nekobox/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_MAINTAINER:=Thaolga PKG_NAME:=luci-app-nekobox -PKG_VERSION:=1.5.2 +PKG_VERSION:=1.5.3 PKG_RELEASE:=cn PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/luci-app-nekobox/htdocs/nekobox/assets/img/curent.svg b/luci-app-nekobox/htdocs/nekobox/assets/img/curent.svg index c8e9770b5c4..135380da77d 100644 --- a/luci-app-nekobox/htdocs/nekobox/assets/img/curent.svg +++ b/luci-app-nekobox/htdocs/nekobox/assets/img/curent.svg @@ -1,5 +1,5 @@ - - Current Version: v1.5.2 + + Current Version: v1.5.3 @@ -15,7 +15,7 @@ Current Version - - v1.5.2 + + v1.5.3 \ No newline at end of file diff --git a/luci-app-nekobox/htdocs/nekobox/fetch_logs.php b/luci-app-nekobox/htdocs/nekobox/fetch_logs.php index c8392c0cc1d..f40a32f87f0 100644 --- a/luci-app-nekobox/htdocs/nekobox/fetch_logs.php +++ b/luci-app-nekobox/htdocs/nekobox/fetch_logs.php @@ -13,12 +13,16 @@ $file = $_GET['file'] ?? ''; $max_lines = 100; $max_chars = 1000000; +$max_line_length = 300; if (array_key_exists($file, $allowed_files)) { $file_path = $allowed_files[$file]; if (file_exists($file_path)) { $lines = file($file_path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + $lines = array_filter($lines, function($line) use ($max_line_length) { + return strlen($line) <= $max_line_length; + }); $content = implode(PHP_EOL, $lines); diff --git a/luci-app-nekobox/htdocs/nekobox/ping.php b/luci-app-nekobox/htdocs/nekobox/ping.php index 6a183bb8101..d28dda01b6a 100644 --- a/luci-app-nekobox/htdocs/nekobox/ping.php +++ b/luci-app-nekobox/htdocs/nekobox/ping.php @@ -696,11 +696,14 @@ function clearOldCache() { document.getElementById('d-ip').innerHTML = simpleDisplay; document.getElementById('ipip').innerHTML = locationInfo; - $("#flag").attr("src", _IMG + "flags/" + (data.country_code || 'unknown').toLowerCase() + ".png"); + const countryCode = data.country_code || 'unknown'; + const flagSrc = (countryCode !== 'unknown') ? _IMG + "flags/" + countryCode.toLowerCase() + ".png" : './assets/neko/flags/mo.png'; + $("#flag").attr("src", flagSrc); } catch (error) { console.error("Error in updateUI:", error); document.getElementById('d-ip').innerHTML = "更新 IP 信息失败"; + $("#flag").attr("src", "./assets/neko/flags/mo.png"); } }, diff --git a/luci-app-nekobox/root/etc/neko/core/neko b/luci-app-nekobox/root/etc/neko/core/neko index 34789e62d07..afbb95bda2d 100644 --- a/luci-app-nekobox/root/etc/neko/core/neko +++ b/luci-app-nekobox/root/etc/neko/core/neko @@ -31,7 +31,7 @@ url_core="https://github.com/Thaolga/neko/releases/download/core_neko" url_geo="https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest" neko_ver(){ - neko_version="1.5.2" + neko_version="1.5.3" } logs() {