chore: models list re-render

This commit is contained in:
jialin
2024-07-05 18:51:13 +08:00
parent 8c66c482b2
commit b753528e44
38 changed files with 810 additions and 657 deletions
@@ -1,24 +1,25 @@
import LogsViewer from '@/components/logs-viewer';
import { useIntl } from '@umijs/max';
import { Modal } from 'antd';
import React from 'react';
type ViewModalProps = {
content: string;
title: string;
open: boolean;
url: string;
onCancel: () => void;
};
const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
const { title, open, url, onCancel, content = '' } = props || {};
console.log('viewlogs======');
const { open, url, onCancel } = props || {};
const intl = useIntl();
if (!open) {
return null;
}
return (
<Modal
title={title}
title={intl.formatMessage({ id: 'common.button.viewlog' })}
open={open}
onCancel={onCancel}
destroyOnClose={true}
@@ -30,15 +31,14 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
footer={null}
>
<LogsViewer
content={content}
height={500}
url={url}
params={{
follow: false
follow: true
}}
></LogsViewer>
</Modal>
);
};
export default ViewCodeModal;
export default React.memo(ViewCodeModal);