phase out peripheral.lookup

This commit is contained in:
kepler155c@gmail.com 2019-03-08 16:47:39 -05:00
parent a9d03b06e9
commit 6f7e27827e
3 changed files with 8 additions and 14 deletions

View File

@ -12,7 +12,7 @@ function Proxy.create(remoteId, uri)
socket.co = coroutine.running()
socket:write(uri)
local methods = socket:read() or error('Timed out')
local methods = socket:read(2) or error('Timed out')
local hijack = { }
for _,method in pairs(methods) do

View File

@ -6,7 +6,6 @@ local Util = require('util')
local colors = _G.colors
local device = _G.device
local multishell = _ENV.multishell
local network = _G.network
local os = _G.os
local shell = _ENV.shell
@ -178,19 +177,10 @@ function page:eventHandler(event)
local t = self.grid:getSelected()
if t then
if event.type == 'telnet' then
multishell.openTab({
path = 'sys/apps/telnet.lua',
focused = true,
args = { t.id },
title = t.label,
})
shell.openForegroundTab('telnet ' .. t.id)
elseif event.type == 'vnc' then
multishell.openTab({
path = 'sys/apps/vnc.lua',
focused = true,
args = { t.id },
title = t.label,
})
shell.openForegroundTab('vnc.lua ' .. t.id)
os.queueEvent('overview_shortcut', {
title = t.label,
category = "VNC",
@ -199,6 +189,7 @@ function page:eventHandler(event)
\031e\\/\031 \0319c",
run = "vnc.lua " .. t.id,
})
elseif event.type == 'clear' then
Util.clear(network)
page.grid:update()

View File

@ -11,6 +11,7 @@ local function getProxy(path)
break
end
end
return proxy
end
Event.addRoutine(function()
@ -27,6 +28,7 @@ Event.addRoutine(function()
if not api then
print('proxy: invalid API')
socket:close()
return
end
@ -52,6 +54,7 @@ Event.addRoutine(function()
_G.printError(m)
end
end
socket:close()
end)
end
end)