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 8e51177c fix ns plugin bugs (#513) 8e51177c is described below commit 8e51177cc9c84b66e130c12cda432059f18fb8aa Author: aias00 <rok...@163.com> AuthorDate: Wed Dec 4 23:31:40 2024 +0800 fix ns plugin bugs (#513) * fix namespace plugin batch enable * fix get alert receviers * fix namespace plugin get selector * fix ns plugin selector bug * fix namespace detail restful * fix namespace plugin restful * fix data permission ns bug * support copy selector from other ns * support rule copy from other ns * fix ns plugin bugs --- src/routes/System/NamespacePlugin/index.js | 5 ++--- src/routes/System/Plugin/index.js | 3 +++ src/services/api.js | 20 +++++++------------- src/utils/namespacePlugin.js | 1 + 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/routes/System/NamespacePlugin/index.js b/src/routes/System/NamespacePlugin/index.js index ab77458a..3cb23cdf 100644 --- a/src/routes/System/NamespacePlugin/index.js +++ b/src/routes/System/NamespacePlugin/index.js @@ -143,7 +143,7 @@ export default class NamespacePlugin extends Component { editClick = (record) => { const { dispatch, currentNamespaceId } = this.props; getUpdateModal({ - id: record.pluginId, + id: record.id, namespaceId: currentNamespaceId, dispatch, fetchValue: this.currentQueryPayload(), @@ -373,7 +373,7 @@ export default class NamespacePlugin extends Component { checked={text} onChange={(checked) => { this.statusSwitch({ - list: [row.pluginId], + list: [row.id], enabled: checked, namespaceId: row.namespaceId, }); @@ -536,7 +536,6 @@ export default class NamespacePlugin extends Component { loading={loading} columns={columns} dataSource={namespacePluginList} - rowKey={(record) => record.pluginId} rowSelection={rowSelection} pagination={{ total, diff --git a/src/routes/System/Plugin/index.js b/src/routes/System/Plugin/index.js index 1a490b6a..9e1fdf97 100644 --- a/src/routes/System/Plugin/index.js +++ b/src/routes/System/Plugin/index.js @@ -182,6 +182,9 @@ export default class Plugin extends Component { fetchValue: this.currentQueryPayload({ pageSize: 12, }), + callback: () => { + refreshAuthMenus({ dispatch }); + }, }); }; diff --git a/src/services/api.js b/src/services/api.js index fe1e346e..92b6e5b0 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -1294,12 +1294,9 @@ export async function deleteNamespace(params) { /* findNamespacePlugin */ export async function findNamespacePlugin(params) { - return request( - `${baseUrl}/namespace-plugin/${params.namespaceId}/${params.id}`, - { - method: `GET`, - }, - ); + return request(`${baseUrl}/namespace-plugin/${params.id}`, { + method: `GET`, + }); } /* getAllNamespacePlugins */ @@ -1334,13 +1331,10 @@ export async function updateNamespacePluginEnabledByNamespace(params) { /* updateNamespacePlugin */ export async function updateNamespacePlugin(params) { - return request( - `${baseUrl}/namespace-plugin/${params.namespaceId}/${params.pluginId}`, - { - method: `PUT`, - body: params, - }, - ); + return request(`${baseUrl}/namespace-plugin/${params.id}`, { + method: `PUT`, + body: params, + }); } /* deletePlugin */ diff --git a/src/utils/namespacePlugin.js b/src/utils/namespacePlugin.js index ad7c70d1..9de6871d 100644 --- a/src/utils/namespacePlugin.js +++ b/src/utils/namespacePlugin.js @@ -50,6 +50,7 @@ export function getUpdateModal({ type: "namespacePlugin/update", payload: { config, + id: plugin.id, pluginId: plugin.pluginId, enabled, namespaceId,