feat(web,backend,lua,installer): 新增Lua脚本版本管理功能及相关优化
- 升级售票机、检票机内置Lua脚本版本至v1.5.8 - 新增后端配置的lua_versions字段,统一管理售票机、检票机的Lua脚本版本 - 前端新增版本管理配置页面,支持版本号配置和一键补丁升级 - 为售票机、检票机添加远程版本检测功能,屏幕显示版本匹配状态标记 - 简化installer配置交互流程,优化站点代码输入方式 - 重构后端配置规范化处理逻辑,统一配置初始化与存储流程 - 优化售票机外设检测、支付检测逻辑,修复部分已知问题
This commit is contained in:
+7
-26
@@ -34,13 +34,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()
|
||||
@@ -99,10 +92,9 @@ term.setCursorPos(1, 1)
|
||||
print("Bidirectional 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
|
||||
|
||||
@@ -112,30 +104,19 @@ local frontRaw = prompt("Front mode (entry/exit): ")
|
||||
local backRaw = prompt("Back mode (entry/exit): ")
|
||||
local frontMode = normalizeMode(frontRaw)
|
||||
local backMode = normalizeMode(backRaw)
|
||||
local frontStationCode = trim(prompt("Front station code (default first code): "))
|
||||
local backStationCode = trim(prompt("Back station code (default first code): "))
|
||||
if #frontStationCode == 0 then frontStationCode = stationCodes[1] end
|
||||
if #backStationCode == 0 then backStationCode = 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 = {
|
||||
station_codes = stationCodes,
|
||||
station_code = stationCodes[1],
|
||||
station_codes = { stationCode },
|
||||
station_code = stationCode,
|
||||
side_modes = {
|
||||
front = frontMode,
|
||||
back = backMode,
|
||||
},
|
||||
side_station_codes = {
|
||||
front = frontStationCode,
|
||||
back = backStationCode,
|
||||
front = stationCode,
|
||||
back = stationCode,
|
||||
}
|
||||
}
|
||||
if ticketServerUrl then cfg.server_url = ticketServerUrl end
|
||||
if cardServerUrl then cfg.card_server_url = cardServerUrl end
|
||||
local okCfg, cfgJson = pcall(textutils.serializeJSON, cfg)
|
||||
if not okCfg then
|
||||
print("Config serialize failed.")
|
||||
|
||||
Reference in New Issue
Block a user