From 2a07dbae136dba72578dde2f33cb56de6d96445e Mon Sep 17 00:00:00 2001
From: XiaoXiAI <123750281+zzxr6@users.noreply.github.com>
Date: Mon, 14 Oct 2024 15:08:27 +0800
Subject: [PATCH] FIx bug of endpoint page (#704)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Sync endpoint page
* Update EndpointPage.vue
* Reset code
* Update endpoint settings to fetch resources by cluster id
---------
Co-authored-by: 朱鑫睿
- {{ 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" />