feat: add MCP configuration option and dialog to ToolResourceIndex
--bug=1060875 --user=刘瑞斌 【资源管理】工具列表的MCP资源缺少MCP服务配置查看功能 https://www.tapd.cn/62980211/s/1762106v3.2
parent
675e90d3db
commit
7683c39d66
|
|
@ -276,6 +276,13 @@
|
|||
<AppIcon iconName="app-export" class="color-secondary"></AppIcon>
|
||||
{{ $t('common.export') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="row.tool_type === 'MCP'"
|
||||
@click.stop="showMcpConfig(row)"
|
||||
>
|
||||
<AppIcon iconName="app-operate-log" class="color-secondary"></AppIcon>
|
||||
{{ $t('views.tool.mcpConfig') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="permissionPrecise.delete()"
|
||||
divided
|
||||
|
|
@ -296,6 +303,7 @@
|
|||
<ToolFormDrawer ref="ToolFormDrawerRef" @refresh="refresh" :title="ToolDrawertitle" />
|
||||
<McpToolFormDrawer ref="McpToolFormDrawerRef" @refresh="refresh" :title="McpToolDrawertitle" />
|
||||
<AddInternalToolDialog ref="AddInternalToolDialogRef" @refresh="confirmAddInternalTool" />
|
||||
<McpToolConfigDialog ref="McpToolConfigDialogRef" @refresh="refresh" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -316,6 +324,7 @@ import { loadPermissionApi } from '@/utils/dynamics-api/permission-api.ts'
|
|||
import UserApi from '@/api/user/user.ts'
|
||||
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'
|
||||
import permissionMap from '@/permission'
|
||||
import McpToolConfigDialog from "@/views/tool/component/McpToolConfigDialog.vue";
|
||||
|
||||
const { user } = useStore()
|
||||
|
||||
|
|
@ -360,6 +369,15 @@ function exportTool(row: any) {
|
|||
})
|
||||
}
|
||||
|
||||
const McpToolConfigDialogRef = ref()
|
||||
function showMcpConfig(item: any) {
|
||||
ToolResourceApi
|
||||
.getToolById(item?.id, loading)
|
||||
.then((res: any) => {
|
||||
McpToolConfigDialogRef.value.open(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
function deleteTool(row: any) {
|
||||
MsgConfirm(
|
||||
`${t('views.tool.delete.confirmTitle')}:${row.name} ?`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue