Implemented displaying latest checkin in agents table, as well as word-wrap.

This commit is contained in:
Jakob Friedl
2025-05-23 13:55:00 +02:00
parent 6f9e20566d
commit 5ab9cd302c
10 changed files with 155 additions and 59 deletions

View File

@@ -1,6 +1,8 @@
import prompt
import prologue
import tables
import times
import terminal
#[
Agent types & procs
@@ -54,10 +56,10 @@ type
sleep*: int
jitter*: float
tasks*: seq[Task]
firstCheckin*: string
lastCheckin*: string
firstCheckin*: DateTime
latestCheckin*: DateTime
proc newAgent*(name, listener, firstCheckin: string, postData: AgentRegistrationData): Agent =
proc newAgent*(name, listener: string, firstCheckin: DateTime, postData: AgentRegistrationData): Agent =
var agent = new Agent
agent.name = name
agent.listener = listener
@@ -73,6 +75,7 @@ proc newAgent*(name, listener, firstCheckin: string, postData: AgentRegistration
agent.jitter = 0.2
agent.tasks = @[]
agent.firstCheckin = firstCheckin
agent.latestCheckin = firstCheckin
return agent