1
0
mirror of https://github.com/kepler155c/opus synced 2025-11-01 08:03:00 +00:00

ui improvements

This commit is contained in:
kepler155c@gmail.com
2017-10-03 00:50:54 -04:00
parent c0baa00668
commit 8e381d3ebf
10 changed files with 393 additions and 228 deletions

View File

@@ -26,7 +26,6 @@ local function snmpConnection(socket)
socket:write('pong')
elseif msg.type == 'script' then
local fn, msg = loadstring(msg.args, 'script')
if fn then
multishell.openTab({
@@ -38,6 +37,21 @@ local function snmpConnection(socket)
printError(msg)
end
elseif msg.type == 'scriptEx' then
local s, m = pcall(function()
local env = setmetatable(Util.shallowCopy(getfenv(1)), { __index = _G })
local fn, m = load(msg.args, 'script', nil, env)
if not fn then
error(m)
end
return { fn() }
end)
if s then
socket:write(m)
else
socket:write({ s, m })
end
elseif msg.type == 'gps' then
if gpsRequested then
repeat