feat(web,backend,lua,installer): 新增Lua脚本版本管理功能及相关优化

- 升级售票机、检票机内置Lua脚本版本至v1.5.8
- 新增后端配置的lua_versions字段,统一管理售票机、检票机的Lua脚本版本
- 前端新增版本管理配置页面,支持版本号配置和一键补丁升级
- 为售票机、检票机添加远程版本检测功能,屏幕显示版本匹配状态标记
- 简化installer配置交互流程,优化站点代码输入方式
- 重构后端配置规范化处理逻辑,统一配置初始化与存储流程
- 优化售票机外设检测、支付检测逻辑,修复部分已知问题
This commit is contained in:
2026-06-28 16:30:17 +08:00
parent 81debd3b55
commit 07e4200c17
9 changed files with 480 additions and 136 deletions
+4 -23
View File
@@ -35,13 +35,6 @@ local function prompt(label)
return trim(read() or "")
end
local function promptOptionalUrl(label)
local raw = prompt(label)
raw = trim(raw)
if #raw == 0 then return nil end
return raw
end
local function httpGet(url)
if not http then return false, "HTTP API disabled" end
local okReq, err = pcall(function()
@@ -96,27 +89,15 @@ term.setCursorPos(1, 1)
print("Ticket Gate Installer")
print("")
local stationsRaw = prompt("Station codes (comma or slash): ")
local stationCodes = splitCsv(stationsRaw)
if #stationCodes == 0 then
print("No station codes provided.")
local stationCode = trim(prompt("Station code: "))
if #stationCode == 0 then
print("No station code provided.")
return
end
local modeRaw = prompt("Gate mode (entry/exit): ")
local mode = (trim(modeRaw):lower() == "exit") and "exit" or "entry"
local stationCode = prompt("Gate station code (default first code): ")
stationCode = trim(stationCode)
if #stationCode == 0 then stationCode = stationCodes[1] end
print("")
print("Optional server config for ticket / IC card checks.")
local ticketServerUrl = promptOptionalUrl("Ticket check URL (blank=auto): ")
local cardServerUrl = promptOptionalUrl("IC card check URL (blank=same server): ")
local cfg = { mode = mode, station_codes = stationCodes, station_code = stationCode }
if ticketServerUrl then cfg.server_url = ticketServerUrl end
if cardServerUrl then cfg.card_server_url = cardServerUrl end
local cfg = { mode = mode, station_codes = { stationCode }, station_code = stationCode }
local okCfg, cfgJson = pcall(textutils.serializeJSON, cfg)
if not okCfg then
print("Config serialize failed.")