Reworked logging system to work with new GUI.
This commit is contained in:
@@ -186,7 +186,7 @@ proc handleAgentCommand*(component: ConsoleComponent, connection: WsConnection,
|
||||
command = getCommandByName(parsedArgs[0])
|
||||
task = createTask(component.agent.agentId, component.agent.listenerId, command, parsedArgs[1..^1])
|
||||
|
||||
connection.sendAgentTask(component.agent.agentId, task)
|
||||
connection.sendAgentTask(component.agent.agentId, input, task)
|
||||
component.addItem(LOG_INFO, fmt"Tasked agent to {command.description.toLowerAscii()} ({Uuid.toString(task.taskId)})")
|
||||
|
||||
except CatchableError:
|
||||
|
||||
@@ -48,12 +48,13 @@ proc sendAgentBuild*(connection: WsConnection, buildInformation: AgentBuildInfor
|
||||
)
|
||||
connection.ws.sendEvent(event, connection.sessionKey)
|
||||
|
||||
proc sendAgentTask*(connection: WsConnection, agentId: string, task: Task) =
|
||||
proc sendAgentTask*(connection: WsConnection, agentId: string, command: string, task: Task) =
|
||||
let event = Event(
|
||||
eventType: CLIENT_AGENT_TASK,
|
||||
timestamp: now().toTime().toUnix(),
|
||||
data: %*{
|
||||
"agentId": agentId,
|
||||
"command": command,
|
||||
"task": task
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user