diff --git a/frontend/src/components/endpoints/EndpointDetail.vue b/frontend/src/components/endpoints/EndpointDetail.vue index a21e6c80e..1d79e0dc1 100644 --- a/frontend/src/components/endpoints/EndpointDetail.vue +++ b/frontend/src/components/endpoints/EndpointDetail.vue @@ -25,7 +25,8 @@ :settingsVisibility="canManage" :can-write="canWrite" repo-type="endpoint" - :hardware="endpoint.hardware" + :clusterId="endpoint.cluster_id" + :sku="endpoint.sku" :modelId="endpoint.model_id" :private="endpoint.private" :endpointReplica="endpoint.actual_replica" @@ -96,7 +97,6 @@ const ownerUrl = computed(() => { const { namespace } = modelInfo.value if (!namespace) return '' - const baseUrl = namespace.Type === 'user' ? '/profile/' : '/organizations/' return baseUrl + namespace.Path }) diff --git a/frontend/src/components/endpoints/EndpointPage.vue b/frontend/src/components/endpoints/EndpointPage.vue index 18494b756..ab6892604 100644 --- a/frontend/src/components/endpoints/EndpointPage.vue +++ b/frontend/src/components/endpoints/EndpointPage.vue @@ -36,7 +36,7 @@ {{ $t('endpoints.detail.cloudResource')}}
- {{ hardware }} + {{ resource.name }}
@@ -62,12 +62,15 @@ \ No newline at end of file diff --git a/frontend/src/components/endpoints/EndpointSettings.vue b/frontend/src/components/endpoints/EndpointSettings.vue index 7b30b8973..f38d4defe 100644 --- a/frontend/src/components/endpoints/EndpointSettings.vue +++ b/frontend/src/components/endpoints/EndpointSettings.vue @@ -293,7 +293,8 @@ cloudResource: String, framework: String, maxReplica: Number, - minReplica: Number + minReplica: Number, + clusterId: String }) const { t } = useI18n() @@ -359,8 +360,10 @@ return !!framework.frame_npu_image } else if (currentResource.value.type === 'gpu') { return !!framework.frame_image - } else { + } else if (currentResource.value.type === 'cpu') { return !!framework.frame_cpu_image + } else { + return true } }) }) @@ -378,6 +381,12 @@ } }) + watch(() => props.clusterId, () => { + if (props.clusterId) { + fetchResources() + } + }) + const stopEndpoint = async () => { const stopUrl = `/models/${props.modelId}/run/${props.endpointId}/stop` const { response, error } = await useFetchApi(stopUrl).put().json() @@ -439,7 +448,7 @@ } const fetchResources = async () => { - const { data, error } = await useFetchApi('/space_resources').json() + const { data, error } = await useFetchApi(`/space_resources?cluster_id=${props.clusterId}`).json() if (error.value) { ElMessage({ @@ -551,8 +560,4 @@ }) } } - - onMounted(() => { - fetchResources() - }) diff --git a/frontend/src/components/shared/RepoTabs.vue b/frontend/src/components/shared/RepoTabs.vue index 7af4d0d89..de223aef8 100644 --- a/frontend/src/components/shared/RepoTabs.vue +++ b/frontend/src/components/shared/RepoTabs.vue @@ -56,7 +56,8 @@ :modelId="modelId" :private="private" :endpointReplica="endpointReplica" - :hardware="hardware" + :clusterId="repoDetail.cluster_id" + :sku="sku" :replicaList="replicaList" />