feat: 添加强制更新Lua脚本的配置并优化前端更新按钮

新增配置API的force_update字段返回与保存支持,更新终端Lua脚本逻辑以支持强制更新标记,同时简化前端更新按钮,移除模拟进度条并动态切换按钮状态与显示文本。
This commit is contained in:
2026-07-10 23:38:03 +08:00
parent 78f302381a
commit 8a78034ad3
6 changed files with 16 additions and 25 deletions
+3 -3
View File
@@ -89,10 +89,9 @@ local speaker = peripheral.find("speaker")
local inspection = peripheral.find("ticket_inspection_machine")
local serverConnected = nil
local serverLastChangeTs = 0
local expectedGateVersion = nil
local versionMismatch = nil
local pendingGateUpdate = false
local remoteForceUpdate = false
local isUpdating = false
local gateBusyUntilTs = 0
@@ -395,6 +394,7 @@ local function refreshRemoteLuaVersion(serverBase)
local ok, parsed = getJSON(url)
if not ok or type(parsed) ~= "table" then return false end
local remote = normalizeVersionTag(type(parsed.lua_versions) == "table" and parsed.lua_versions.gate or nil)
remoteForceUpdate = (parsed.force_update == true)
if #remote == 0 then
expectedGateVersion = nil
versionMismatch = nil
@@ -1427,7 +1427,7 @@ while true do
pcall(function()
refreshRemoteLuaVersion(guessBaseFromStatusURL(serverURL))
end)
if type(cfg) == "table" and type(cfg.force_update) == "boolean" and cfg.force_update == true and versionMismatch == true then
if remoteForceUpdate and versionMismatch == true then
pendingGateUpdate = true
end