Implemented right-click context menu on session table to create console windows for interacting with the agent.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import tables
|
||||
import ./utils/appImGui
|
||||
import ./views/[dockspace, sessions, listeners, eventlog]
|
||||
import ./views/[dockspace, sessions, listeners, eventlog, console]
|
||||
|
||||
proc main() =
|
||||
var app = createApp(1024, 800, imnodes = true, title = "Conquest", docking = true)
|
||||
@@ -13,6 +13,7 @@ proc main() =
|
||||
showSessionsGraph = false
|
||||
showListeners = false
|
||||
showEventlog = true
|
||||
consoles: Table[string, ConsoleComponent]
|
||||
|
||||
views["Sessions [Table View]"] = addr showSessionsTable
|
||||
views["Sessions [Graph View]"] = addr showSessionsGraph
|
||||
@@ -22,12 +23,10 @@ proc main() =
|
||||
# Create components
|
||||
var
|
||||
dockspace = Dockspace()
|
||||
sessionsTable = SessionsTable("Sessions [Table View]")
|
||||
sessionsGraph = SessionsTable("Sessions [Graph View]")
|
||||
sessionsTable = SessionsTable("Sessions [Table View]", addr consoles)
|
||||
listenersTable = ListenersTable("Listeners")
|
||||
eventlog = Eventlog("Eventlog")
|
||||
|
||||
|
||||
let io = igGetIO()
|
||||
|
||||
# main loop
|
||||
@@ -45,6 +44,17 @@ proc main() =
|
||||
if showListeners: listenersTable.draw(addr showListeners)
|
||||
if showEventlog: eventlog.draw(addr showEventlog)
|
||||
|
||||
# Show console windows
|
||||
var newConsoleTable: Table[string, ConsoleComponent]
|
||||
for agentId, console in consoles.mpairs():
|
||||
if console.showConsole:
|
||||
console.draw()
|
||||
newConsoleTable[agentId] = console
|
||||
|
||||
# Update the consoles table with only those sessions that have not been closed yet
|
||||
# This is done to ensure that closed console windows can be opened again
|
||||
consoles = newConsoleTable
|
||||
|
||||
igShowDemoWindow(nil)
|
||||
|
||||
# render
|
||||
|
||||
Reference in New Issue
Block a user