Created template files for core views.
This commit is contained in:
@@ -1,124 +1,68 @@
|
|||||||
[Window][Conquest]
|
|
||||||
Size=2868,1695
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Dear ImGui Demo]
|
|
||||||
Pos=956,43
|
|
||||||
Size=942,946
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000002,0
|
|
||||||
|
|
||||||
[Window][Debug##Default]
|
|
||||||
Pos=1005,292
|
|
||||||
Size=383,470
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Example: Documents]
|
|
||||||
Pos=0,33
|
|
||||||
Size=1050,966
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000003,0
|
|
||||||
|
|
||||||
[Window][Dear ImGui Style Editor]
|
|
||||||
Pos=1346,33
|
|
||||||
Size=562,966
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000004,0
|
|
||||||
|
|
||||||
[Window][Example: Assets Browser]
|
|
||||||
Pos=956,43
|
|
||||||
Size=942,460
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000009,0
|
|
||||||
|
|
||||||
[Window][Example: Long text display]
|
|
||||||
Pos=60,60
|
|
||||||
Size=520,600
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/ResizableChild_478B81A3]
|
|
||||||
IsChild=1
|
|
||||||
Size=1857,115
|
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/Red_BEEF922B]
|
|
||||||
IsChild=1
|
|
||||||
Size=200,100
|
|
||||||
|
|
||||||
[Window][Info Window]
|
|
||||||
Pos=953,33
|
|
||||||
Size=955,410
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000005,0
|
|
||||||
|
|
||||||
[Window][INFORMATION]
|
|
||||||
Pos=953,34
|
|
||||||
Size=1914,403
|
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000007,0
|
|
||||||
|
|
||||||
[Window][Dockspace]
|
[Window][Dockspace]
|
||||||
Pos=0,0
|
Pos=0,0
|
||||||
Size=1908,999
|
Size=1908,999
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/##Basket_87771727]
|
[Window][Debug##Default]
|
||||||
IsChild=1
|
Pos=60,60
|
||||||
Size=878,540
|
Size=400,400
|
||||||
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/##Basket_529977C1]
|
[Window][Dear ImGui Demo]
|
||||||
IsChild=1
|
Pos=10,43
|
||||||
Size=878,540
|
Size=1187,946
|
||||||
|
Collapsed=0
|
||||||
[Window][Dear ImGui Demo/##Basket_8B4CCC3E]
|
DockId=0x00000003,1
|
||||||
IsChild=1
|
|
||||||
Size=878,540
|
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/0_E1BADA21]
|
|
||||||
IsChild=1
|
|
||||||
Size=414,540
|
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/##Basket_956142B6]
|
|
||||||
IsChild=1
|
|
||||||
Size=878,540
|
|
||||||
|
|
||||||
[Window][Agents [Table View]]
|
[Window][Agents [Table View]]
|
||||||
Pos=10,43
|
Pos=10,43
|
||||||
Size=944,946
|
Size=1187,946
|
||||||
Collapsed=0
|
|
||||||
DockId=0x00000001,0
|
|
||||||
|
|
||||||
[Window][Example: Console]
|
|
||||||
Pos=1019,231
|
|
||||||
Size=520,600
|
|
||||||
Collapsed=0
|
|
||||||
|
|
||||||
[Window][Example: Custom rendering]
|
|
||||||
Pos=862,167
|
|
||||||
Size=623,582
|
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
DockId=0x00000003,0
|
||||||
|
|
||||||
[Window][Agents [Graph View]]
|
[Window][Agents [Graph View]]
|
||||||
Pos=10,43
|
Pos=10,43
|
||||||
Size=944,946
|
Size=1888,473
|
||||||
|
Collapsed=0
|
||||||
|
DockId=0x00000003,1
|
||||||
|
|
||||||
|
[Window][Eventlog]
|
||||||
|
Pos=1199,43
|
||||||
|
Size=699,946
|
||||||
|
Collapsed=0
|
||||||
|
DockId=0x00000004,0
|
||||||
|
|
||||||
|
[Window][Example: Assets Browser]
|
||||||
|
Pos=60,60
|
||||||
|
Size=800,480
|
||||||
|
Collapsed=0
|
||||||
|
|
||||||
|
[Window][Example: Console]
|
||||||
|
Pos=60,60
|
||||||
|
Size=520,600
|
||||||
|
Collapsed=0
|
||||||
|
|
||||||
|
[Window][Example: Log]
|
||||||
|
Pos=171,222
|
||||||
|
Size=1150,550
|
||||||
|
Collapsed=0
|
||||||
|
|
||||||
|
[Window][Dear ImGui Debug Log]
|
||||||
|
Pos=60,60
|
||||||
|
Size=1088,486
|
||||||
|
Collapsed=0
|
||||||
|
|
||||||
|
[Window][Dear ImGui Metrics/Debugger]
|
||||||
|
Pos=60,60
|
||||||
|
Size=564,669
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000001,0
|
|
||||||
|
|
||||||
[Table][0xB6880529,2]
|
[Table][0xB6880529,2]
|
||||||
RefScale=27
|
RefScale=27
|
||||||
Column 0 Sort=0v
|
Column 0 Sort=0v
|
||||||
|
|
||||||
[Docking][Data]
|
[Docking][Data]
|
||||||
DockSpace ID=0x1A591E13 Pos=1,34 Size=2866,1660 Split=Y
|
DockSpace ID=0x85940918 Window=0x260A4489 Pos=10,43 Size=1888,946 Split=X
|
||||||
DockNode ID=0x00000005 Parent=0x1A591E13 SizeRef=955,410 Selected=0x7DB93FD0
|
DockNode ID=0x00000003 Parent=0x85940918 SizeRef=1187,473 CentralNode=1 Selected=0x5E5F7166
|
||||||
DockNode ID=0x00000006 Parent=0x1A591E13 SizeRef=955,554 CentralNode=1 Selected=0x5E5F7166
|
DockNode ID=0x00000004 Parent=0x85940918 SizeRef=699,473 Selected=0x0FA43D88
|
||||||
DockSpace ID=0x3674675E Pos=0,33 Size=2868,1662 Split=X Selected=0x5E5F7166
|
|
||||||
DockNode ID=0x00000003 Parent=0x3674675E SizeRef=0,0 CentralNode=1 Selected=0x5E5F7166
|
|
||||||
DockNode ID=0x00000004 Parent=0x3674675E SizeRef=562,966 Selected=0x3EEA4247
|
|
||||||
DockSpace ID=0x85940918 Window=0x260A4489 Pos=10,43 Size=1888,946 Split=Y
|
|
||||||
DockNode ID=0x00000009 Parent=0x85940918 SizeRef=1868,460 Selected=0xB38EC866
|
|
||||||
DockNode ID=0x0000000A Parent=0x85940918 SizeRef=1868,464 Split=Y
|
|
||||||
DockNode ID=0x00000007 Parent=0x0000000A SizeRef=954,403 Selected=0x526650BD
|
|
||||||
DockNode ID=0x00000008 Parent=0x0000000A SizeRef=954,559 Split=X Selected=0xB38EC866
|
|
||||||
DockNode ID=0x00000001 Parent=0x00000008 SizeRef=944,484 CentralNode=1 Selected=0xB38EC866
|
|
||||||
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=942,484 Selected=0x5E5F7166
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import tables
|
import tables
|
||||||
import ./utils/appImGui
|
import ./utils/appImGui
|
||||||
import ./views/[dockspace, agents]
|
import ./views/[dockspace, agents, listeners, eventlog]
|
||||||
|
|
||||||
proc main() =
|
proc main() =
|
||||||
var app = createApp(1024, 800, imnodes = true, title = "Conquest", docking = true)
|
var app = createApp(1024, 800, imnodes = true, title = "Conquest", docking = true)
|
||||||
@@ -11,9 +11,13 @@ proc main() =
|
|||||||
showConquest = true
|
showConquest = true
|
||||||
showAgentsTable = true
|
showAgentsTable = true
|
||||||
showAgentsGraph = false
|
showAgentsGraph = false
|
||||||
|
showListeners = false
|
||||||
|
showEventlog = true
|
||||||
|
|
||||||
views["Agents [Table View]"] = addr showAgentsTable
|
views["Agents [Table View]"] = addr showAgentsTable
|
||||||
views["Agents [Graph View]"] = addr showAgentsGraph
|
views["Agents [Graph View]"] = addr showAgentsGraph
|
||||||
|
views["Listeners"] = addr showListeners
|
||||||
|
views["Eventlog"] = addr showEventlog
|
||||||
|
|
||||||
let io = igGetIO()
|
let io = igGetIO()
|
||||||
|
|
||||||
@@ -26,15 +30,13 @@ proc main() =
|
|||||||
continue
|
continue
|
||||||
newFrame()
|
newFrame()
|
||||||
|
|
||||||
# UI components
|
# UI components/views
|
||||||
Dockspace().draw(addr showConquest, views)
|
Dockspace().draw(addr showConquest, views)
|
||||||
|
|
||||||
if showAgentsTable:
|
if showAgentsTable: AgentsTable("Agents [Table View]").draw(addr showAgentsTable)
|
||||||
AgentsTable("Agents [Table View]").draw(addr showAgentsTable)
|
if showAgentsGraph: AgentsTable("Agents [Graph View]").draw(addr showAgentsGraph)
|
||||||
|
if showListeners: ListenersTable("Listeners").draw(addr showListeners)
|
||||||
if showAgentsGraph:
|
if showEventlog:Eventlog("Eventlog").draw(addr showEventlog)
|
||||||
AgentsTable("Agents [Graph View]").draw(addr showAgentsGraph)
|
|
||||||
|
|
||||||
|
|
||||||
igShowDemoWindow(nil)
|
igShowDemoWindow(nil)
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ proc AgentsTable*(title: string): AgentsTableComponent =
|
|||||||
result.agents = exampleAgents
|
result.agents = exampleAgents
|
||||||
|
|
||||||
proc draw*(component: AgentsTableComponent, showComponent: ptr bool) =
|
proc draw*(component: AgentsTableComponent, showComponent: ptr bool) =
|
||||||
|
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
|
||||||
igBegin(component.title, showComponent, 0)
|
igBegin(component.title, showComponent, 0)
|
||||||
defer: igEnd()
|
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