07ec115904
* refactor: audit-log * refactor: audit-log fix view action * refactor: audit-log view fix * refactor(audit-log): collection field fix * refactor: audit-log view field fix * refactor(audit-log): support fixedBlock * refactor(audit-log): i18n fix * refactor(audit-log): fixedTable and drag issue * refactor(audit-log): remove template support * refactor(audit-log): drag fix * refactor(audit-log): disableTemplate & DndContext --------- Co-authored-by: anuoua <anuoua@gmail.com>
32 lines
943 B
TypeScript
32 lines
943 B
TypeScript
import { TableOutlined } from '@ant-design/icons';
|
|
import { ISchema } from '@formily/react';
|
|
import { createTableBlockSchema, SchemaInitializer } from '@nocobase/client';
|
|
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
export const AuditLogsBlockInitializer = (props) => {
|
|
const { insert } = props;
|
|
const { t } = useTranslation();
|
|
|
|
const schema = createTableBlockSchema({
|
|
collection: 'auditLogs',
|
|
rowKey: 'id',
|
|
tableActionInitializers: 'AuditLogsTableActionInitializers',
|
|
tableColumnInitializers: 'AuditLogsTableColumnInitializers',
|
|
tableActionColumnInitializers: 'AuditLogsTableActionColumnInitializers',
|
|
tableBlockProvider: 'AuditLogsBlockProvider',
|
|
disableTemplate: true,
|
|
});
|
|
|
|
return (
|
|
<SchemaInitializer.Item
|
|
{...props}
|
|
icon={<TableOutlined />}
|
|
onClick={() => {
|
|
insert(schema as ISchema);
|
|
}}
|
|
title={t('Audit Logs')}
|
|
/>
|
|
);
|
|
};
|