Skip to content

Commit 04c1a76

Browse files
committed
add audit link in environments table
1 parent aac3868 commit 04c1a76

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

client/packages/lowcoder/src/pages/setting/environments/components/EnvironmentsTable.tsx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { Table, Tag, Button, Tooltip } from 'antd';
3-
import { EditOutlined } from '@ant-design/icons';
2+
import { Table, Tag, Button, Tooltip, Space } from 'antd';
3+
import { EditOutlined, AuditOutlined} from '@ant-design/icons';
44
import { Environment } from '../types/environment.types';
55

66

@@ -33,6 +33,14 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
3333
}
3434
};
3535

36+
// Open audit page in new tab
37+
const openAuditPage = (environmentId: string, e: React.MouseEvent) => {
38+
e.stopPropagation(); // Prevent row click from triggering
39+
const auditUrl = `/setting/audit?environmentId=${environmentId}`;
40+
window.open(auditUrl, '_blank');
41+
};
42+
43+
3644
// Define table columns
3745
const columns = [
3846
{
@@ -72,6 +80,23 @@ const EnvironmentsTable: React.FC<EnvironmentsTableProps> = ({
7280
</Tag>
7381
),
7482
},
83+
{
84+
title: 'Actions',
85+
key: 'actions',
86+
render: (_: any, record: Environment) => (
87+
<Space size="middle" onClick={e => e.stopPropagation()}>
88+
<Tooltip title="View Audit Logs">
89+
<Button
90+
icon={<AuditOutlined />}
91+
size="small"
92+
onClick={(e) => openAuditPage(record.environmentId, e)}
93+
>
94+
Audit
95+
</Button>
96+
</Tooltip>
97+
</Space>
98+
),
99+
},
75100
];
76101

77102
return (

0 commit comments

Comments
 (0)