mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix mcp header (#6105)
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions
* fix mcp header * perf: del tip * secret type --------- Co-authored-by: archer <545436317@qq.com>
This commit is contained in:
parent
71936eeb1d
commit
285e2b5c93
|
|
@ -69,7 +69,8 @@
|
|||
"config_file_upload": "Click to Configure File Upload Rules",
|
||||
"config_question_guide": "Configuration guess you want to ask",
|
||||
"confirm_copy_app_tip": "The system will create an app with the same configuration for you, but permissions will not be copied. Please confirm!",
|
||||
"confirm_del_app_tip": "Confirm to delete this app? \nDeleting an app will delete its associated conversation records as well.",
|
||||
"confirm_del_app_tip": "Confirm to delete this Agent? \nDeleting an Agent will delete its associated conversation records as well.",
|
||||
"confirm_del_tool_tip": "Confirm to delete this tool? \nDeleting a tool will delete its associated conversation records, and the Agent that uses the tool may not function properly.",
|
||||
"confirm_delete_folder_tip": "When you delete this folder, all applications and corresponding chat records under it will be deleted.",
|
||||
"confirm_delete_tool": "Confirm to delete this tool?",
|
||||
"copilot_config_message": "Current Node Configuration Information: \n Code Type: {{codeType}} \n Current Code: \\\\`\\\\`\\\\`{{codeType}} \n{{code}} \\\\`\\\\`\\\\` \n Input Parameters: {{inputs}} \n Output Parameters: {{outputs}}",
|
||||
|
|
@ -184,9 +185,6 @@
|
|||
"log_detail": "Log details",
|
||||
"logs_all_feedback": "All feedback",
|
||||
"logs_all_records": "All Records",
|
||||
"logs_has_any_feedback": "Has Feedback",
|
||||
"logs_has_good_feedback": "Has Good Feedback",
|
||||
"logs_has_bad_feedback": "Has Bad Feedback",
|
||||
"logs_app_data": "Data board",
|
||||
"logs_app_result": "Application effect",
|
||||
"logs_average_response_time": "Average run time",
|
||||
|
|
@ -208,6 +206,9 @@
|
|||
"logs_export_title": "Time, source, user, contact, title, total number of messages, user good feedback, user bad feedback, custom feedback, labeled answers, conversation details",
|
||||
"logs_good_feedback": "Good Feedback",
|
||||
"logs_good_feedback_only": "Good Feedback Only",
|
||||
"logs_has_any_feedback": "Has Feedback",
|
||||
"logs_has_bad_feedback": "Has Bad Feedback",
|
||||
"logs_has_good_feedback": "Has Good Feedback",
|
||||
"logs_key_config": "Field Configuration",
|
||||
"logs_keys_annotatedCount": "Annotated Answer Count",
|
||||
"logs_keys_chatDetails": "Conversation details",
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@
|
|||
"config_file_upload": "点击配置文件上传规则",
|
||||
"config_question_guide": "配置猜你想问",
|
||||
"confirm_copy_app_tip": "系统将为您创建一个相同配置应用,但权限不会进行复制,请确认!",
|
||||
"confirm_del_app_tip": "确认删除该应用?删除应用会将其关联的对话记录一并删除。",
|
||||
"confirm_del_app_tip": "确认删除该 Agent?删除 Agent 会将其关联的对话记录一并删除。",
|
||||
"confirm_del_tool_tip": "确认删除该工具?删除工具会将其关联的对话记录一并删除,并且使用到该工具的 Agent 可能无法正常运行。",
|
||||
"confirm_delete_folder_tip": "删除该文件夹时,将会删除它下面所有应用及对应的聊天记录。",
|
||||
"confirm_delete_tool": "确认删除该工具?",
|
||||
"copilot_config_message": "`当前节点配置信息: \n代码类型:{{codeType}} \n当前代码: \\`\\`\\`{{codeType}} \n{{code}} \\`\\`\\` \n输入参数: {{inputs}} \n输出参数: {{outputs}}`",
|
||||
|
|
@ -188,9 +189,6 @@
|
|||
"log_detail": "日志详情",
|
||||
"logs_all_feedback": "全部反馈",
|
||||
"logs_all_records": "全部记录",
|
||||
"logs_has_any_feedback": "包含反馈",
|
||||
"logs_has_good_feedback": "包含赞",
|
||||
"logs_has_bad_feedback": "包含踩",
|
||||
"logs_app_data": "数据看板",
|
||||
"logs_app_result": "应用效果",
|
||||
"logs_average_response_time": "平均运行时长(s)",
|
||||
|
|
@ -212,6 +210,9 @@
|
|||
"logs_export_title": "时间,来源,使用者,联系方式,标题,消息总数,用户赞同反馈,用户反对反馈,自定义反馈,标注答案,对话详情",
|
||||
"logs_good_feedback": "点赞",
|
||||
"logs_good_feedback_only": "仅看赞",
|
||||
"logs_has_any_feedback": "包含反馈",
|
||||
"logs_has_bad_feedback": "包含踩",
|
||||
"logs_has_good_feedback": "包含赞",
|
||||
"logs_key_config": "字段配置",
|
||||
"logs_keys_annotatedCount": "标注答案数量",
|
||||
"logs_keys_chatDetails": "对话详情",
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@
|
|||
"config_file_upload": "點選設定檔案上傳規則",
|
||||
"config_question_guide": "設定猜你想問",
|
||||
"confirm_copy_app_tip": "系統將為您建立一個相同設定的應用程式,但權限不會複製,請確認!",
|
||||
"confirm_del_app_tip": "確認刪除該應用?\n刪除應用會將其關聯的對話記錄一併刪除。",
|
||||
"confirm_del_app_tip": "確認刪除該 Agent?\n刪除 Agent 會將其關聯的對話記錄一併刪除。",
|
||||
"confirm_del_tool_tip": "確認刪除該工具?\n刪除工具會將其關聯的對話記錄一併刪除,並且使用到該工具的 Agent 可能無法正常運行。",
|
||||
"confirm_delete_folder_tip": "刪除該文件夾時,將會刪除它下面所有應用及對應的聊天記錄。",
|
||||
"confirm_delete_tool": "確認刪除該工具?",
|
||||
"copilot_config_message": "當前節點配置信息: \n代碼類型:{{codeType}} \n當前代碼: \\\\`\\\\`\\\\`{{codeType}} \n{{code}} \\\\`\\\\`\\\\` \n輸入參數: {{inputs}} \n輸出參數: {{outputs}}",
|
||||
|
|
@ -183,9 +184,6 @@
|
|||
"log_detail": "日誌詳情",
|
||||
"logs_all_feedback": "全部反饋",
|
||||
"logs_all_records": "全部記錄",
|
||||
"logs_has_any_feedback": "包含反饋",
|
||||
"logs_has_good_feedback": "包含贊",
|
||||
"logs_has_bad_feedback": "包含踩",
|
||||
"logs_app_data": "數據看板",
|
||||
"logs_app_result": "應用效果",
|
||||
"logs_average_response_time": "平均運行時長",
|
||||
|
|
@ -207,6 +205,9 @@
|
|||
"logs_export_title": "時間,來源,使用者,聯絡方式,標題,訊息總數,使用者贊同回饋,使用者反對回饋,自定義回饋,標註答案,對話詳細資訊",
|
||||
"logs_good_feedback": "好評",
|
||||
"logs_good_feedback_only": "僅好評",
|
||||
"logs_has_any_feedback": "包含反饋",
|
||||
"logs_has_bad_feedback": "包含踩",
|
||||
"logs_has_good_feedback": "包含贊",
|
||||
"logs_key_config": "字段配置",
|
||||
"logs_keys_annotatedCount": "標記答案數量",
|
||||
"logs_keys_chatDetails": "對話詳情",
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ const AuthValueDisplay = ({
|
|||
};
|
||||
|
||||
export const getSecretType = (config: HeaderSecretConfigType): HeaderSecretTypeEnum => {
|
||||
if (config.Bearer) {
|
||||
if (config.Bearer && (config.Bearer.secret || config.Bearer.value)) {
|
||||
return HeaderSecretTypeEnum.Bearer;
|
||||
} else if (config.Basic) {
|
||||
} else if (config.Basic && (config.Basic.secret || config.Basic.value)) {
|
||||
return HeaderSecretTypeEnum.Basic;
|
||||
} else if (config.customs && config.customs.length > 0) {
|
||||
return HeaderSecretTypeEnum.Custom;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import type { StoreNodeItemType } from '@fastgpt/global/core/workflow/type/node'
|
|||
import type { StoreEdgeItemType } from '@fastgpt/global/core/workflow/type/edge';
|
||||
import { AppErrEnum } from '@fastgpt/global/common/error/code/app';
|
||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||
import { AppTypeList } from '@fastgpt/global/core/app/constants';
|
||||
|
||||
const InfoModal = dynamic(() => import('./InfoModal'));
|
||||
const TagsEditModal = dynamic(() => import('./TagsEditModal'));
|
||||
|
|
@ -184,9 +185,10 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
|
|||
}
|
||||
);
|
||||
|
||||
const isAgent = AppTypeList.includes(appDetail.type);
|
||||
const { openConfirm: openConfirmDel, ConfirmModal: ConfirmDelModal } = useConfirm({
|
||||
content: t('app:confirm_del_app_tip', { name: appDetail.name }),
|
||||
type: 'delete'
|
||||
type: 'delete',
|
||||
content: isAgent ? t('app:confirm_del_app_tip') : t('app:confirm_del_tool_tip')
|
||||
});
|
||||
const { runAsync: deleteApp } = useRequest2(
|
||||
async () => {
|
||||
|
|
@ -199,7 +201,7 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
|
|||
localStorage.removeItem(`app_log_keys_${appId}`);
|
||||
});
|
||||
|
||||
router.replace(`/dashboard/agent`);
|
||||
router.replace(isAgent ? `/dashboard/agent` : `/dashboard/tool`);
|
||||
},
|
||||
successToast: t('common:delete_success'),
|
||||
errorToast: t('common:delete_failed')
|
||||
|
|
@ -209,9 +211,9 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
|
|||
() =>
|
||||
openConfirmDel({
|
||||
onConfirm: deleteApp,
|
||||
customContent: t('app:confirm_del_app_tip', { name: appDetail.name })
|
||||
inputConfirmText: appDetail.name
|
||||
})(),
|
||||
[appDetail.name, deleteApp, openConfirmDel, t]
|
||||
[deleteApp, openConfirmDel, appDetail.name]
|
||||
);
|
||||
|
||||
const contextValue: AppContextType = useMemo(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ import MyBox from '@fastgpt/web/components/common/MyBox';
|
|||
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
|
||||
import { useContextSelector } from 'use-context-selector';
|
||||
import { AppListContext } from './context';
|
||||
import { AppFolderTypeList, AppTypeEnum, ToolTypeList } from '@fastgpt/global/core/app/constants';
|
||||
import {
|
||||
AppFolderTypeList,
|
||||
AppTypeEnum,
|
||||
AppTypeList,
|
||||
ToolTypeList
|
||||
} from '@fastgpt/global/core/app/constants';
|
||||
import { useFolderDrag } from '@/components/common/folder/useFolderDrag';
|
||||
import dynamic from 'next/dynamic';
|
||||
import type { EditResourceInfoFormType } from '@/components/common/Modal/EditResourceModal';
|
||||
|
|
@ -35,7 +40,6 @@ import { ReadRoleVal } from '@fastgpt/global/support/permission/constant';
|
|||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||
import { getWebReqUrl } from '@fastgpt/web/common/system/utils';
|
||||
import { createAppTypeMap } from '@/pageComponents/app/constants';
|
||||
import { type CreateAppType } from '@/pages/dashboard/create';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
|
||||
|
||||
|
|
@ -183,6 +187,9 @@ const List = () => {
|
|||
>
|
||||
{hasCreatePer ? <ListCreateButton appType={appType} /> : <ForbiddenCreateButton />}
|
||||
{myApps.map((app, index) => {
|
||||
const isAgent = AppTypeList.includes(app.type);
|
||||
const isTool = ToolTypeList.includes(app.type);
|
||||
const isFolder = AppFolderTypeList.includes(app.type);
|
||||
return (
|
||||
<MyTooltip
|
||||
key={app._id}
|
||||
|
|
@ -416,10 +423,13 @@ const List = () => {
|
|||
openConfirmDel({
|
||||
onConfirm: () => onclickDelApp(app._id),
|
||||
inputConfirmText: app.name,
|
||||
customContent:
|
||||
app.type === AppTypeEnum.folder
|
||||
? t('app:confirm_delete_folder_tip')
|
||||
: t('app:confirm_del_app_tip')
|
||||
customContent: (() => {
|
||||
if (isFolder)
|
||||
return t('app:confirm_delete_folder_tip');
|
||||
if (isAgent) return t('app:confirm_del_app_tip');
|
||||
if (isTool) return t('app:confirm_del_tool_tip');
|
||||
return t('app:confirm_del_app_tip');
|
||||
})()
|
||||
})()
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import MyImage from '@fastgpt/web/components/common/Image/MyImage';
|
|||
import LeftRadio from '@fastgpt/web/components/common/Radio/LeftRadio';
|
||||
import HeaderAuthForm from '@/components/common/secret/HeaderAuthForm';
|
||||
import { getMCPTools, postCreateHttpTools, postCreateMCPTools } from '@/web/core/app/api/tool';
|
||||
import { headerValue2StoreHeader } from '@/components/common/secret/HeaderAuthConfig';
|
||||
import type { McpToolConfigType } from '@fastgpt/global/core/app/tool/mcpTool/type';
|
||||
import AppTypeCard from '@/pageComponents/app/create/AppTypeCard';
|
||||
import type { StoreSecretValueType } from '@fastgpt/global/common/secret/type';
|
||||
|
|
@ -133,10 +134,11 @@ const CreateAppsPage = () => {
|
|||
};
|
||||
|
||||
if (appType === AppTypeEnum.mcpToolSet) {
|
||||
const headerSecret = headerValue2StoreHeader(mcpHeaderSecret || {});
|
||||
return postCreateMCPTools({
|
||||
...baseParams,
|
||||
url: mcpUrl || '',
|
||||
headerSecret: mcpHeaderSecret || {},
|
||||
headerSecret,
|
||||
toolList: (mcpToolList || []) as McpToolConfigType[]
|
||||
});
|
||||
}
|
||||
|
|
@ -421,9 +423,10 @@ const CreateAppsPage = () => {
|
|||
h={8}
|
||||
isLoading={isGettingMCPTools}
|
||||
onClick={() => {
|
||||
const headerSecret = headerValue2StoreHeader(mcpHeaderSecret || {});
|
||||
runGetMCPTools({
|
||||
url: mcpUrl || '',
|
||||
headerSecret: mcpHeaderSecret
|
||||
headerSecret
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue