chore: model instance show gpu info

This commit is contained in:
jialin
2024-09-12 18:34:44 +08:00
parent b6d5b45650
commit f339133245
18 changed files with 376 additions and 39 deletions
@@ -2,7 +2,7 @@ import LogsViewer from '@/components/logs-viewer';
import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Modal } from 'antd';
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
type ViewModalProps = {
open: boolean;
@@ -11,7 +11,6 @@ type ViewModalProps = {
};
const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
console.log('viewlogs======');
const { open, url, onCancel } = props || {};
const [modalSize, setModalSize] = useState<any>({
width: 600,
@@ -29,6 +28,16 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
});
};
useEffect(() => {
if (open) {
isFullScreenRef.current = false;
setModalSize({
width: '100%',
height: 'calc(100vh - 100px)'
});
}
}, [open]);
return (
<Modal
title={
@@ -49,7 +58,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
destroyOnClose={true}
closeIcon={true}
maskClosable={false}
keyboard={false}
keyboard={true}
width={modalSize.width}
footer={null}
>