diff --git a/api/fields/app_fields.py b/api/fields/app_fields.py index 416870cafa..de61094415 100644 --- a/api/fields/app_fields.py +++ b/api/fields/app_fields.py @@ -100,6 +100,7 @@ app_partial_fields = { "updated_at": TimestampField, "tags": fields.List(fields.Nested(tag_fields)), "access_mode": fields.String, + "create_user_name": fields.String, } diff --git a/api/models/model.py b/api/models/model.py index ee79fbd6b5..802157b8cf 100644 --- a/api/models/model.py +++ b/api/models/model.py @@ -294,6 +294,15 @@ class App(Base): return tags or [] + @property + def create_user_name(self): + if self.created_by: + account = db.session.query(Account).filter(Account.id == self.created_by).first() + if account: + return account.name + + return None + class AppModelConfig(Base): __tablename__ = "app_model_configs" diff --git a/web/app/(commonLayout)/apps/AppCard.tsx b/web/app/(commonLayout)/apps/AppCard.tsx index 468c8244c0..7829df70bf 100644 --- a/web/app/(commonLayout)/apps/AppCard.tsx +++ b/web/app/(commonLayout)/apps/AppCard.tsx @@ -317,8 +317,9 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
-
+
{app.name}
+
{app.create_user_name}
{app.mode === 'advanced-chat' &&
{t('app.types.advanced').toUpperCase()}
} diff --git a/web/types/app.ts b/web/types/app.ts index a6d2faea55..e6ba9a2386 100644 --- a/web/types/app.ts +++ b/web/types/app.ts @@ -316,6 +316,8 @@ export type App = { name: string /** Description */ description: string + /** UserName */ + create_user_name: string; /** * Icon Type