Browse Source

fix: 超参数寻优添加可视化对比iframe

pull/265/head
zhaowei 8 months ago
parent
commit
e8af394523
4 changed files with 42 additions and 9 deletions
  1. +24
    -7
      react-ui/config/routes.ts
  2. +1
    -1
      react-ui/src/pages/Experiment/Comparison/index.tsx
  3. +12
    -0
      react-ui/src/pages/HyperParameter/Aim/index.tsx
  4. +5
    -1
      react-ui/src/pages/HyperParameter/components/ExperimentHistory/index.tsx

+ 24
- 7
react-ui/config/routes.ts View File

@@ -141,12 +141,18 @@ export default [
{ {
name: '实验对比', name: '实验对比',
path: 'compare', path: 'compare',
component: './Experiment/Comparison/index',
},
{
name: '实验可视化对比',
path: 'compare-visual',
component: './Experiment/Aim/index',
routes: [
{
name: '实验对比',
path: '',
component: './Experiment/Comparison/index',
},
{
name: '可视化对比',
path: 'compare-visual',
component: './Experiment/Aim/index',
},
],
}, },
{ {
name: '可视化', name: '可视化',
@@ -223,7 +229,18 @@ export default [
{ {
name: '实验实例详情', name: '实验实例详情',
path: 'instance/:experimentId/:id', path: 'instance/:experimentId/:id',
component: './HyperParameter/Instance/index',
routes: [
{
name: '实验实例详情',
path: '',
component: './HyperParameter/Instance/index',
},
{
name: '可视化对比',
path: 'compare-visual',
component: './HyperParameter/Aim/index',
},
],
}, },
], ],
}, },


+ 1
- 1
react-ui/src/pages/Experiment/Comparison/index.tsx View File

@@ -77,7 +77,7 @@ function ExperimentComparison() {
const url = res.data; const url = res.data;
// window.open(url, '_blank'); // window.open(url, '_blank');
SessionStorage.setItem(SessionStorage.aimUrlKey, url); SessionStorage.setItem(SessionStorage.aimUrlKey, url);
navigate('../compare-visual');
navigate('compare-visual');
} }
}; };




+ 12
- 0
react-ui/src/pages/HyperParameter/Aim/index.tsx View File

@@ -0,0 +1,12 @@
/*
* @Author: 赵伟
* @Date: 2025-03-31 16:38:59
* @Description: 实验对比 Aim
*/

import IframePage, { IframePageType } from '@/components/IFramePage';

function AimPage() {
return <IframePage type={IframePageType.Aim}></IframePage>;
}
export default AimPage;

+ 5
- 1
react-ui/src/pages/HyperParameter/components/ExperimentHistory/index.tsx View File

@@ -3,7 +3,9 @@ import TrialStatusCell from '@/pages/HyperParameter/components/TrialStatusCell';
import { HyperParameterTrial } from '@/pages/HyperParameter/types'; import { HyperParameterTrial } from '@/pages/HyperParameter/types';
import { getExpMetricsReq } from '@/services/hyperParameter'; import { getExpMetricsReq } from '@/services/hyperParameter';
import { to } from '@/utils/promise'; import { to } from '@/utils/promise';
import SessionStorage from '@/utils/sessionStorage';
import tableCellRender, { TableCellValueType } from '@/utils/table'; import tableCellRender, { TableCellValueType } from '@/utils/table';
import { useNavigate } from '@umijs/max';
import { App, Button, Table, type TableProps } from 'antd'; import { App, Button, Table, type TableProps } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
@@ -36,6 +38,7 @@ function ExperimentHistory({ trialList = [] }: ExperimentHistoryProps) {
const metricAnalysis: Record<string, any> = first?.metric_analysis ?? {}; const metricAnalysis: Record<string, any> = first?.metric_analysis ?? {};
const paramsNames = Object.keys(config); const paramsNames = Object.keys(config);
const metricNames = Object.keys(metricAnalysis); const metricNames = Object.keys(metricAnalysis);
const navigate = useNavigate();


const trialColumns: TableProps<HyperParameterTrial>['columns'] = [ const trialColumns: TableProps<HyperParameterTrial>['columns'] = [
{ {
@@ -160,7 +163,8 @@ function ExperimentHistory({ trialList = [] }: ExperimentHistoryProps) {
const [res] = await to(getExpMetricsReq(selectedRowKeys)); const [res] = await to(getExpMetricsReq(selectedRowKeys));
if (res && res.data) { if (res && res.data) {
const url = res.data; const url = res.data;
window.open(url, '_blank');
SessionStorage.setItem(SessionStorage.aimUrlKey, url);
navigate('compare-visual');
} }
}; };




Loading…
Cancel
Save