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 2344ec6a Namespace optimize (#514)
2344ec6a is described below

commit 2344ec6ac575942bf72c731b2ba92e4c50f1ef10
Author: VampireAchao <[email protected]>
AuthorDate: Sat Dec 7 22:06:57 2024 +0800

    Namespace optimize (#514)
    
    * [type:improve] remove "Namespace development in progress" alert
    
    * [type:improve] plugin handler modal name field add search
    
    * [type:improve] set selector and rule copy modal source margin bottom
    
    * [type:improve] export import dropdown optimize
    
    * [type:fix] fix problem
---
 src/components/GlobalHeader/index.js       | 43 +++++++++++-------------------
 src/locales/en-US.json                     |  2 +-
 src/locales/zh-CN.json                     |  2 +-
 src/routes/Plugin/Common/RuleCopy.js       |  2 +-
 src/routes/Plugin/Common/SelectorCopy.js   |  2 +-
 src/routes/System/PluginHandle/AddModal.js | 10 ++++++-
 6 files changed, 29 insertions(+), 32 deletions(-)

diff --git a/src/components/GlobalHeader/index.js 
b/src/components/GlobalHeader/index.js
index 2d4e0f22..5e5824f8 100644
--- a/src/components/GlobalHeader/index.js
+++ b/src/components/GlobalHeader/index.js
@@ -16,16 +16,7 @@
  */
 
 import React, { PureComponent } from "react";
-import {
-  Button,
-  Dropdown,
-  Form,
-  Icon,
-  Input,
-  Menu,
-  message,
-  Modal,
-} from "antd";
+import { Button, Dropdown, Form, Icon, Input, Menu, Modal } from "antd";
 import { connect } from "dva";
 import { withRouter } from "dva/router";
 import ImportModal from "./ImportModal";
@@ -169,9 +160,6 @@ class GlobalHeader extends PureComponent {
       type: "global/saveCurrentNamespaceId",
       payload: namespaceId,
     });
-    if (namespaceId !== defaultNamespaceId) {
-      
message.warn(getIntlContent("SHENYU.NAMESPACE.ALERTNAMESPACEID.CHANGED"));
-    }
     // Fetch plugins for the new namespace
     dispatch({
       type: "global/fetchPlugins",
@@ -302,6 +290,13 @@ class GlobalHeader extends PureComponent {
           <Icon type="form" />{" "}
           {getIntlContent("SHENYU.GLOBALHEADER.CHANGE.PASSWORD")}
         </Menu.Item>
+        <Menu.Item key="0" onClick={onLogout}>
+          <Icon type="logout" /> {getIntlContent("SHENYU.GLOBALHEADER.LOGOUT")}
+        </Menu.Item>
+      </Menu>
+    );
+    const importMenu = (
+      <Menu>
         {this.checkAuth("system:manager:exportConfig") && (
           <Menu.Item key="2" onClick={this.exportConfigClick}>
             <Icon type="export" /> {getIntlContent("SHENYU.COMMON.EXPORT")}
@@ -312,9 +307,6 @@ class GlobalHeader extends PureComponent {
             <Icon type="import" /> {getIntlContent("SHENYU.COMMON.IMPORT")}
           </Menu.Item>
         )}
-        <Menu.Item key="0" onClick={onLogout}>
-          <Icon type="logout" /> {getIntlContent("SHENYU.GLOBALHEADER.LOGOUT")}
-        </Menu.Item>
       </Menu>
     );
     return (
@@ -357,18 +349,15 @@ class GlobalHeader extends PureComponent {
               </Dropdown>
             </div>
           )}
-          {this.checkAuth("system:manager:importConfig") && (
-            <div className={styles.item}>
-              <Button onClick={this.importConfigClick}>
-                <Icon type="import" /> {getIntlContent("SHENYU.COMMON.IMPORT")}
-              </Button>
-            </div>
-          )}
-          {this.checkAuth("system:manager:exportConfig") && (
+          {(this.checkAuth("system:manager:importConfig") ||
+            this.checkAuth("system:manager:exportConfig")) && (
             <div className={styles.item}>
-              <Button onClick={this.exportConfigClick}>
-                <Icon type="export" /> {getIntlContent("SHENYU.COMMON.EXPORT")}
-              </Button>
+              <Dropdown overlay={importMenu}>
+                <Button>
+                  <Icon type="import" />{" "}
+                  {getIntlContent("SHENYU.COMMON.IMPORT_EXPORT")}
+                </Button>
+              </Dropdown>
             </div>
           )}
           <div className={styles.item}>
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index f6f95168..bf3d1194 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -403,6 +403,7 @@
   "SHENYU.DOCUMENT.TAG.TABLE.CREATETIME": "Create Time",
   "SHENYU.DOCUMENT.TAG.TABLE.MODIFYTIME": "Modify Time",
   "SHENYU.COMMON.REQUIRED": "Required",
+  "SHENYU.COMMON.IMPORT_EXPORT": "Import/Export configs",
   "SHENYU.COMMON.EXPORT": "Export Configs",
   "SHENYU.COMMON.IMPORT": "Import Configs",
   "SHENYU.COMMON.IMPORT.RESULT": "Import Result",
@@ -473,6 +474,5 @@
   "SHENYU.NAMESPACE.INPUTDESC":"description",
   "SHENYU.NAMESPACE.INPUTNAMESPACEID":"namespaceId",
   "SHENYU.NAMESPACE.ALERTNAMESPACEID":"Automatically generated namespaceId",
-  "SHENYU.NAMESPACE.ALERTNAMESPACEID.CHANGED":"Namespace development in 
progress",
   "SHENYU.MENU.SYSTEM.MANAGMENT.NAMESPACEPLUGIN":"Plugin"
 }
diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json
index 73a93256..37974493 100644
--- a/src/locales/zh-CN.json
+++ b/src/locales/zh-CN.json
@@ -408,6 +408,7 @@
   "SHENYU.DOCUMENT.TAG.TABLE.CREATETIME": "创建时间",
   "SHENYU.DOCUMENT.TAG.TABLE.MODIFYTIME": "修改时间",
   "SHENYU.COMMON.REQUIRED": "必填",
+  "SHENYU.COMMON.IMPORT_EXPORT": "导入配置/导出配置",
   "SHENYU.COMMON.EXPORT": "导出所有配置",
   "SHENYU.COMMON.IMPORT": "导入配置",
   "SHENYU.COMMON.IMPORT.RESULT": "导入结果",
@@ -479,6 +480,5 @@
   "SHENYU.NAMESPACE.INPUTDESC":"请输入命名空间描述",
   "SHENYU.NAMESPACE.INPUTNAMESPACEID":"请输入namespaceId",
   "SHENYU.NAMESPACE.ALERTNAMESPACEID":"系统自动生成namespaceId",
-  "SHENYU.NAMESPACE.ALERTNAMESPACEID.CHANGED":"命名空间开发中",
   "SHENYU.MENU.SYSTEM.MANAGMENT.NAMESPACEPLUGIN":"插件管理"
 }
diff --git a/src/routes/Plugin/Common/RuleCopy.js 
b/src/routes/Plugin/Common/RuleCopy.js
index 27417207..511633e7 100644
--- a/src/routes/Plugin/Common/RuleCopy.js
+++ b/src/routes/Plugin/Common/RuleCopy.js
@@ -172,7 +172,7 @@ class RuleCopy extends Component {
             </Menu>
           }
         >
-          <Button>
+          <Button style={{ marginBottom: 20 }}>
             <a
               className="ant-dropdown-link"
               style={{ fontWeight: "bold" }}
diff --git a/src/routes/Plugin/Common/SelectorCopy.js 
b/src/routes/Plugin/Common/SelectorCopy.js
index 9ca62fa0..69f3b0d6 100644
--- a/src/routes/Plugin/Common/SelectorCopy.js
+++ b/src/routes/Plugin/Common/SelectorCopy.js
@@ -151,7 +151,7 @@ class SelectorCopy extends Component {
             </Menu>
           }
         >
-          <Button>
+          <Button style={{ marginBottom: 20 }}>
             <a
               className="ant-dropdown-link"
               style={{ fontWeight: "bold" }}
diff --git a/src/routes/System/PluginHandle/AddModal.js 
b/src/routes/System/PluginHandle/AddModal.js
index dad20d5d..3671e34c 100644
--- a/src/routes/System/PluginHandle/AddModal.js
+++ b/src/routes/System/PluginHandle/AddModal.js
@@ -129,7 +129,15 @@ class AddPluginHandle extends Component {
               ],
               initialValue: pluginId,
             })(
-              <Select 
placeholder={getIntlContent("SHENYU.PLUGIN.PLUGIN.NAME")}>
+              <Select
+                placeholder={getIntlContent("SHENYU.PLUGIN.PLUGIN.NAME")}
+                showSearch
+                filterOption={(input, option) =>
+                  option.props.children
+                    .toLowerCase()
+                    .indexOf(input.toLowerCase()) >= 0
+                }
+              >
                 {pluginDropDownList.map((item, i) => {
                   return (
                     <Option key={i} value={item.id}>

Reply via email to