package templates import ( "converge/pkg/models" "strconv" "time" _ "time/tzdata" ) templ Sessions(state *models.State, loc *time.Location) {

sessions

if state != nil { @State(state, loc) } else { Loading... }
} templ State(state *models.State, location *time.Location) {

agents

if len(state.Agents) == 0 {

-

} else { for _, agent := range state.Agents { }
# start time expiry time username host OS shell
{agent.GeneratedId} {agent.StartTime.In(location).Format(time.DateTime)} {agent.ExpiryTime.In(location).Format(time.DateTime)} {agent.AgentInfo.Username} {agent.AgentInfo.Hostname} {agent.AgentInfo.OS} {agent.AgentInfo.Shell}
}

clients

if len(state.Clients) == 0 {

-

} else { for _, client := range state.Clients { }
agent# id start time session type
{client.AgentId} {strconv.Itoa(client.ClientId)} {client.StartTime.In(location).Format(time.DateTime)} {client.SessionType}
}
} templ SessionsTab(state *models.State, loc *time.Location) { @BasePage(4) { @Sessions(state, loc) } }