simplify ui

This commit is contained in:
kepler155c@gmail.com
2017-10-11 11:37:52 -04:00
parent 05c99b583a
commit 852ad193f0
11 changed files with 260 additions and 291 deletions

View File

@@ -34,6 +34,7 @@ local page = UI.Page {
UI.MenuBar.spacer,
{ text = 'Reboot r', event = 'reboot' },
} },
{ text = 'Chat', event = 'chat' },
{ text = 'Trust', dropdown = {
{ text = 'Establish', event = 'trust' },
{ text = 'Remove', event = 'untrust' },
@@ -81,7 +82,7 @@ end
function page:eventHandler(event)
local t = self.grid:getSelected()
if t then
if event.type == 'telnet' or event.type == 'grid_select' then
if event.type == 'telnet' then
multishell.openTab({
path = 'sys/apps/telnet.lua',
focused = true,
@@ -108,6 +109,13 @@ function page:eventHandler(event)
trustList[t.id] = nil
Util.writeTable('usr/.known_hosts', trustList)
elseif event.type == 'chat' then
multishell.openTab({
path = 'sys/apps/shell',
args = { 'chat join opusChat-' .. t.id .. ' guest'},
title = 'Chatroom',
focused = true,
})
elseif event.type == 'reboot' then
sendCommand(t.id, 'reboot')