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
|
tags=[_("Tool")] # type: ignore
|
||||||
)
|
)
|
||||||
@has_permissions(
|
@has_permissions(
|
||||||
PermissionConstants.TOOL_CREATE.get_workspace_tool_permission(),
|
PermissionConstants.TOOL_CREATE.get_workspace_permission(),
|
||||||
PermissionConstants.TOOL_CREATE.get_workspace_permission_workspace_manage_role(),
|
PermissionConstants.TOOL_CREATE.get_workspace_permission_workspace_manage_role(),
|
||||||
RoleConstants.WORKSPACE_MANAGE.get_workspace_role(),
|
RoleConstants.WORKSPACE_MANAGE.get_workspace_role(),
|
||||||
RoleConstants.USER.get_workspace_role(),
|
RoleConstants.USER.get_workspace_role(),
|
||||||
|
|||||||
@ -68,8 +68,9 @@ import ToolCard from './ToolCard.vue'
|
|||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
import InternalDescDrawer from './InternalDescDrawer.vue'
|
import InternalDescDrawer from './InternalDescDrawer.vue'
|
||||||
import AddInternalToolDialog from './AddInternalToolDialog.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 {
|
interface ToolCategory {
|
||||||
id: string
|
id: string
|
||||||
title: string
|
title: string
|
||||||
@ -148,7 +149,7 @@ async function getList() {
|
|||||||
// if (category.id === 'recommend') {
|
// if (category.id === 'recommend') {
|
||||||
// category.tools = res.data
|
// category.tools = res.data
|
||||||
// } else {
|
// } 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 {
|
try {
|
||||||
await loadSharedApi({ type: 'tool', systemType: props.apiType })
|
await loadSharedApi({ type: 'tool', systemType: props.apiType })
|
||||||
.addInternalTool(tool.id, { name: tool.name, folder_id: folderId.value }, addLoading)
|
.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)
|
// await ToolStoreApi.addInternalTool(tool.id, { name: tool.name, folder_id: folderId.value }, addLoading)
|
||||||
emit('refresh')
|
emit('refresh')
|
||||||
MsgSuccess(t('common.addSuccess'))
|
MsgSuccess(t('common.addSuccess'))
|
||||||
@ -200,6 +204,7 @@ defineExpose({ open })
|
|||||||
|
|
||||||
.dialog-header {
|
.dialog-header {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.store-type {
|
.store-type {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user