mirror of https://github.com/langgenius/dify.git
optimize app list desc
This commit is contained in:
parent
133d52deb9
commit
7762737796
|
|
@ -64,7 +64,7 @@ model_config_partial_fields = {
|
|||
app_partial_fields = {
|
||||
'id': fields.String,
|
||||
'name': fields.String,
|
||||
'description': fields.String,
|
||||
'description': fields.String(attribute='desc_or_prompt'),
|
||||
'mode': fields.String,
|
||||
'icon': fields.String,
|
||||
'icon_background': fields.String,
|
||||
|
|
|
|||
|
|
@ -76,6 +76,17 @@ class App(db.Model):
|
|||
created_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))
|
||||
updated_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))
|
||||
|
||||
@property
|
||||
def desc_or_prompt(self):
|
||||
if self.description:
|
||||
return self.description
|
||||
else:
|
||||
app_model_config = self.app_model_config
|
||||
if app_model_config:
|
||||
return app_model_config.pre_prompt
|
||||
else:
|
||||
return ''
|
||||
|
||||
@property
|
||||
def site(self):
|
||||
site = db.session.query(Site).filter(Site.app_id == self.id).first()
|
||||
|
|
|
|||
Loading…
Reference in New Issue