mirror of
https://github.com/langgenius/dify.git
synced 2026-06-08 09:27:39 +08:00
fix: format agent roster updated time
This commit is contained in:
@ -5,6 +5,7 @@ import { Button } from '@langgenius/dify-ui/button'
|
||||
import { cn } from '@langgenius/dify-ui/cn'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { SkeletonRectangle } from '@/app/components/base/skeleton'
|
||||
import useTimestamp from '@/hooks/use-timestamp'
|
||||
import Link from '@/next/link'
|
||||
import { ArchiveAgentButton } from './archive-agent-button'
|
||||
import { EditAgentDialog } from './edit-agent-dialog'
|
||||
@ -64,8 +65,12 @@ function AgentRosterItem({
|
||||
}: {
|
||||
agent: AgentRosterResponse
|
||||
}) {
|
||||
const { t: tAgentV2 } = useTranslation('agentV2')
|
||||
const { t } = useTranslation('agentV2')
|
||||
const { formatTime } = useTimestamp()
|
||||
const version = agent.active_config_snapshot?.version
|
||||
const updatedAt = agent.updated_at != null
|
||||
? formatTime(agent.updated_at, t('roster.dateTimeFormat'))
|
||||
: null
|
||||
|
||||
return (
|
||||
<article className="group flex min-h-20 min-w-0 flex-col gap-3 rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg p-3 shadow-xs shadow-shadow-shadow-3 transition-colors hover:bg-components-panel-on-panel-item-bg-hover sm:flex-row sm:items-center">
|
||||
@ -104,14 +109,14 @@ function AgentRosterItem({
|
||||
<div className="hidden min-w-32 items-center gap-2 xl:flex">
|
||||
<span aria-hidden className="i-ri-git-branch-line size-3.5 text-text-tertiary" />
|
||||
<span className="rounded-md border-[0.5px] border-components-panel-border bg-components-badge-bg-dimm px-2 py-1 system-xs-medium text-text-secondary">
|
||||
{tAgentV2(getSourceLabelKey(agent.source))}
|
||||
{t(getSourceLabelKey(agent.source))}
|
||||
</span>
|
||||
</div>
|
||||
<div className="hidden w-40 shrink-0 text-right system-xs-regular text-text-tertiary lg:block">
|
||||
<span className={agent.status === 'active' ? 'text-text-success' : 'text-text-tertiary'}>
|
||||
{tAgentV2(`roster.status.${agent.status}`)}
|
||||
{t(`roster.status.${agent.status}`)}
|
||||
</span>
|
||||
{agent.updated_at && <div className="truncate">{agent.updated_at}</div>}
|
||||
{updatedAt && <div className="truncate">{updatedAt}</div>}
|
||||
</div>
|
||||
</Link>
|
||||
<div className="flex w-full shrink-0 items-center justify-end gap-2 sm:w-auto sm:pl-2">
|
||||
|
||||
@ -101,6 +101,7 @@
|
||||
"roster.createForm.namePlaceholder": "Enter agent name…",
|
||||
"roster.createForm.nameRequired": "Name is required.",
|
||||
"roster.createSuccess": "Agent created.",
|
||||
"roster.dateTimeFormat": "MM/DD/YYYY hh:mm:ss A",
|
||||
"roster.description": "Agents saved to this workspace are listed here. Create, search, edit, and archive roster agents from one place.",
|
||||
"roster.editAgent": "Edit {{name}}",
|
||||
"roster.editDialog.description": "Update the roster name and description for this agent.",
|
||||
|
||||
@ -101,6 +101,7 @@
|
||||
"roster.createForm.namePlaceholder": "输入智能体名称…",
|
||||
"roster.createForm.nameRequired": "请输入名称。",
|
||||
"roster.createSuccess": "智能体已创建。",
|
||||
"roster.dateTimeFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"roster.description": "这里列出保存在当前工作区的智能体。你可以在一个地方创建、搜索、编辑和归档 Roster 智能体。",
|
||||
"roster.editAgent": "编辑 {{name}}",
|
||||
"roster.editDialog.description": "更新此智能体在 Roster 中的名称和描述。",
|
||||
|
||||
Reference in New Issue
Block a user