Created template files for core views.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
19
src/client/views/eventlog.nim
Normal file
19
src/client/views/eventlog.nim
Normal 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")
|
||||
36
src/client/views/listeners.nim
Normal file
36
src/client/views/listeners.nim
Normal 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")
|
||||
Reference in New Issue
Block a user