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" >