mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-03 06:12:14 +08:00
feat: add tooltip for installation
This commit is contained in:
@@ -50,8 +50,11 @@ import { useI18n } from "@/core/i18n/hooks";
|
||||
import { installSkill } from "@/core/skills/api";
|
||||
import { streamdownPlugins } from "@/core/streamdown";
|
||||
import { checkCodeFile, getFileName } from "@/core/utils/files";
|
||||
import { env } from "@/env";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
import { Tooltip } from "../tooltip";
|
||||
|
||||
import { useArtifacts } from "./context";
|
||||
|
||||
export function ArtifactFileDetail({
|
||||
@@ -130,7 +133,7 @@ export function ArtifactFileDetail({
|
||||
if (result.success) {
|
||||
toast.success(result.message);
|
||||
} else {
|
||||
toast.error(result.message || "Failed to install skill");
|
||||
toast.error(result.message ?? "Failed to install skill");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to install skill:", error);
|
||||
@@ -188,13 +191,18 @@ export function ArtifactFileDetail({
|
||||
<div className="flex items-center gap-2">
|
||||
<ArtifactActions>
|
||||
{!isWriteFile && filepath.endsWith(".skill") && (
|
||||
<ArtifactAction
|
||||
icon={isInstalling ? LoaderIcon : PackageIcon}
|
||||
label={t.common.install}
|
||||
tooltip={t.common.install}
|
||||
disabled={isInstalling}
|
||||
onClick={handleInstallSkill}
|
||||
/>
|
||||
<Tooltip content={t.toolCalls.skillInstallTooltip}>
|
||||
<ArtifactAction
|
||||
icon={isInstalling ? LoaderIcon : PackageIcon}
|
||||
label={t.common.install}
|
||||
tooltip={t.common.install}
|
||||
disabled={
|
||||
isInstalling ||
|
||||
env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY === "true"
|
||||
}
|
||||
onClick={handleInstallSkill}
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
{!isWriteFile && (
|
||||
<a href={urlOfArtifact({ filepath, threadId })} target="_blank">
|
||||
|
||||
@@ -118,6 +118,7 @@ export const enUS: Translations = {
|
||||
readFile: "Read file",
|
||||
writeFile: "Write file",
|
||||
writeTodos: "Update to-do list",
|
||||
skillInstallTooltip: "Install skill and make it available to DeerFlow",
|
||||
},
|
||||
|
||||
// Settings
|
||||
|
||||
@@ -111,6 +111,7 @@ export interface Translations {
|
||||
readFile: string;
|
||||
writeFile: string;
|
||||
writeTodos: string;
|
||||
skillInstallTooltip: string;
|
||||
};
|
||||
|
||||
// Settings
|
||||
|
||||
@@ -115,6 +115,7 @@ export const zhCN: Translations = {
|
||||
readFile: "读取文件",
|
||||
writeFile: "写入文件",
|
||||
writeTodos: "更新 To-do 列表",
|
||||
skillInstallTooltip: "安装技能并使其可在 DeerFlow 中使用",
|
||||
},
|
||||
|
||||
// Settings
|
||||
|
||||
Reference in New Issue
Block a user