Skip to content

Commit

Permalink
AuditLogs page fixes (minio#3059)
Browse files Browse the repository at this point in the history
- Added support to endDate
- Converted dates to UTC as required by AuditLogs API

Signed-off-by: Benjamin Perez <[email protected]>
  • Loading branch information
bexsoft authored Sep 22, 2023
1 parent 7fb8c11 commit 1ce2846
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 3 deletions.
1 change: 1 addition & 0 deletions portal-ui/src/api/consoleApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4567,6 +4567,7 @@ export class Api<
/** @default "timeDesc" */
order?: "timeDesc" | "timeAsc";
timeStart?: string;
timeEnd?: string;
},
params: RequestParams = {},
) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ const LogsSearchMain = () => {
queryParams !== "" ? `${queryParams}` : ""
}&pageSize=100&pageNo=${nextPage}&order=${
sortOrder === "DESC" ? "timeDesc" : "timeAsc"
}${timeStart !== null ? `&timeStart=${timeStart.toISO()}` : ""}${
timeEnd !== null ? `&timeEnd=${timeEnd.toISO()}` : ""
}`,
}${
timeStart !== null ? `&timeStart=${timeStart.toUTC().toISO()}` : ""
}${timeEnd !== null ? `&timeEnd=${timeEnd.toUTC().toISO()}` : ""}`,
)
.then((res: ISearchResponse) => {
const fetchedResults = res.results || [];
Expand Down
10 changes: 10 additions & 0 deletions restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions restapi/operations/logging/log_search_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions restapi/operations/logging/log_search_urlbuilder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions restapi/user_log_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ func getLogSearchResponse(session *models.Principal, params logApi.LogSearchPara
if params.TimeStart != nil && *params.TimeStart != "" {
endpoint = fmt.Sprintf("%s&timeStart=%s", endpoint, *params.TimeStart)
}

// timeEnd
if params.TimeEnd != nil && *params.TimeEnd != "" {
endpoint = fmt.Sprintf("%s&timeEnd=%s", endpoint, *params.TimeEnd)
}

// page size and page number
endpoint = fmt.Sprintf("%s&pageSize=%d", endpoint, *params.PageSize)
endpoint = fmt.Sprintf("%s&pageNo=%d", endpoint, *params.PageNo)
Expand Down
3 changes: 3 additions & 0 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,9 @@ paths:
- name: timeStart
in: query
type: string
- name: timeEnd
in: query
type: string
responses:
200:
description: A successful response.
Expand Down

0 comments on commit 1ce2846

Please sign in to comment.