mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 23:32:48 +00:00
fix: Add tool from tool store
This commit is contained in:
parent
73ab7214eb
commit
880697bf35
|
|
@ -340,7 +340,7 @@ class ToolView(APIView):
|
|||
tags=[_("Tool")] # type: ignore
|
||||
)
|
||||
@has_permissions(
|
||||
PermissionConstants.TOOL_CREATE.get_workspace_tool_permission(),
|
||||
PermissionConstants.TOOL_CREATE.get_workspace_permission(),
|
||||
PermissionConstants.TOOL_CREATE.get_workspace_permission_workspace_manage_role(),
|
||||
RoleConstants.WORKSPACE_MANAGE.get_workspace_role(),
|
||||
RoleConstants.USER.get_workspace_role(),
|
||||
|
|
|
|||
|
|
@ -68,8 +68,9 @@ import ToolCard from './ToolCard.vue'
|
|||
import { MsgSuccess } from '@/utils/message'
|
||||
import InternalDescDrawer from './InternalDescDrawer.vue'
|
||||
import AddInternalToolDialog from './AddInternalToolDialog.vue'
|
||||
import {loadSharedApi} from "@/utils/dynamics-api/shared-api.ts";
|
||||
|
||||
import { loadSharedApi } from "@/utils/dynamics-api/shared-api.ts";
|
||||
import useStore from '@/stores'
|
||||
const { user } = useStore()
|
||||
interface ToolCategory {
|
||||
id: string
|
||||
title: string
|
||||
|
|
@ -148,7 +149,7 @@ async function getList() {
|
|||
// if (category.id === 'recommend') {
|
||||
// category.tools = res.data
|
||||
// } else {
|
||||
category.tools = res.data.filter((tool: any) => tool.label === category.id)
|
||||
category.tools = res.data.filter((tool: any) => tool.label === category.id)
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
|
@ -179,6 +180,9 @@ async function handleAdd(tool: any) {
|
|||
try {
|
||||
await loadSharedApi({ type: 'tool', systemType: props.apiType })
|
||||
.addInternalTool(tool.id, { name: tool.name, folder_id: folderId.value }, addLoading)
|
||||
.then(() => {
|
||||
return user.profile()
|
||||
})
|
||||
// await ToolStoreApi.addInternalTool(tool.id, { name: tool.name, folder_id: folderId.value }, addLoading)
|
||||
emit('refresh')
|
||||
MsgSuccess(t('common.addSuccess'))
|
||||
|
|
@ -200,6 +204,7 @@ defineExpose({ open })
|
|||
|
||||
.dialog-header {
|
||||
position: relative;
|
||||
|
||||
.store-type {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
|
|
|||
Loading…
Reference in New Issue