修改了一些东西

This commit is contained in:
2026-07-10 11:33:37 +08:00
parent fa2457ce7f
commit d2809c4d6d
9 changed files with 166 additions and 50 deletions
+6 -16
View File
@@ -1,6 +1,6 @@
local CURRENT_STATION_CODE = 'Ticket-Machine'
local API_BASE = 'http://ticket.fse-media.group/api'
local VERSION = 'v1.5.11'
local VERSION = 'v1.5.12'
-- ###########################
-- Core HTTP & JSON Utilities
@@ -239,10 +239,7 @@ local function firstNumber(...)
end
local function currentDeviceId()
local dev = nil
if os.getComputerLabel then dev = os.getComputerLabel() end
if not dev and os.getComputerID then dev = tostring(os.getComputerID()) end
return tostring(dev or 'unknown')
return 'ticket_machine'
end
local function normalizeTrainTypeLabel(v)
@@ -658,10 +655,6 @@ local function backgroundSyncTask()
sleep(5)
pcall(refreshConfigOnce)
if versionMismatch == true then
pcall(function()
clear()
centerText(math.floor(h/2), "Auto Updating...", colors.yellow)
end)
pcall(function()
if shell and type(shell.run) == "function" then
shell.run("update_machine.lua")
@@ -669,7 +662,7 @@ local function backgroundSyncTask()
os.run(getfenv and getfenv() or _ENV, "update_machine.lua")
end
end)
os.reboot()
-- Removed os.reboot() to prevent interrupting user unexpectedly
end
end
end
@@ -963,9 +956,7 @@ local function waitButtons()
end
end
elseif ev == 'config_updated' then
singleSegments = nil
-- If config was updated in background, return to force UI re-render
return
-- Ignore config_updated while waiting for buttons, to prevent interrupting user's selection
end
end
end
@@ -1211,10 +1202,9 @@ local function buildSingleSegments()
end
local function showSingleSegmentSelection()
singleSegments = buildSingleSegments()
singleSegmentScroll = 0
while state.page == 'single_segment' do
if not singleSegments or #singleSegments == 0 then
singleSegments = buildSingleSegments()
end
drawHeader('Select Single Segment', 'Select a line and fare')
Buttons = {}
local itemsPerPage = math.floor((h - 10) / 4) * 2