2022-06-10 17:46:46 +08:00
|
|
|
import { TableOutlined } from '@ant-design/icons';
|
2023-03-03 00:16:26 +08:00
|
|
|
import { ISchema } from '@formily/react';
|
|
|
|
import { createTableBlockSchema, SchemaInitializer } from '@nocobase/client';
|
2022-06-10 17:46:46 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
export const AuditLogsBlockInitializer = (props) => {
|
|
|
|
const { insert } = props;
|
|
|
|
const { t } = useTranslation();
|
2023-03-03 00:16:26 +08:00
|
|
|
|
|
|
|
const schema = createTableBlockSchema({
|
|
|
|
collection: 'auditLogs',
|
|
|
|
rowKey: 'id',
|
|
|
|
tableActionInitializers: 'AuditLogsTableActionInitializers',
|
|
|
|
tableColumnInitializers: 'AuditLogsTableColumnInitializers',
|
|
|
|
tableActionColumnInitializers: 'AuditLogsTableActionColumnInitializers',
|
|
|
|
tableBlockProvider: 'AuditLogsBlockProvider',
|
|
|
|
disableTemplate: true,
|
|
|
|
});
|
|
|
|
|
2022-06-10 17:46:46 +08:00
|
|
|
return (
|
|
|
|
<SchemaInitializer.Item
|
|
|
|
{...props}
|
|
|
|
icon={<TableOutlined />}
|
|
|
|
onClick={() => {
|
2023-03-03 00:16:26 +08:00
|
|
|
insert(schema as ISchema);
|
2022-06-10 17:46:46 +08:00
|
|
|
}}
|
|
|
|
title={t('Audit Logs')}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|