This is an automated email from the ASF dual-hosted git repository.

dengliming 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 9365e1f2 fix: sync TCP Discovery plugin enabled status from plugins 
prop (#608) (#710)
9365e1f2 is described below

commit 9365e1f2b1c46d39319c7da4c6c79dbf2fb8e778
Author: Hussnain Ahmad <[email protected]>
AuthorDate: Sat Oct 10 12:58:21 2026 -0400

    fix: sync TCP Discovery plugin enabled status from plugins prop (#608) 
(#710)
---
 src/routes/Plugin/Discovery/index.js | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/routes/Plugin/Discovery/index.js 
b/src/routes/Plugin/Discovery/index.js
index 30390703..c05402f0 100644
--- a/src/routes/Plugin/Discovery/index.js
+++ b/src/routes/Plugin/Discovery/index.js
@@ -78,7 +78,11 @@ export default class DiscoveryProxy extends Component {
   }
 
   componentDidMount() {
-    const { dispatch, currentPage, pageSize, currentNamespaceId } = this.props;
+    const { dispatch, currentPage, pageSize, currentNamespaceId, plugins } =
+      this.props;
+    if (plugins && plugins.length > 0) {
+      this.syncPluginEnabled(plugins);
+    }
     dispatch({
       type: "discovery/fetchProxySelectors",
       payload: {
@@ -104,6 +108,21 @@ export default class DiscoveryProxy extends Component {
     });
   }
 
+  componentDidUpdate(prevProps) {
+    const { plugins } = this.props;
+    if (plugins && plugins !== prevProps.plugins) {
+      this.syncPluginEnabled(plugins);
+    }
+  }
+
+  syncPluginEnabled = (plugins) => {
+    const { pluginName } = this.state;
+    const plugin = this.getPlugin(plugins, pluginName);
+    if (plugin) {
+      this.setState({ isPluginEnabled: plugin.enabled ?? false });
+    }
+  };
+
   // eslint-disable-next-line react/sort-comp
   renderCards(proxySelectorList = []) {
     return proxySelectorList.map((selector) => (

Reply via email to