From ebd1d8680a4e8d10b1470fa450800ececeaa3afb Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Thu, 15 May 2025 15:22:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=85=A8=E9=80=89=E6=97=B6=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E9=80=89=E4=B8=AD=E8=BF=90=E8=A1=8C=E7=9A=84=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E5=AE=9E=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CreateForm/ExecuteConfig.tsx | 12 +++++++++++- .../ActiveLearn/components/CreateForm/utils.ts | 4 ++++ .../components/ExperimentInstanceList/index.tsx | 16 ++++++++++++++-- .../components/ExperimentInstanceList/index.tsx | 16 ++++++++++++++-- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/react-ui/src/pages/ActiveLearn/components/CreateForm/ExecuteConfig.tsx b/react-ui/src/pages/ActiveLearn/components/CreateForm/ExecuteConfig.tsx index c510dc3b..c5d1f476 100644 --- a/react-ui/src/pages/ActiveLearn/components/CreateForm/ExecuteConfig.tsx +++ b/react-ui/src/pages/ActiveLearn/components/CreateForm/ExecuteConfig.tsx @@ -17,6 +17,11 @@ import { function ExecuteConfig() { const form = Form.useFormInstance(); + const task_type = Form.useWatch('task_type', form); + const queryStrategiesOptions = + task_type === AutoMLTaskType.Classification + ? queryStrategies.slice(0, 2) + : queryStrategies.slice(2); return ( <> - diff --git a/react-ui/src/pages/ActiveLearn/components/CreateForm/utils.ts b/react-ui/src/pages/ActiveLearn/components/CreateForm/utils.ts index 8bf7bce4..77bc517a 100644 --- a/react-ui/src/pages/ActiveLearn/components/CreateForm/utils.ts +++ b/react-ui/src/pages/ActiveLearn/components/CreateForm/utils.ts @@ -87,4 +87,8 @@ export const queryStrategies = [ label: 'upper_confidence_bound', value: 'upper_confidence_bound', }, + { + label: 'probability_of_improvement', + value: 'probability_of_improvement', + }, ]; diff --git a/react-ui/src/pages/AutoML/components/ExperimentInstanceList/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentInstanceList/index.tsx index 05d6d786..d11afc9d 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentInstanceList/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentInstanceList/index.tsx @@ -34,7 +34,14 @@ function ExperimentInstanceList({ }: ExperimentInstanceListProps) { const { message } = App.useApp(); const allIntanceIds = useMemo(() => { - return experimentInsList?.map((item) => item.id) || []; + return ( + experimentInsList + ?.filter( + (item) => + item.status !== ExperimentStatus.Running && item.status !== ExperimentStatus.Pending, + ) + .map((item) => item.id) || [] + ); }, [experimentInsList]); const [ selectedIns, @@ -126,7 +133,12 @@ function ExperimentInstanceList({
- +
序号
运行时长
diff --git a/react-ui/src/pages/Experiment/components/ExperimentInstanceList/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentInstanceList/index.tsx index 029a78c7..bcfbc3ff 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentInstanceList/index.tsx +++ b/react-ui/src/pages/Experiment/components/ExperimentInstanceList/index.tsx @@ -39,7 +39,14 @@ function ExperimentInstanceList({ }: ExperimentInstanceListProps) { const { message } = App.useApp(); const allIntanceIds = useMemo(() => { - return experimentInsList?.map((item) => item.id) || []; + return ( + experimentInsList + ?.filter( + (item) => + item.status !== ExperimentStatus.Running && item.status !== ExperimentStatus.Pending, + ) + .map((item) => item.id) || [] + ); }, [experimentInsList]); const [ selectedIns, @@ -127,7 +134,12 @@ function ExperimentInstanceList({
- +
序号
可视化
From c103375c8c62356bfdbcdb1adf6ad88ac4bf39ed Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Thu, 15 May 2025 16:01:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E6=97=A5=E5=BF=97=E4=B8=80=E7=89=87=E7=A9=BA?= =?UTF-8?q?=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/pages/ActiveLearn/Instance/index.tsx | 2 +- .../ActiveLearn/components/ExperimentLog/index.tsx | 9 +++++++-- react-ui/src/pages/AutoML/Instance/index.tsx | 7 +++++-- .../pages/AutoML/components/ExperimentLog/empty.tsx | 7 +++++++ .../pages/AutoML/components/ExperimentLog/index.less | 11 +++++++++++ .../pages/AutoML/components/ExperimentLog/index.tsx | 5 ++++- .../pages/Experiment/components/LogGroup/index.tsx | 5 ++++- react-ui/src/pages/HyperParameter/Instance/index.tsx | 2 +- .../HyperParameter/components/ExperimentLog/index.tsx | 9 +++++++-- 9 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 react-ui/src/pages/AutoML/components/ExperimentLog/empty.tsx diff --git a/react-ui/src/pages/ActiveLearn/Instance/index.tsx b/react-ui/src/pages/ActiveLearn/Instance/index.tsx index 5655e60d..d3cbb4b8 100644 --- a/react-ui/src/pages/ActiveLearn/Instance/index.tsx +++ b/react-ui/src/pages/ActiveLearn/Instance/index.tsx @@ -153,7 +153,7 @@ function ActiveLearnInstance() { className={styles['active-learn-instance__basic']} info={experimentInfo} runStatus={workflowStatus} - instanceStatus={instanceInfo?.status} + instanceStatus={instanceInfo?.status as ExperimentStatus} isInstance /> ), diff --git a/react-ui/src/pages/ActiveLearn/components/ExperimentLog/index.tsx b/react-ui/src/pages/ActiveLearn/components/ExperimentLog/index.tsx index 1d9682c3..6b1f4b5d 100644 --- a/react-ui/src/pages/ActiveLearn/components/ExperimentLog/index.tsx +++ b/react-ui/src/pages/ActiveLearn/components/ExperimentLog/index.tsx @@ -1,5 +1,6 @@ import { ExperimentStatus } from '@/enums'; import { ActiveLearnInstanceData } from '@/pages/ActiveLearn/types'; +import EmptyLog from '@/pages/AutoML/components/ExperimentLog/empty'; import LogList from '@/pages/Experiment/components/LogList'; import { NodeStatus } from '@/types'; import { Tabs } from 'antd'; @@ -64,7 +65,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { // icon: , children: (
- {trainCloneNodeStatus && ( + {trainCloneNodeStatus ? ( + ) : ( + )}
), @@ -83,7 +86,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { // icon: , children: (
- {hpoNodeStatus && ( + {hpoNodeStatus ? ( + ) : ( + )}
), diff --git a/react-ui/src/pages/AutoML/Instance/index.tsx b/react-ui/src/pages/AutoML/Instance/index.tsx index e0fb5e4d..a24bf37f 100644 --- a/react-ui/src/pages/AutoML/Instance/index.tsx +++ b/react-ui/src/pages/AutoML/Instance/index.tsx @@ -95,7 +95,10 @@ function AutoMLInstance() { }; const setupSSE = (name: string, namespace: string) => { - const { origin } = location; + let { origin } = location; + if (process.env.NODE_ENV === 'development') { + origin = 'http://172.20.32.235:31213'; + } const params = encodeURIComponent(`metadata.namespace=${namespace},metadata.name=${name}`); const evtSource = new EventSource( `${origin}/api/v1/realtimeStatus?listOptions.fieldSelector=${params}`, @@ -156,7 +159,7 @@ function AutoMLInstance() { className={styles['auto-ml-instance__basic']} info={autoMLInfo} runStatus={workflowStatus} - instanceStatus={instanceInfo?.status} + instanceStatus={instanceInfo?.status as ExperimentStatus} isInstance /> ), diff --git a/react-ui/src/pages/AutoML/components/ExperimentLog/empty.tsx b/react-ui/src/pages/AutoML/components/ExperimentLog/empty.tsx new file mode 100644 index 00000000..219a8710 --- /dev/null +++ b/react-ui/src/pages/AutoML/components/ExperimentLog/empty.tsx @@ -0,0 +1,7 @@ +import styles from './index.less'; + +function EmptyLog() { + return
暂无日志
; +} + +export default EmptyLog; diff --git a/react-ui/src/pages/AutoML/components/ExperimentLog/index.less b/react-ui/src/pages/AutoML/components/ExperimentLog/index.less index beaacea3..d0c76f5b 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentLog/index.less +++ b/react-ui/src/pages/AutoML/components/ExperimentLog/index.less @@ -5,3 +5,14 @@ height: 100%; } } + +.empty-log { + height: 100%; + padding: 15px; + color: white; + font-size: 14px; + white-space: pre-line; + text-align: center; + word-break: break-all; + background: #19253b; +} diff --git a/react-ui/src/pages/AutoML/components/ExperimentLog/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentLog/index.tsx index 219e5782..157aae80 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentLog/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentLog/index.tsx @@ -2,6 +2,7 @@ import { ExperimentStatus } from '@/enums'; import { AutoMLInstanceData } from '@/pages/AutoML/types'; import LogList from '@/pages/Experiment/components/LogList'; import { NodeStatus } from '@/types'; +import EmptyLog from './empty'; import styles from './index.less'; const NodePrefix = 'auto-ml'; @@ -19,7 +20,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { return (
- {nodeStatus && ( + {nodeStatus ? ( + ) : ( + )}
diff --git a/react-ui/src/pages/Experiment/components/LogGroup/index.tsx b/react-ui/src/pages/Experiment/components/LogGroup/index.tsx index 43297512..7456bba1 100644 --- a/react-ui/src/pages/Experiment/components/LogGroup/index.tsx +++ b/react-ui/src/pages/Experiment/components/LogGroup/index.tsx @@ -54,7 +54,10 @@ function LogGroup({ useEffect(() => { // 建立 socket 连接 const setupSockect = () => { - const { host } = location; + let { host } = location; + if (process.env.NODE_ENV === 'development') { + host = '172.20.32.235:31213'; + } const socket = new WebSocket( `ws://${host}/newlog/realtimeLog?start=${start_time}&query={pod="${pod_name}"}`, ); diff --git a/react-ui/src/pages/HyperParameter/Instance/index.tsx b/react-ui/src/pages/HyperParameter/Instance/index.tsx index 79905c36..246b1943 100644 --- a/react-ui/src/pages/HyperParameter/Instance/index.tsx +++ b/react-ui/src/pages/HyperParameter/Instance/index.tsx @@ -168,7 +168,7 @@ function HyperParameterInstance() { className={styles['hyper-parameter-instance__basic']} info={experimentInfo} runStatus={workflowStatus} - instanceStatus={instanceInfo?.status} + instanceStatus={instanceInfo?.status as ExperimentStatus} isInstance /> ), diff --git a/react-ui/src/pages/HyperParameter/components/ExperimentLog/index.tsx b/react-ui/src/pages/HyperParameter/components/ExperimentLog/index.tsx index d7639094..6237adf0 100644 --- a/react-ui/src/pages/HyperParameter/components/ExperimentLog/index.tsx +++ b/react-ui/src/pages/HyperParameter/components/ExperimentLog/index.tsx @@ -1,4 +1,5 @@ import { ExperimentStatus } from '@/enums'; +import EmptyLog from '@/pages/AutoML/components/ExperimentLog/empty'; import LogList from '@/pages/Experiment/components/LogList'; import { HyperParameterInstanceData } from '@/pages/HyperParameter/types'; import { NodeStatus } from '@/types'; @@ -64,7 +65,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { // icon: , children: (
- {trainCloneNodeStatus && ( + {trainCloneNodeStatus ? ( + ) : ( + )}
), @@ -83,7 +86,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { // icon: , children: (
- {hpoNodeStatus && ( + {hpoNodeStatus ? ( + ) : ( + )}
),