feat: 新增错误问题追踪与管理功能

- 升级程序版本至 v1.5.25
- 新增对比度文本颜色计算与垂直滚动条绘制工具函数,优化选择界面滚动显示
- 网页端新增问题记录管理页面,配套完整的表格与详情展示样式
- 实现issue记录标准化处理、实时事件推送接收与按时间倒序排序展示
- 重构原有选择界面的滚动逻辑,替换为通用滚动条绘制函数
This commit is contained in:
2026-07-29 12:29:54 +08:00
parent 0e8f86b478
commit 7e72bbeae5
5 changed files with 394 additions and 28 deletions
+45 -5
View File
@@ -1,7 +1,7 @@
local DEFAULT_SERVER_BASE = "https://ticket.fse-media.group"
local DEFAULT_SERVER_PATH = "/api/tickets/check"
local GATE_OPEN_SECONDS = 2
local VERSION = "v1.5.26"
local VERSION = "v1.5.27"
local VERSION_CHECK_INTERVAL = 5
local serverURL = nil
@@ -86,9 +86,11 @@ local function stationSetFromList(list)
return set
end
local nativeTerm = (term and type(term.current) == "function" and term.current()) or term
local monitor = peripheral.find("monitor")
local speaker = peripheral.find("speaker")
local inspection = peripheral.find("ticket_inspection_machine")
local monitorSide = nil
local serverConnected = nil
local isUpdating = false
@@ -168,13 +170,49 @@ local function setServerConnected(ok)
serverLastChangeTs = os.epoch("utc")
end
local termDev = term
if monitor then
pcall(monitor.setTextScale, 0.5)
termDev = monitor
local termDev = nativeTerm
if peripheral and type(peripheral.getName) == "function" and monitor then
pcall(function() monitorSide = peripheral.getName(monitor) end)
end
local function refreshDisplayTarget()
local nextMonitor = nil
local nextMonitorSide = monitorSide
if peripheral then
if nextMonitorSide and type(peripheral.isPresent) == "function" and peripheral.isPresent(nextMonitorSide) and type(peripheral.wrap) == "function" then
local okWrap, wrapped = pcall(peripheral.wrap, nextMonitorSide)
if okWrap and wrapped then
nextMonitor = wrapped
end
end
if not nextMonitor and type(peripheral.find) == "function" then
local foundName = nil
local found = peripheral.find("monitor", function(name, wrapped)
foundName = name
nextMonitor = wrapped
return true
end)
if found then
nextMonitor = found
nextMonitorSide = foundName
else
nextMonitorSide = nil
end
end
end
monitor = nextMonitor
monitorSide = nextMonitorSide
if monitor then
pcall(monitor.setTextScale, 0.5)
termDev = monitor
else
termDev = nativeTerm or term
end
return termDev
end
local function clear()
refreshDisplayTarget()
termDev.setBackgroundColor(colors.black)
termDev.setTextColor(colors.white)
termDev.clear()
@@ -1479,6 +1517,8 @@ local function mainLoop()
processInspectionEvent(ev[1], ev)
os.sleep(0.35)
drawReadyScreen()
elseif ev[1] == "peripheral" or ev[1] == "peripheral_detach" or ev[1] == "monitor_resize" or ev[1] == "config_updated" then
pcall(drawReadyScreen)
end
end
end