Skip to content

Commit e504bb3

Browse files
authored
Merge pull request #1122 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 459d92c + 0f4f74e commit e504bb3

3 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { Layout as DashboardLayout } from "../../../../layouts/index.js";
2+
import { TabbedLayout } from "../../../../layouts/TabbedLayout";
3+
import { CippTablePage } from "../../../../components/CippComponents/CippTablePage.jsx";
4+
import { CippAuditLogSearchDrawer } from "../../../../components/CippComponents/CippAuditLogSearchDrawer.jsx";
5+
import { EyeIcon } from "@heroicons/react/24/outline";
6+
import { ManageSearch } from "@mui/icons-material";
7+
import tabOptions from "./tabOptions.json";
8+
import { useSettings } from "../../../../hooks/use-settings";
9+
10+
const simpleColumns = ["displayName", "status", "filterStartDateTime", "filterEndDateTime"];
11+
12+
const apiUrl = "/api/ListAuditLogSearches?Type=Searches";
13+
const pageTitle = "Manual Searches";
14+
15+
const actions = [
16+
{
17+
label: "View Results",
18+
link: "/tenant/administration/audit-logs/search-results?id=[id]&name=[displayName]",
19+
color: "primary",
20+
icon: <EyeIcon />,
21+
},
22+
{
23+
label: "Process Logs",
24+
url: "/api/ExecAuditLogSearch",
25+
confirmText:
26+
"Process these logs? Note: This will only alert on logs that match your Alert Configuration rules.",
27+
type: "POST",
28+
data: {
29+
Action: "ProcessLogs",
30+
SearchId: "id",
31+
},
32+
icon: <ManageSearch />,
33+
},
34+
];
35+
36+
const Page = () => {
37+
const currentTenant = useSettings().currentTenant;
38+
const queryKey = `AuditLogSearches-${currentTenant}`;
39+
40+
return (
41+
<>
42+
<CippTablePage
43+
title={pageTitle}
44+
apiUrl={apiUrl}
45+
apiDataKey="Results"
46+
simpleColumns={simpleColumns}
47+
queryKey={queryKey}
48+
actions={actions}
49+
cardButton={<CippAuditLogSearchDrawer relatedQueryKeys={[queryKey]} />}
50+
/>
51+
</>
52+
);
53+
};
54+
55+
Page.getLayout = (page) => (
56+
<DashboardLayout>
57+
<TabbedLayout tabOptions={tabOptions}>{page}</TabbedLayout>
58+
</DashboardLayout>
59+
);
60+
61+
export default Page;

src/pages/tenant/administration/audit-logs/tabOptions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"path": "/tenant/administration/audit-logs/searches",
1010
"icon": "List"
1111
},
12+
{
13+
"label": "Manual Searches",
14+
"path": "/tenant/administration/audit-logs/manual-searches",
15+
"icon": "ManageSearch"
16+
},
1217
{
1318
"label": "Search Coverage",
1419
"path": "/tenant/administration/audit-logs/coverage",

src/utils/icon-registry.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
Lock,
3232
Mail,
3333
ManageAccounts,
34+
ManageSearch,
3435
Notifications,
3536
Person,
3637
Policy,
@@ -78,6 +79,7 @@ export const iconRegistry = {
7879
Lock,
7980
Mail,
8081
ManageAccounts,
82+
ManageSearch,
8183
Notifications,
8284
Person,
8385
Policy,

0 commit comments

Comments
 (0)