feat: 应用程序 & 实验对比排序

This commit is contained in:
cp3hnu 2024-07-22 09:59:53 +08:00
parent f9666bd9d9
commit 1cc80986ed
11 changed files with 41 additions and 15 deletions

View File

@ -229,7 +229,7 @@ export default [
name: '应用开发', name: '应用开发',
path: '', path: '',
key: 'appsDeployment', key: 'appsDeployment',
component: './missingPage.jsx', component: './Application',
}, },
], ],
}, },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,8 +1,8 @@
.container { .kf-full-screen-frame {
width: 100%; width: 100%;
height: 100%; height: 100%;
.frame { &__iframe {
width: 100%; width: 100%;
height: 100%; height: 100%;
border: none; border: none;

View File

@ -0,0 +1,18 @@
import classNames from 'classnames';
import './index.less';
type FullScreenFrameProps = {
url: string;
className?: string;
style?: React.CSSProperties;
};
function FullScreenFrame({ url, className, style }: FullScreenFrameProps) {
return (
<div className={classNames('kf-full-screen-frame', className ?? '')} style={style}>
{url && <iframe src={url} className="kf-full-screen-frame__iframe"></iframe>}
</div>
);
}
export default FullScreenFrame;

View File

@ -0,0 +1,9 @@
import FullScreenFrame from '@/components/FullScreenFrame';
import { useState } from 'react';
function Application() {
const [iframeUrl] = useState('http://172.20.32.181:30080/');
return <FullScreenFrame url={iframeUrl}></FullScreenFrame>;
}
export default Application;

View File

@ -1,7 +1,7 @@
import FullScreenFrame from '@/components/FullScreenFrame';
import { getLabelStudioUrl } from '@/services/developmentEnvironment'; import { getLabelStudioUrl } from '@/services/developmentEnvironment';
import { to } from '@/utils/promise'; import { to } from '@/utils/promise';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import styles from './index.less';
function DatasetAnnotation() { function DatasetAnnotation() {
const [iframeUrl, setIframeUrl] = useState(''); const [iframeUrl, setIframeUrl] = useState('');
@ -14,11 +14,7 @@ function DatasetAnnotation() {
setIframeUrl(res.data); setIframeUrl(res.data);
} }
}; };
return ( return <FullScreenFrame url={iframeUrl} />;
<div className={styles.container}>
{iframeUrl && <iframe src={iframeUrl} className={styles.frame}></iframe>}
</div>
);
} }
export default DatasetAnnotation; export default DatasetAnnotation;

View File

@ -93,8 +93,7 @@ function ExperimentComparison() {
type: 'checkbox', type: 'checkbox',
fixed: 'left', fixed: 'left',
selectedRowKeys, selectedRowKeys,
onChange: (selectedRowKeys: React.Key[], selectedRows: any[]) => { onChange: (selectedRowKeys: React.Key[]) => {
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setSelectedRowKeys(selectedRowKeys); setSelectedRowKeys(selectedRowKeys);
}, },
}; };
@ -159,6 +158,8 @@ function ExperimentComparison() {
align: 'center', align: 'center',
render: tableCellRender(true), render: tableCellRender(true),
ellipsis: { showTitle: false }, ellipsis: { showTitle: false },
sorter: (a, b) => a.params[name] - b.params[name],
showSorterTooltip: false,
})), })),
}, },
{ {
@ -176,6 +177,8 @@ function ExperimentComparison() {
align: 'center', align: 'center',
render: tableCellRender(true), render: tableCellRender(true),
ellipsis: { showTitle: false }, ellipsis: { showTitle: false },
sorter: (a, b) => a.metrics[name] - b.metrics[name],
showSorterTooltip: false,
})), })),
}, },
]; ];

View File

@ -18,7 +18,7 @@ const CacheInfo: React.FC = () => {
}); });
return ( return (
<div style={{}}> <div>
<iframe <iframe
style={{ width: '100%', border: '0px', height: '100%' }} style={{ width: '100%', border: '0px', height: '100%' }}
src={`/api/swagger-ui/index.html`} src={`/api/swagger-ui/index.html`}

View File

@ -49,6 +49,7 @@
position: fixed; position: fixed;
right: 30px; right: 30px;
bottom: 20px; bottom: 20px;
z-index: 999;
width: 64px; width: 64px;
height: 64px; height: 64px;
background-color: white; background-color: white;

View File

@ -71,7 +71,7 @@ function Workspace() {
<AssetsManagement></AssetsManagement> <AssetsManagement></AssetsManagement>
</div> </div>
</div> </div>
<Draggable onStart={handleStart} onStop={handleStop} onDrag={handleDrag}> <Draggable onStart={handleStart} onStop={handleStop} onDrag={handleDrag} bounds="body">
<img <img
className={styles['workspace__robot-img']} className={styles['workspace__robot-img']}
src={require('@/assets/img/robot.png')} src={require('@/assets/img/robot.png')}

View File

@ -7,10 +7,9 @@ export function getJupyterUrl() {
} }
// 查询 labelStudio url // 查询 labelStudio url
export function getLabelStudioUrl(params: any) { export function getLabelStudioUrl() {
return request(`/api/mmp/labelStudio/getURL`, { return request(`/api/mmp/labelStudio/getURL`, {
method: 'GET', method: 'GET',
params,
}); });
} }