|
|
@@ -10,6 +10,7 @@ import SubAreaTitle from '@/components/SubAreaTitle'; |
|
|
import { ServiceRunStatus, serviceStatusOptions } from '@/enums'; |
|
|
import { ServiceRunStatus, serviceStatusOptions } from '@/enums'; |
|
|
import { useCacheState } from '@/hooks/useCacheState'; |
|
|
import { useCacheState } from '@/hooks/useCacheState'; |
|
|
import { useComputingResource } from '@/hooks/useComputingResource'; |
|
|
import { useComputingResource } from '@/hooks/useComputingResource'; |
|
|
|
|
|
import { ModelData } from '@/pages/Dataset/config'; |
|
|
import { |
|
|
import { |
|
|
deleteServiceVersionReq, |
|
|
deleteServiceVersionReq, |
|
|
getServiceInfoReq, |
|
|
getServiceInfoReq, |
|
|
@@ -18,6 +19,7 @@ import { |
|
|
} from '@/services/modelDeployment'; |
|
|
} from '@/services/modelDeployment'; |
|
|
import themes from '@/styles/theme.less'; |
|
|
import themes from '@/styles/theme.less'; |
|
|
import { formatDate } from '@/utils/date'; |
|
|
import { formatDate } from '@/utils/date'; |
|
|
|
|
|
import { formatModel } from '@/utils/format'; |
|
|
import { openAntdModal } from '@/utils/modal'; |
|
|
import { openAntdModal } from '@/utils/modal'; |
|
|
import { to } from '@/utils/promise'; |
|
|
import { to } from '@/utils/promise'; |
|
|
import SessionStorage from '@/utils/sessionStorage'; |
|
|
import SessionStorage from '@/utils/sessionStorage'; |
|
|
@@ -110,8 +112,8 @@ function ServiceInfo() { |
|
|
if (res && res.data) { |
|
|
if (res && res.data) { |
|
|
const { content = [], totalElements = 0 } = res.data; |
|
|
const { content = [], totalElements = 0 } = res.data; |
|
|
content.forEach((item: ServiceVersionData) => { |
|
|
content.forEach((item: ServiceVersionData) => { |
|
|
if (item.model && !item.model.show_value) { |
|
|
|
|
|
item.model.show_value = `${item.model.name}:${item.model.version}`; |
|
|
|
|
|
|
|
|
if (item.model && !item.model.showValue) { |
|
|
|
|
|
item.model.showValue = `${item.model.name}:${item.model.version}`; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
setTableData(content); |
|
|
setTableData(content); |
|
|
@@ -258,6 +260,20 @@ function ServiceInfo() { |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 去模型 |
|
|
|
|
|
const gotoModel = (record: ServiceVersionData, e: React.MouseEvent) => { |
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
|
|
|
|
const model = record.model as any as ModelData; |
|
|
|
|
|
const link = formatModel(model)?.link; |
|
|
|
|
|
if (link) { |
|
|
|
|
|
setCacheState({ |
|
|
|
|
|
pagination, |
|
|
|
|
|
}); |
|
|
|
|
|
navigate(link); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
const columns: TableProps<ServiceVersionData>['columns'] = [ |
|
|
const columns: TableProps<ServiceVersionData>['columns'] = [ |
|
|
{ |
|
|
{ |
|
|
title: '序号', |
|
|
title: '序号', |
|
|
@@ -278,10 +294,12 @@ function ServiceInfo() { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '模型版本', |
|
|
title: '模型版本', |
|
|
dataIndex: ['model', 'show_value'], |
|
|
|
|
|
|
|
|
dataIndex: ['model', 'showValue'], |
|
|
key: 'model', |
|
|
key: 'model', |
|
|
width: '20%', |
|
|
width: '20%', |
|
|
render: tableCellRender(true), |
|
|
|
|
|
|
|
|
render: tableCellRender(true, TableCellValueType.Link, { |
|
|
|
|
|
onClick: gotoModel, |
|
|
|
|
|
}), |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '镜像版本', |
|
|
title: '镜像版本', |
|
|
|