From 44974c412f82e8ff9fb2ce935e7fc5227c629546 Mon Sep 17 00:00:00 2001 From: SunBK201 Date: Thu, 4 Dec 2025 14:57:40 +0800 Subject: [PATCH] feat: add version update check --- openwrt/files/luci/model/cbi/ua3f.lua | 18 ++++++-- openwrt/files/luci/view/ua3f/version.htm | 59 ++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 openwrt/files/luci/view/ua3f/version.htm diff --git a/openwrt/files/luci/model/cbi/ua3f.lua b/openwrt/files/luci/model/cbi/ua3f.lua index 318944d..c60c84b 100644 --- a/openwrt/files/luci/model/cbi/ua3f.lua +++ b/openwrt/files/luci/model/cbi/ua3f.lua @@ -3,14 +3,22 @@ local i18n = require("luci.i18n") local translate = i18n.translate local NamedSection = cbi.NamedSection -local ua3f = cbi.Map("ua3f", - "UA3F", - [[ - Version: 2.0.0 +local function load_version_desc() + local fs = require("nixio.fs") + local content = fs.readfile("/usr/lib/lua/luci/view/ua3f/version.htm") + if content then + return content + end + -- Fallback if file not found + return [[ + GitHub
Across the Campus we can reach every corner in the world. ]] -) +end + +local ua3f = cbi.Map("ua3f", "UA3F", load_version_desc()) + local status = require("luci.model.cbi.ua3f.status") local general = require("luci.model.cbi.ua3f.general") local rule = require("luci.model.cbi.ua3f.rule") diff --git a/openwrt/files/luci/view/ua3f/version.htm b/openwrt/files/luci/view/ua3f/version.htm new file mode 100644 index 0000000..d1c3988 --- /dev/null +++ b/openwrt/files/luci/view/ua3f/version.htm @@ -0,0 +1,59 @@ + + + Version: 2.0.0 + + + +
+Across the Campus we can reach every corner in the world. + + \ No newline at end of file