This is an automated email from the ASF dual-hosted git repository. hefengen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git
The following commit(s) were added to refs/heads/master by this push: new 927f8d14 selector copy and rule copy adapted to namespace (#505) 927f8d14 is described below commit 927f8d146734fb7beb90385ef968c77a5b822166 Author: aias00 <rok...@163.com> AuthorDate: Mon Nov 18 10:34:42 2024 +0800 selector copy and rule copy adapted to namespace (#505) * selector copy namespace * rule copy adapted to namespace --- src/routes/Plugin/Common/RuleCopy.js | 6 ++++-- src/routes/Plugin/Common/SelectorCopy.js | 6 ++++-- src/services/api.js | 10 ++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/routes/Plugin/Common/RuleCopy.js b/src/routes/Plugin/Common/RuleCopy.js index e5b1d1d2..d79b5ed6 100644 --- a/src/routes/Plugin/Common/RuleCopy.js +++ b/src/routes/Plugin/Common/RuleCopy.js @@ -19,7 +19,7 @@ import React, { Component } from "react"; import { Modal, TreeSelect } from "antd"; import { connect } from "dva"; import { - getPluginDropDownList, + getPluginDropDownListByNamespace, getAllSelectors, getAllRules, findRule, @@ -46,7 +46,9 @@ class RuleCopy extends Component { getAllRule = async () => { const { currentNamespaceId } = this.props; const { code: pluginCode, data: pluginList = [] } = - await getPluginDropDownList(); + await getPluginDropDownListByNamespace({ + namespace: currentNamespaceId, + }); const { code: selectorCode, data: { dataList: selectorList = [] }, diff --git a/src/routes/Plugin/Common/SelectorCopy.js b/src/routes/Plugin/Common/SelectorCopy.js index 6f8142dc..3b42237e 100644 --- a/src/routes/Plugin/Common/SelectorCopy.js +++ b/src/routes/Plugin/Common/SelectorCopy.js @@ -19,7 +19,7 @@ import React, { Component } from "react"; import { Modal, TreeSelect } from "antd"; import { connect } from "dva"; import { - getPluginDropDownList, + getPluginDropDownListByNamespace, getAllSelectors, findSelector, } from "../../../services/api"; @@ -45,7 +45,9 @@ class SelectorCopy extends Component { getAllSelectors = async () => { const { currentNamespaceId } = this.props; const { code: pluginCode, data: pluginList = [] } = - await getPluginDropDownList(); + await getPluginDropDownListByNamespace({ + namespace: currentNamespaceId, + }); const { code: selectorCode, data: { dataList: selectorList = [] }, diff --git a/src/services/api.js b/src/services/api.js index 27dcda4a..64116d8e 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -591,6 +591,16 @@ export async function getPluginDropDownList() { }); } +// get plugin dropdown list by namespace +export async function getPluginDropDownListByNamespace(params) { + return request( + `${baseUrl}/plugin/listByNamespace?namespace=${params.namespace}`, + { + method: `GET`, + }, + ); +} + // get plugin handle list export async function getAllPluginHandles(params) { return request(`${baseUrl}/plugin-handle?${stringify(params)}`, {