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