Skip to content

Commit 7cfcce9

Browse files
author
Benjamin Perez
committed
AuditLogs page fixes
- Added support to endDate - Converted dates to UTC as required by AuditLogs API Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 7fb8c11 commit 7cfcce9

File tree

7 files changed

+60
-5
lines changed

7 files changed

+60
-5
lines changed

portal-ui/src/api/consoleApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,6 +4567,7 @@ export class Api<
45674567
/** @default "timeDesc" */
45684568
order?: "timeDesc" | "timeAsc";
45694569
timeStart?: string;
4570+
timeEnd?: string;
45704571
},
45714572
params: RequestParams = {},
45724573
) =>

portal-ui/src/screens/Console/Logs/LogSearch/LogsSearchMain.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ const LogsSearchMain = () => {
119119
queryParams !== "" ? `${queryParams}` : ""
120120
}&pageSize=100&pageNo=${nextPage}&order=${
121121
sortOrder === "DESC" ? "timeDesc" : "timeAsc"
122-
}${timeStart !== null ? `&timeStart=${timeStart.toISO()}` : ""}${
123-
timeEnd !== null ? `&timeEnd=${timeEnd.toISO()}` : ""
124-
}`,
122+
}${
123+
timeStart !== null ? `&timeStart=${timeStart.toUTC().toISO()}` : ""
124+
}${timeEnd !== null ? `&timeEnd=${timeEnd.toUTC().toISO()}` : ""}`,
125125
)
126126
.then((res: ISearchResponse) => {
127127
const fetchedResults = res.results || [];

restapi/embedded_spec.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

restapi/operations/logging/log_search_parameters.go

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

restapi/operations/logging/log_search_urlbuilder.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

restapi/user_log_search.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ import (
2020
"context"
2121
"encoding/json"
2222
"fmt"
23-
"net/http"
24-
2523
"github.com/go-openapi/runtime/middleware"
2624
"github.com/minio/console/models"
2725
"github.com/minio/console/restapi/operations"
2826
logApi "github.com/minio/console/restapi/operations/logging"
2927
iampolicy "github.com/minio/pkg/v2/policy"
28+
"net/http"
3029
)
3130

3231
func registerLogSearchHandlers(api *operations.ConsoleAPI) {
@@ -80,6 +79,12 @@ func getLogSearchResponse(session *models.Principal, params logApi.LogSearchPara
8079
if params.TimeStart != nil && *params.TimeStart != "" {
8180
endpoint = fmt.Sprintf("%s&timeStart=%s", endpoint, *params.TimeStart)
8281
}
82+
83+
// timeEnd
84+
if params.TimeEnd != nil && *params.TimeEnd != "" {
85+
endpoint = fmt.Sprintf("%s&timeEnd=%s", endpoint, *params.TimeEnd)
86+
}
87+
8388
// page size and page number
8489
endpoint = fmt.Sprintf("%s&pageSize=%d", endpoint, *params.PageSize)
8590
endpoint = fmt.Sprintf("%s&pageNo=%d", endpoint, *params.PageNo)

swagger.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,6 +2943,9 @@ paths:
29432943
- name: timeStart
29442944
in: query
29452945
type: string
2946+
- name: timeEnd
2947+
in: query
2948+
type: string
29462949
responses:
29472950
200:
29482951
description: A successful response.

0 commit comments

Comments
 (0)