Skip to content

Commit

Permalink
Minor fix of event command
Browse files Browse the repository at this point in the history
  • Loading branch information
royroyee committed Feb 3, 2024
1 parent aadf961 commit 0b93b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
6 changes: 2 additions & 4 deletions api/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ func GetEventList(ac *client.AlpaconClient, pageSize int, serverName string, use
}
}

url := buildURL(serverID, userID, pageSize)

responseBody, err := ac.SendGetRequest(url)
responseBody, err := ac.SendGetRequest(buildURL(serverID, userID, pageSize))
if err != nil {
return nil, err
}
Expand All @@ -51,7 +49,7 @@ func GetEventList(ac *client.AlpaconClient, pageSize int, serverName string, use
Shell: event.Shell,
Command: event.Line,
Result: utils.TruncateString(event.Result, 70),
Status: event.Success,
Status: utils.BoolPointerToString(event.Success),

Check failure on line 52 in api/event/event.go

View workflow job for this annotation

GitHub Actions / Build and Test

undefined: utils.BoolPointerToString
Operator: event.RequestedByName,
RequestedAt: utils.TimeUtils(event.AddedAt),
})
Expand Down
16 changes: 2 additions & 14 deletions api/event/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type EventAttributes struct {
Shell string `json:"shell"`
Command string `json:"command"`
Result string `json:"result"`
Status bool `json:"status"`
Status string `json:"status"`
Operator string `json:"operator"`
RequestedAt string `json:"requested_at"`
}
Expand All @@ -25,7 +25,7 @@ type EventDetails struct {
ID string `json:"id"`
Shell string `json:"shell"`
Line string `json:"line"`
Success bool `json:"success"`
Success *bool `json:"success"`
Result string `json:"result"`
Status map[string]interface{} `json:"status"`
ResponseDelay float64 `json:"response_delay"`
Expand All @@ -45,15 +45,3 @@ type EventCommandRequest struct {
Server string `json:"server"`
RunAfter []string `json:"run_after"`
}

type EventCommandResponse struct {
ID string `json:"id"`
Shell string `json:"shell"`
Line string `json:"line"`
Data string `json:"data"`
AddedAt string `json:"added_at"`
ScheduledAt string `json:"scheduled_at"`
Server string `json:"server"`
RequestedBy string `json:"requested_by"`
RunAfter []string `json:"run_after"`
}

0 comments on commit 0b93b5f

Please sign in to comment.