Use KBID of KB

This commit is contained in:
Xin Wang
2026-02-10 13:23:24 +08:00
parent bad0206478
commit d2aaba999b

View File

@@ -34,7 +34,7 @@ export const KnowledgeBasePage: React.FC = () => {
const copyKbId = async (id: string) => {
try {
await navigator.clipboard.writeText(id);
alert(`已复制 KB ID: ${id}`);
alert(`已复制 KBID: ${id}`);
} catch (error) {
console.error(error);
alert('复制失败,请手动复制。');
@@ -310,10 +310,10 @@ export const KnowledgeBasePage: React.FC = () => {
</div>
<h3 className="text-lg font-semibold group-hover:text-primary transition-colors text-white">{kb.name}</h3>
<div className="mt-1 flex items-center gap-2 text-xs text-muted-foreground">
<span className="font-mono">KB ID: {kb.id}</span>
<span className="font-mono">KBID: {kb.id}</span>
<button
className="inline-flex items-center justify-center rounded p-1 hover:bg-white/10 transition-colors"
title="复制 KB ID"
title="复制 KBID"
onClick={(e) => {
e.stopPropagation();
void copyKbId(kb.id);
@@ -556,13 +556,13 @@ const KnowledgeBaseDetail: React.FC<{
<div>
<div className="flex items-center gap-2">
<h1 className="text-2xl font-bold text-white">{kb.name}</h1>
<span className="font-mono text-xs text-muted-foreground">KB ID: {kb.id}</span>
<span className="font-mono text-xs text-muted-foreground">KBID: {kb.id}</span>
<button
className="inline-flex items-center justify-center rounded p-1 hover:bg-white/10 transition-colors text-muted-foreground"
title="复制 KB ID"
title="复制 KBID"
onClick={() => {
void navigator.clipboard.writeText(kb.id)
.then(() => alert(`已复制 KB ID: ${kb.id}`))
.then(() => alert(`已复制 KBID: ${kb.id}`))
.catch((error) => {
console.error(error);
alert('复制失败,请手动复制。');