Implemented right-click context menu on session table to create console windows for interacting with the agent.

This commit is contained in:
Jakob Friedl
2025-09-10 18:25:15 +02:00
parent 5f131ae916
commit 8968c797ac
4 changed files with 161 additions and 37 deletions

View File

@@ -0,0 +1,25 @@
import strformat
import imguin/[cimgui, glfw_opengl, simple]
import ../utils/appImGui
import ../../common/[types]
type
ConsoleComponent* = ref object of RootObj
agent: Agent
showConsole*: bool
proc Console*(agent: Agent): ConsoleComponent =
result = new ConsoleComponent
result.agent = agent
result.showConsole = true
proc draw*(component: ConsoleComponent) =
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
# var showComponent = component.showConsole
igBegin(fmt"[{component.agent.agentId}] {component.agent.username}@{component.agent.hostname}", addr component.showConsole, 0)
defer: igEnd()
igText(component.agent.agentId)
# component.showConsole = showComponent