This commit is contained in:
kepler155c
2018-11-15 12:17:50 -05:00
parent 560b9e42c9
commit 3e756abe42
10 changed files with 118 additions and 95 deletions

View File

@@ -145,20 +145,10 @@ function page:refresh()
end
function page:update()
if context.storage:isOnline() then
page:refresh()
page:sync()
else
page.grid:clear()
page.grid:centeredWrite(math.ceil(page.height / 2), 'Storage Offline')
page:sync()
end
page:refresh()
page:sync()
end
Event.on({ 'storage_offline', 'storage_online' }, function()
page:update()
end)
Event.on('monitor_touch', function(_, side)
if side == monitor.adapter.side then
page:reset()
@@ -166,6 +156,7 @@ Event.on('monitor_touch', function(_, side)
end
end)
page:enable()
page:draw()
page:sync()