diff --git a/web/app/(commonLayout)/apps/AppCard.tsx b/web/app/(commonLayout)/apps/AppCard.tsx index deac127a40..f7adddc43f 100644 --- a/web/app/(commonLayout)/apps/AppCard.tsx +++ b/web/app/(commonLayout)/apps/AppCard.tsx @@ -2,7 +2,7 @@ import { useContext, useContextSelector } from 'use-context-selector' import { useRouter } from 'next/navigation' -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { RiBuildingLine, RiGlobalLine, RiLockLine, RiMoreFill } from '@remixicon/react' import cn from '@/utils/classnames' @@ -35,6 +35,7 @@ import Tooltip from '@/app/components/base/tooltip' import AccessControl from '@/app/components/app/app-access-control' import { AccessMode } from '@/models/access-control' import { useGlobalPublicStore } from '@/context/global-public-context' +import { formatTime } from '@/utils/time' export type AppCardProps = { app: App @@ -296,6 +297,15 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => { setTags(app.tags) }, [app.tags]) + const EditTimeText = useMemo(() => { + const timeText = formatTime({ + date: (app.updated_at || app.created_at) * 1000, + dateFormat: 'MM/DD/YYYY h:mm:ss', + }) + return `${t('datasetDocuments.segment.editedAt')} ${timeText}` + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [app.updated_at, app.created_at]) + return ( <>
{
-
+
{app.name}
-
{app.author_name}
-
- {app.mode === 'advanced-chat' &&
{t('app.types.advanced').toUpperCase()}
} - {app.mode === 'chat' &&
{t('app.types.chatbot').toUpperCase()}
} - {app.mode === 'agent-chat' &&
{t('app.types.agent').toUpperCase()}
} - {app.mode === 'workflow' &&
{t('app.types.workflow').toUpperCase()}
} - {app.mode === 'completion' &&
{t('app.types.completion').toUpperCase()}
} +
+
{app.author_name}
+
ยท
+
{EditTimeText}
diff --git a/web/types/app.ts b/web/types/app.ts index 243fb984be..e4227adbe9 100644 --- a/web/types/app.ts +++ b/web/types/app.ts @@ -350,6 +350,8 @@ export type App = { app_model_config: ModelConfig /** Timestamp of creation */ created_at: number + /** Timestamp of update */ + updated_at: number /** Web Application Configuration */ site: SiteConfig /** api site url */