Skip to content

Commit a6c6968

Browse files
ice201508jiuling
andauthored
fix-finetune-router-link-correct (#1192)
* Draft MR * fix-finetune-router-link-correct --------- Co-authored-by: jiuling <[email protected]>
1 parent efd9521 commit a6c6968

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

frontend/src/components/endpoints/EndpointItem.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<a
3-
:href="detailLink"
4-
class="focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md border border-gray-200 rounded-xl pt-4 w-full"
3+
@click.prevent="detailLink"
4+
class="focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md border border-gray-200 rounded-xl pt-4 w-full cursor-pointer"
55
>
66
<div class="flex justify-between items-center mb-2 px-4">
77
<div class="w-full flex items-center justify-between">
@@ -76,11 +76,11 @@
7676
}
7777
})
7878
79-
const detailLink = computed(() => {
79+
const detailLink = () => {
8080
setRepoTab({
8181
repoType: 'endpoint',
8282
tab: 'summary'
8383
})
84-
return `/endpoints/${props.endpoint.model_id}/${props.endpoint.deploy_id}?tab=summary`
85-
})
84+
window.location.href = `/endpoints/${props.endpoint.model_id}/${props.endpoint.deploy_id}?tab=summary`
85+
}
8686
</script>

frontend/src/components/shared/FinetuneItem.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<a
3-
:href="detailLink"
3+
@click.prevent="detailLink"
44
:class="`${repoType}-card hover:active-${repoType}-card `"
5-
class="focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md p-4 md:w-full border border-gray-200 rounded-xl"
5+
class="focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md p-4 md:w-full border border-gray-200 rounded-xl cursor-pointer"
66
>
77
<div class="flex items-center justify-between mb-1">
88
<div
@@ -47,11 +47,12 @@
4747
}
4848
})
4949
50-
const detailLink = computed(() => {
50+
const detailLink = () => {
5151
setRepoTab({
5252
repoType: 'finetune',
5353
tab: 'page'
5454
})
55-
return `/finetune/${props.repo.model_id}/${props.repo.deploy_name}/${props.repo.deploy_id}?tab=page`
56-
})
55+
56+
window.location.href = `/finetune/${props.repo.model_id}/${props.repo.deploy_name}/${props.repo.deploy_id}?tab=page`
57+
}
5758
</script>

frontend/src/components/shared/RepoItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
repoType === 'dataset' ? 'bg-gradient-to-r from-[#fbfaff] to-white' : '',
77
repoType === 'code' ? 'bg-gradient-to-r from-[#F9FAFA] to-white' : ''
88
]"
9-
class="flex flex-col justify-between focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md p-4 gap-1 md:w-full border border-gray-200 rounded-md flex-grow xl:basis-full min-w-[250px] xl:max-w-full h-fit"
9+
class="flex flex-col justify-between focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md p-4 gap-1 md:w-full border border-gray-200 rounded-md flex-grow xl:basis-full min-w-[250px] xl:max-w-full h-fit cursor-pointer"
1010
:style="isCollection ? 'width:100%' : ''"
1111
>
1212
<div class="flex items-center justify-between mb-1 gap-2 w-full">

internal/routes/collections.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import (
77
func registerCollectionRoutes(engine *gin.Engine, handlersRegistry *HandlersRegistry) {
88
engine.GET("/collections", handlersRegistry.RenderHandler.CollectionsHandler.Index)
99
engine.GET("/collections/new", handlersRegistry.RenderHandler.CollectionsHandler.New)
10+
engine.GET("/collections/:collections_id", handlersRegistry.RenderHandler.CollectionsHandler.Show)
1011
engine.GET("/collections/:collections_id/*path", handlersRegistry.RenderHandler.CollectionsHandler.Show)
1112
}

internal/routes/finetune.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
func registerFinetuneRoutes(engine *gin.Engine, handlersRegistry *HandlersRegistry) {
99
finetuneRoutes := engine.Group("/finetune")
1010
finetuneRoutes.Use(middleware.Instance.CheckCurrentUser())
11+
finetuneRoutes.GET("/:namespace/:model_name/:finetune_name/:finetune_id", handlersRegistry.RenderHandler.FinetuneHandler.Detail)
1112
finetuneRoutes.GET("/:namespace/:model_name/:finetune_name/:finetune_id/*path", handlersRegistry.RenderHandler.FinetuneHandler.Detail)
1213
finetuneRoutes.GET("/new", handlersRegistry.RenderHandler.FinetuneHandler.New)
1314
}

0 commit comments

Comments
 (0)