mirror of
https://github.com/kepler155c/opus
synced 2025-01-03 20:30:28 +00:00
Show serialized packet in packetGrid
This commit is contained in:
parent
f1b9dcc4f4
commit
ae2ea81d1d
@ -13,7 +13,7 @@ table.insert(gridColumns, { heading = '#', key = 'id', width = 5, align = 'righ
|
||||
table.insert(gridColumns, { heading = 'Port', key = 'portid', width = 5, align = 'right' })
|
||||
table.insert(gridColumns, { heading = 'Reply', key = 'replyid', width = 5, align = 'right' })
|
||||
if UI.defaultDevice.width > 50 then table.insert(gridColumns, { heading = 'Dist', key = 'distance', width = 6, align = 'right' }) end
|
||||
table.insert(gridColumns, { heading = 'Msg', key = 'message' })
|
||||
table.insert(gridColumns, { heading = 'Msg', key = 'packetStr' })
|
||||
|
||||
local page = UI.Page {
|
||||
paused = false,
|
||||
@ -269,6 +269,8 @@ end
|
||||
function page.packetGrid:addPacket(packet)
|
||||
if not page.paused and (not filterConfig.filterAllCheck.value or filterConfig.filterGrid.values[packet.portid]) then
|
||||
page.index = page.index + 1
|
||||
local p, res = pcall(textutils.serialize, packet.message)
|
||||
packet.packetStr = res:gsub("\n%s*", "")
|
||||
table.insert(self.values, packet)
|
||||
end
|
||||
if #self.values > self.maxPacket then
|
||||
|
Loading…
Reference in New Issue
Block a user