-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some details on audit logs page (#1156)
- Changed default port to 5005 due 5000 port is not available to use in new MacOS versions - Added an option to show full log information in a modal - Fixed issue with column selector dropdown & mui v5 - Fixed advanced filters table population - Changed date range selector picker for audit logs Signed-off-by: Benjamin Perez <benjamin@bexsoft.net> Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
- Loading branch information
Showing
6 changed files
with
204 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
portal-ui/src/screens/Console/Logs/LogSearch/LogSearchFullModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// This file is part of MinIO Console Server | ||
// Copyright (c) 2021 MinIO, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React, { Fragment } from "react"; | ||
import get from "lodash/get"; | ||
import { Button, Grid } from "@mui/material"; | ||
import { Theme } from "@mui/material/styles"; | ||
import createStyles from "@mui/styles/createStyles"; | ||
import withStyles from "@mui/styles/withStyles"; | ||
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper"; | ||
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary"; | ||
import { IReqInfoSearchResults } from "./types"; | ||
import { LogSearchColumnLabels } from "./utils"; | ||
|
||
interface ILogSearchFullModal { | ||
modalOpen: boolean; | ||
logSearchElement: IReqInfoSearchResults; | ||
onClose: () => void; | ||
classes: any; | ||
} | ||
|
||
const styles = (theme: Theme) => | ||
createStyles({ | ||
buttonContainer: { | ||
textAlign: "right", | ||
}, | ||
pathLabel: { | ||
marginTop: 0, | ||
marginBottom: 32, | ||
}, | ||
objectKeyCol: { | ||
fontWeight: 700, | ||
paddingRight: "10px", | ||
textAlign: "left", | ||
}, | ||
...modalBasic, | ||
}); | ||
|
||
const LogSearchFullModal = ({ | ||
modalOpen, | ||
logSearchElement, | ||
onClose, | ||
classes, | ||
}: ILogSearchFullModal) => { | ||
const jsonItems = Object.keys(logSearchElement); | ||
|
||
return ( | ||
<Fragment> | ||
<ModalWrapper | ||
modalOpen={modalOpen} | ||
title="Full Log Information" | ||
onClose={() => { | ||
onClose(); | ||
}} | ||
> | ||
<Grid container> | ||
<Grid item xs={12}> | ||
<table> | ||
<tbody> | ||
{jsonItems.map((objectKey: string, index: number) => ( | ||
<tr key={`logSearch-${index.toString()}`}> | ||
<th className={classes.objectKeyCol}> | ||
{get(LogSearchColumnLabels, objectKey, `${objectKey}`)} | ||
</th> | ||
<td>{get(logSearchElement, objectKey, "")}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</Grid> | ||
<Grid item xs={12} className={classes.buttonContainer}> | ||
<Button | ||
type="button" | ||
variant="contained" | ||
color="primary" | ||
onClick={onClose} | ||
> | ||
Close | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</ModalWrapper> | ||
</Fragment> | ||
); | ||
}; | ||
|
||
export default withStyles(styles)(LogSearchFullModal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This file is part of MinIO Console Server | ||
// Copyright (c) 2021 MinIO, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
export const LogSearchColumnLabels = { | ||
time: "Timestamp", | ||
api_name: "API Name", | ||
bucket: "Bucket", | ||
object: "Object", | ||
remote_host: "Remote Host", | ||
request_id: "Request ID", | ||
user_agent: "User Agent", | ||
response_status: "Response Status", | ||
response_status_code: "Response Status Code", | ||
request_content_length: "Request Content Length", | ||
response_content_length: "Response Content Length", | ||
time_to_response_ns: "Time to Response NS", | ||
}; |