mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 11:04:27 +08:00
feat(web): snippet card usage info
This commit is contained in:
parent
b3acf83090
commit
7e3027b5f7
@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { SnippetListItem } from '@/types/snippet'
|
import type { SnippetListItem } from '@/types/snippet'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
import AppIcon from '@/app/components/base/app-icon'
|
import AppIcon from '@/app/components/base/app-icon'
|
||||||
import Link from '@/next/link'
|
import Link from '@/next/link'
|
||||||
|
|
||||||
@ -9,6 +10,8 @@ type Props = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SnippetCard = ({ snippet }: Props) => {
|
const SnippetCard = ({ snippet }: Props) => {
|
||||||
|
const { t } = useTranslation('snippet')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/snippets/${snippet.id}/orchestrate`} className="group col-span-1">
|
<Link href={`/snippets/${snippet.id}/orchestrate`} className="group col-span-1">
|
||||||
<article className="relative inline-flex h-[160px] w-full flex-col rounded-xl border border-components-card-border bg-components-card-bg shadow-sm transition-all duration-200 ease-in-out hover:-translate-y-0.5 hover:shadow-lg">
|
<article className="relative inline-flex h-[160px] w-full flex-col rounded-xl border border-components-card-border bg-components-card-bg shadow-sm transition-all duration-200 ease-in-out hover:-translate-y-0.5 hover:shadow-lg">
|
||||||
@ -43,7 +46,7 @@ const SnippetCard = ({ snippet }: Props) => {
|
|||||||
{!snippet.is_published && (
|
{!snippet.is_published && (
|
||||||
<>
|
<>
|
||||||
<span>·</span>
|
<span>·</span>
|
||||||
<span className="truncate">{snippet.use_count}</span>
|
<span className="truncate">{t('usageCount', { count: snippet.use_count })}</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,5 +17,6 @@
|
|||||||
"sectionEvaluation": "Evaluation",
|
"sectionEvaluation": "Evaluation",
|
||||||
"sectionOrchestrate": "Orchestrate",
|
"sectionOrchestrate": "Orchestrate",
|
||||||
"testRunButton": "Test run",
|
"testRunButton": "Test run",
|
||||||
|
"usageCount": "Used {{count}} times",
|
||||||
"variableInspect": "Variable Inspect"
|
"variableInspect": "Variable Inspect"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,5 +17,6 @@
|
|||||||
"sectionEvaluation": "评测",
|
"sectionEvaluation": "评测",
|
||||||
"sectionOrchestrate": "编排",
|
"sectionOrchestrate": "编排",
|
||||||
"testRunButton": "测试运行",
|
"testRunButton": "测试运行",
|
||||||
|
"usageCount": "已使用 {{count}} 次",
|
||||||
"variableInspect": "变量查看"
|
"variableInspect": "变量查看"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user