Created template files for core views.

This commit is contained in:
Jakob Friedl
2025-09-06 14:12:51 +02:00
parent d834e4f713
commit 87059ced4c
5 changed files with 113 additions and 111 deletions

View File

@@ -52,6 +52,7 @@ proc AgentsTable*(title: string): AgentsTableComponent =
result.agents = exampleAgents
proc draw*(component: AgentsTableComponent, showComponent: ptr bool) =
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
igBegin(component.title, showComponent, 0)
defer: igEnd()

View File

@@ -0,0 +1,19 @@
import times
import imguin/[cimgui, glfw_opengl, simple]
import ../utils/appImGui
import ../../common/[types]
type
EventlogComponent = ref object of RootObj
title: string
proc Eventlog*(title: string): EventlogComponent =
result = new EventlogComponent
result.title = title
proc draw*(component: EventlogComponent, showComponent: ptr bool) =
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
igBegin(component.title, showComponent, 0)
defer: igEnd()
igText("Eventlog")

View File

@@ -0,0 +1,36 @@
import times
import imguin/[cimgui, glfw_opengl, simple]
import ../utils/appImGui
import ../../common/[types]
type
ListenersTableComponent = ref object of RootObj
title: string
listeners: seq[Listener]
let exampleListeners: seq[Listener] = @[
Listener(
listenerId: "L1234567",
address: "192.168.1.1",
port: 8080,
protocol: HTTP
),
Listener(
listenerId: "L7654321",
address: "10.0.0.2",
port: 443,
protocol: HTTP
)
]
proc ListenersTable*(title: string): ListenersTableComponent =
result = new ListenersTableComponent
result.title = title
result.listeners = exampleListeners
proc draw*(component: ListenersTableComponent, showComponent: ptr bool) =
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
igBegin(component.title, showComponent, 0)
defer: igEnd()
igText("Listeners")