From 285e274818eb05f88c8bc1b44f0ee011b76a8e90 Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 10 Nov 2025 10:05:59 +0800 Subject: [PATCH] fix: display image menu --- config/routes.ts | 10 +++ src/components/drop-down-actions/index.tsx | 3 + src/components/page-tools/index.tsx | 12 ++- src/layouts/index.tsx | 1 + src/locales/en-US/models.ts | 4 +- src/locales/ja-JP/models.ts | 8 +- src/locales/ru-RU/models.ts | 4 +- src/locales/zh-CN/models.ts | 4 +- src/pages/backends/index.tsx | 2 - src/pages/cluster-management/clusters.tsx | 2 - .../components/worker-pools.tsx | 2 - src/pages/cluster-management/credentials.tsx | 1 - src/pages/llmodels/catalog.tsx | 76 ++++++------------- src/pages/llmodels/components/table-list.tsx | 1 - src/pages/llmodels/config/index.ts | 1 + src/pages/llmodels/forms/catalog.tsx | 6 +- src/pages/llmodels/forms/index.tsx | 12 ++- src/pages/playground/hooks/config.ts | 13 +++- src/pages/playground/hooks/use-init-meta.ts | 2 + src/pages/playground/images.tsx | 3 +- src/pages/playground/index.tsx | 3 +- src/pages/playground/speech.tsx | 2 +- src/pages/resources/components/gpus.tsx | 2 - .../components/worker-detail-content.tsx | 2 - src/pages/resources/components/workers.tsx | 1 - 25 files changed, 91 insertions(+), 86 deletions(-) diff --git a/config/routes.ts b/config/routes.ts index 400e0cdd..c78b1006 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -54,6 +54,16 @@ export default [ defaultIcon: 'icon-reranker', component: './playground/rerank' }, + { + name: 'text2images', + title: 'Text2Images', + path: keepAliveRoutes.text2images, + key: 'text2images', + icon: 'icon-image1', + selectedIcon: 'icon-image-filled', + defaultIcon: 'icon-image1', + component: './playground/images' + }, { name: 'speech', title: 'Speech', diff --git a/src/components/drop-down-actions/index.tsx b/src/components/drop-down-actions/index.tsx index 51e3f444..68b35f64 100644 --- a/src/components/drop-down-actions/index.tsx +++ b/src/components/drop-down-actions/index.tsx @@ -16,6 +16,9 @@ const DropDownActions: React.FC = (props) => { const items = useMemo(() => { return menu?.items?.map((item: any) => ({ ..._.omit(item, 'locale'), + icon: item.icon + ? React.cloneElement(item.icon, { style: { fontSize: 14 } }) + : null, label: item.locale ? intl.formatMessage({ id: item.label }) : item.label })); }, [menu?.items, intl]); diff --git a/src/components/page-tools/index.tsx b/src/components/page-tools/index.tsx index d249020b..c6add1ae 100644 --- a/src/components/page-tools/index.tsx +++ b/src/components/page-tools/index.tsx @@ -86,8 +86,8 @@ export const FilterBar: React.FC = (props) => { handleInputChange, handleSelectChange, handleSearch, - handleDeleteByBatch, - handleClickPrimary, + handleDeleteByBatch = null, + handleClickPrimary = null, rowSelection, actionItems = [], selectOptions, @@ -99,8 +99,6 @@ export const FilterBar: React.FC = (props) => { marginTop = 10, inputHolder, selectHolder, - showPrimaryButton = true, - showDeleteButton = true, right, left, width @@ -108,12 +106,12 @@ export const FilterBar: React.FC = (props) => { const intl = useIntl(); const renderRight = useMemo(() => { - if (!showPrimaryButton && !showDeleteButton) { + if (!handleClickPrimary && !handleDeleteByBatch) { return null; } return ( - {showPrimaryButton ? ( + {handleClickPrimary ? ( actionType === 'dropdown' ? ( = (props) => { ) ) : null} - {showDeleteButton && ( + {handleDeleteByBatch && ( - - } - > + buttonText={intl.formatMessage({ id: 'models.catalog.button.explore' })} + handleSearch={handleSearch} + handleSelectChange={handleCategoryChange} + handleClickPrimary={handleDeployFromOtherHubs} + handleInputChange={handleNameChange} + selectOptions={categoryOptions} + buttonIcon={} + width={{ input: 230, select: 200 }} + > = ({ items: sourceOptions, onClick: handleClickDropdown }} - trigger={['hover']} placement="bottomRight" >