Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix explore app icon (#11742)

Charlie.Wei5e2926a2075e
diff --git a/api/controllers/console/explore/recommended_app.py b/api/controllers/console/explore/recommended_app.py
index 5daaa1e7c38..baf1f591b94 100644
--- a/api/controllers/console/explore/recommended_app.py
+++ b/api/controllers/console/explore/recommended_app.py
@@ -4,6 +4,7 @@ from flask_restful import Resource, fields, marshal_with, reqparse
from constants.languages import languages
from controllers.console import api
from controllers.console.wraps import account_initialization_required
+from libs.helper import AppIconUrlField
from libs.login import login_required
from services.recommended_app_service import RecommendedAppService
@@ -12,6 +13,7 @@ app_fields = {
"name": fields.String,
"mode": fields.String,
"icon": fields.String,
+ "icon_url": AppIconUrlField,
"icon_background": fields.String,
}
diff --git a/api/services/recommend_app/database/database_retrieval.py b/api/services/recommend_app/database/database_retrieval.py
index 995d3755bb5..3295516cce6 100644
--- a/api/services/recommend_app/database/database_retrieval.py
+++ b/api/services/recommend_app/database/database_retrieval.py
@@ -57,13 +57,7 @@ class DatabaseRecommendAppRetrieval(RecommendAppRetrievalBase):
recommended_app_result = {
"id": recommended_app.id,
- "app": {
- "id": app.id,
- "name": app.name,
- "mode": app.mode,
- "icon": app.icon,
- "icon_background": app.icon_background,
- },
+ "app": recommended_app.app,
"app_id": recommended_app.app_id,
"description": site.description,
"copyright": site.copyright,
diff --git a/web/app/components/app/create-app-dialog/app-card/index.tsx b/web/app/components/app/create-app-dialog/app-card/index.tsx
index 254d67c923e..f1807941ee3 100644
--- a/web/app/components/app/create-app-dialog/app-card/index.tsx
+++ b/web/app/components/app/create-app-dialog/app-card/index.tsx
@@ -25,10 +25,10 @@ const AppCard = ({
<div className='relative shrink-0'>
<AppIcon
size='large'
- iconType={app.app.icon_type}
- icon={app.app.icon}
- background={app.app.icon_background}
- imageUrl={app.app.icon_url}
+ iconType={appBasicInfo.icon_type}
+ icon={appBasicInfo.icon}
+ background={appBasicInfo.icon_background}
+ imageUrl={appBasicInfo.icon_url}
/>
<AppTypeIcon wrapperClassName='absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-[4px] border border-divider-regular outline outline-components-panel-on-panel-item-bg'
className='w-3 h-3' type={appBasicInfo.mode} />
diff --git a/web/app/components/explore/app-card/index.tsx b/web/app/components/explore/app-card/index.tsx
index b1ea4a95bf9..f1826395f7f 100644
--- a/web/app/components/explore/app-card/index.tsx
+++ b/web/app/components/explore/app-card/index.tsx
@@ -28,10 +28,10 @@ const AppCard = ({
<div className='relative shrink-0'>
<AppIcon
size='large'
- iconType={app.app.icon_type}
- icon={app.app.icon}
- background={app.app.icon_background}
- imageUrl={app.app.icon_url}
+ iconType={appBasicInfo.icon_type}
+ icon={appBasicInfo.icon}
+ background={appBasicInfo.icon_background}
+ imageUrl={appBasicInfo.icon_url}
/>
<span className='absolute bottom-[-3px] right-[-3px] w-4 h-4 p-0.5 bg-white rounded border-[0.5px] border-[rgba(0,0,0,0.02)] shadow-sm'>
{appBasicInfo.mode === 'advanced-chat' && (