Skip to content

Commit

Permalink
ENH: [UI] Update Button Style and Interaction Logic for Editing Cache…
Browse files Browse the repository at this point in the history
… in Model Card. (xorbitsai#2746)
  • Loading branch information
yiboyasss authored Jan 9, 2025
1 parent 7a9153e commit 7982ec2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions xinference/web/ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"vision": "vl-chat",
"status": "Status",
"cached": "Cached",
"manageCachedModels": "Manage Cached Models",
"favorite": "Favorite",
"unfavorite": "Unfavorite",
"search": "Search for model name and description",
Expand Down
1 change: 1 addition & 0 deletions xinference/web/ui/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"vision": "视觉聊天",
"status": "状态",
"cached": "已缓存",
"manageCachedModels": "管理缓存模型",
"favorite": "收藏",
"unfavorite": "取消收藏",
"search": "搜索模型名称和描述",
Expand Down
30 changes: 27 additions & 3 deletions xinference/web/ui/src/scenes/launch_model/modelCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,15 @@ const ModelCard = ({
(() => {
return modelData.model_lang.map((v) => {
return (
<Chip key={v} label={v} variant="outlined" size="small" />
<Chip
key={v}
label={v}
variant="outlined"
size="small"
onClick={(e) => {
e.stopPropagation()
}}
/>
)
})
})()}
Expand All @@ -859,11 +867,16 @@ const ModelCard = ({
) {
return (
<Chip
label={t('launchModel.cached')}
label={t('launchModel.manageCachedModels')}
variant="outlined"
color="primary"
size="small"
deleteIcon={<EditNote />}
onDelete={handleOpenCachedList}
onClick={(e) => {
e.stopPropagation()
handleOpenCachedList()
}}
/>
)
}
Expand Down Expand Up @@ -1019,6 +1032,9 @@ const ModelCard = ({
label={v}
variant="outlined"
size="small"
onClick={(e) => {
e.stopPropagation()
}}
/>
)
})
Expand All @@ -1028,6 +1044,9 @@ const ModelCard = ({
label={modelData.model_family}
variant="outlined"
size="small"
onClick={(e) => {
e.stopPropagation()
}}
/>
)
}
Expand All @@ -1036,11 +1055,16 @@ const ModelCard = ({
if (modelData.cache_status) {
return (
<Chip
label={t('launchModel.cached')}
label={t('launchModel.manageCachedModels')}
variant="outlined"
color="primary"
size="small"
deleteIcon={<EditNote />}
onDelete={handleOpenCachedList}
onClick={(e) => {
e.stopPropagation()
handleOpenCachedList()
}}
/>
)
}
Expand Down

0 comments on commit 7982ec2

Please sign in to comment.