-
+
-
diff --git a/react-ui/src/pages/Experiment/training/index.jsx b/react-ui/src/pages/Experiment/Info/index.jsx
similarity index 100%
rename from react-ui/src/pages/Experiment/training/index.jsx
rename to react-ui/src/pages/Experiment/Info/index.jsx
diff --git a/react-ui/src/pages/Experiment/training/index.less b/react-ui/src/pages/Experiment/Info/index.less
similarity index 100%
rename from react-ui/src/pages/Experiment/training/index.less
rename to react-ui/src/pages/Experiment/Info/index.less
diff --git a/react-ui/src/pages/Experiment/training/props.less b/react-ui/src/pages/Experiment/Info/props.less
similarity index 100%
rename from react-ui/src/pages/Experiment/training/props.less
rename to react-ui/src/pages/Experiment/Info/props.less
diff --git a/react-ui/src/pages/Experiment/training/props.tsx b/react-ui/src/pages/Experiment/Info/props.tsx
similarity index 100%
rename from react-ui/src/pages/Experiment/training/props.tsx
rename to react-ui/src/pages/Experiment/Info/props.tsx
diff --git a/react-ui/src/pages/Experiment/components/ExperimentStatusCell/index.less b/react-ui/src/pages/Experiment/components/ExperimentStatusCell/index.less
new file mode 100644
index 00000000..a5df71aa
--- /dev/null
+++ b/react-ui/src/pages/Experiment/components/ExperimentStatusCell/index.less
@@ -0,0 +1,12 @@
+.experiment-status-cell {
+ height: 100%;
+ &__label {
+ display: none;
+ }
+}
+
+.experiment-status-cell:hover {
+ .experiment-status-cell__label {
+ display: inline;
+ }
+}
diff --git a/react-ui/src/pages/Experiment/components/ExperimentStatusCell/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentStatusCell/index.tsx
new file mode 100644
index 00000000..373b6ffa
--- /dev/null
+++ b/react-ui/src/pages/Experiment/components/ExperimentStatusCell/index.tsx
@@ -0,0 +1,28 @@
+/*
+ * @Author: 赵伟
+ * @Date: 2024-04-18 18:35:41
+ * @Description: 实验状态
+ */
+
+import { ExperimentStatus } from '@/enums';
+import { experimentStatusInfo as statusInfo } from '@/pages/Experiment/status';
+import styles from './index.less';
+
+function ExperimentStatusCell(status?: ExperimentStatus | null) {
+ if (status === null || status === undefined || !statusInfo[status]) {
+ return
--;
+ }
+ return (
+
+

+
+ {statusInfo[status]?.label}
+
+
+ );
+}
+
+export default ExperimentStatusCell;
diff --git a/react-ui/src/pages/Experiment/components/LogGroup/index.tsx b/react-ui/src/pages/Experiment/components/LogGroup/index.tsx
index 5c25b860..cd84406d 100644
--- a/react-ui/src/pages/Experiment/components/LogGroup/index.tsx
+++ b/react-ui/src/pages/Experiment/components/LogGroup/index.tsx
@@ -6,7 +6,7 @@
import { ExperimentStatus } from '@/enums';
import { useStateRef } from '@/hooks';
-import { ExperimentLog } from '@/pages/Experiment/training/props';
+import { ExperimentLog } from '@/pages/Experiment/Info/props';
import { getExperimentPodsLog } from '@/services/experiment/index.js';
import { DoubleRightOutlined, DownOutlined, UpOutlined } from '@ant-design/icons';
import { Button } from 'antd';
@@ -47,7 +47,7 @@ function LogGroup({
const [logList, setLogList, logListRef] = useStateRef
([]);
const [completed, setCompleted] = useState(false);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- const [isMouseDown, setIsMouseDown, isMouseDownRef] = useStateRef(false);
+ const [_isMouseDown, setIsMouseDown, isMouseDownRef] = useStateRef(false);
useEffect(() => {
scrollToBottom(false);
diff --git a/react-ui/src/pages/Experiment/components/LogList/index.tsx b/react-ui/src/pages/Experiment/components/LogList/index.tsx
index d95224f1..0d833107 100644
--- a/react-ui/src/pages/Experiment/components/LogList/index.tsx
+++ b/react-ui/src/pages/Experiment/components/LogList/index.tsx
@@ -1,5 +1,5 @@
import { ExperimentStatus } from '@/enums';
-import { ExperimentLog } from '@/pages/Experiment/training/props';
+import { ExperimentLog } from '@/pages/Experiment/Info/props';
import LogGroup from '../LogGroup';
import styles from './index.less';
diff --git a/react-ui/src/pages/ModelDeployment/List/index.tsx b/react-ui/src/pages/ModelDeployment/List/index.tsx
index bc1f03dd..934b4cbd 100644
--- a/react-ui/src/pages/ModelDeployment/List/index.tsx
+++ b/react-ui/src/pages/ModelDeployment/List/index.tsx
@@ -166,7 +166,7 @@ function ModelDeployment() {
};
// 分页切换
- const handleTableChange: TableProps['onChange'] = (pagination, filters, sorter, { action }) => {
+ const handleTableChange: TableProps['onChange'] = (pagination, _filters, _sorter, { action }) => {
if (action === 'paginate') {
setPagination(pagination);
}
@@ -179,7 +179,7 @@ function ModelDeployment() {
dataIndex: 'index',
key: 'index',
width: '20%',
- render(text, record, index) {
+ render(_text, _record, index) {
return {(pagination.current! - 1) * pagination.pageSize! + index + 1};
},
},
diff --git a/react-ui/src/services/experiment/index.js b/react-ui/src/services/experiment/index.js
index 89028b24..66d27eb6 100644
--- a/react-ui/src/services/experiment/index.js
+++ b/react-ui/src/services/experiment/index.js
@@ -126,7 +126,15 @@ export function getExpEvaluateInfosReq(experimentId) {
// 获取当前实验的模型训练指标信息
export function getExpTrainInfosReq(experimentId) {
- return request(`/api/mmp//aim/getExpTrainInfos/${experimentId}`, {
+ return request(`/api/mmp/aim/getExpTrainInfos/${experimentId}`, {
method: 'GET',
});
}
+
+// 获取当前实验的指标对比地址
+export function getExpMetricsReq(data) {
+ return request(`/api/mmp/aim/getExpMetrics`, {
+ method: 'POST',
+ data
+ });
+}
diff --git a/react-ui/src/utils/table.tsx b/react-ui/src/utils/table.tsx
new file mode 100644
index 00000000..3058284a
--- /dev/null
+++ b/react-ui/src/utils/table.tsx
@@ -0,0 +1,68 @@
+/*
+ * @Author: 赵伟
+ * @Date: 2024-06-26 10:05:52
+ * @Description: 列表自定义 render
+ */
+
+import { formatDate } from '@/utils/date';
+import { Tooltip } from 'antd';
+import dayjs from 'dayjs';
+
+type TableCellFormatter = (value?: any | null) => string | undefined | null;
+
+// 字符串转换函数
+export const stringFormatter: TableCellFormatter = (value?: any | null) => {
+ return value;
+};
+
+// 日期转换函数
+export const dateFormatter: TableCellFormatter = (value?: any | null) => {
+ if (value === undefined || value === null || value === '') {
+ return null;
+ }
+ if (!dayjs(value).isValid()) {
+ return null;
+ }
+ return formatDate(value);
+};
+
+// 数组转换函数
+export function arrayFormatter(property?: string) {
+ return (value?: any | null): ReturnType => {
+ if (
+ value === undefined ||
+ value === null ||
+ Array.isArray(value) === false ||
+ value.length === 0
+ ) {
+ return null;
+ }
+
+ let list = value;
+ if (property && typeof value[0] === 'object') {
+ list = value.map((item) => item[property]);
+ }
+ return list.join(',');
+ };
+}
+
+function tableCellRender(ellipsis: boolean = false, format: TableCellFormatter = stringFormatter) {
+ return (value?: any | null) => {
+ const text = format(value);
+ if (ellipsis && text) {
+ return (
+
+ {renderCell(text)}
+
+ );
+ } else {
+ return renderCell(text);
+ }
+ };
+}
+
+function renderCell(text?: any | null) {
+ return {text ?? '--'};
+}
+
+export default tableCellRender;