This is an automated email from the ASF dual-hosted git repository.
liuhongyu 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 b6ff9e6c feat: Add new role search criteria & fix some bug (#567)
b6ff9e6c is described below
commit b6ff9e6cd911c9e52b03f04811292d81566ddcb4
Author: renlu <[email protected]>
AuthorDate: Fri Jan 30 15:30:05 2026 +0800
feat: Add new role search criteria & fix some bug (#567)
* feat: Add new role search criteria & fix some bug
* fix: fix link
---
src/locales/en-US.json | 1 +
src/locales/zh-CN.json | 1 +
src/routes/System/Plugin/AddModal.js | 11 ++++++++---
src/routes/System/Plugin/index.js | 33 +++++++++++++++++++++++++++------
4 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index ff208ca1..a0955cf9 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -168,6 +168,7 @@
"SHENYU.SYSTEM.ROLE": "Role",
"SHENYU.SYSTEM.USERNAME": "UserName",
"SHENYU.SYSTEM.SELECTROLE": "Role",
+ "SHENYU.SYSTEM.INPUTROLE": "Please Enter The Role",
"SHENYU.SYSTEM.ADMIN": "Manager",
"SHENYU.SYSTEM.STATUS": "Status",
"SHENYU.SYSTEM.SEARCH": "Query",
diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json
index 4357cb3a..010cd1ec 100644
--- a/src/locales/zh-CN.json
+++ b/src/locales/zh-CN.json
@@ -169,6 +169,7 @@
"SHENYU.SYSTEM.ROLE": "角色",
"SHENYU.SYSTEM.USERNAME": "用户名称",
"SHENYU.SYSTEM.SELECTROLE": "请选择角色",
+ "SHENYU.SYSTEM.INPUTROLE": "请输入角色",
"SHENYU.SYSTEM.ADMIN": "管理员",
"SHENYU.SYSTEM.STATUS": "状态",
"SHENYU.SYSTEM.SEARCH": "查询",
diff --git a/src/routes/System/Plugin/AddModal.js
b/src/routes/System/Plugin/AddModal.js
index 308938d9..0b62435f 100644
--- a/src/routes/System/Plugin/AddModal.js
+++ b/src/routes/System/Plugin/AddModal.js
@@ -252,7 +252,7 @@ class AddModal extends Component {
rules: [
{
required: true,
- message: getIntlContent("SHENYU.SYSTEM.SELECTROLE"),
+ message: getIntlContent("SHENYU.SYSTEM.INPUTROLE"),
},
],
initialValue: role,
@@ -270,7 +270,7 @@ class AddModal extends Component {
},
],
initialValue: sort,
- })(<InputNumber precision={0} style={{ width: "100%" }} />)}
+ })(<InputNumber precision={0} min={0} style={{ width: "100%" }}
/>)}
</FormItem>
<FormItem
@@ -295,7 +295,12 @@ class AddModal extends Component {
{getFieldDecorator("enabled", {
initialValue: enabled,
valuePropName: "checked",
- })(<Switch />)}
+ })(
+ <Switch
+ checkedChildren={getIntlContent("SHENYU.COMMON.OPEN")}
+ unCheckedChildren={getIntlContent("SHENYU.COMMON.CLOSE")}
+ />,
+ )}
</FormItem>
</Form>
</Modal>
diff --git a/src/routes/System/Plugin/index.js
b/src/routes/System/Plugin/index.js
index 240470d8..7bfeccd7 100644
--- a/src/routes/System/Plugin/index.js
+++ b/src/routes/System/Plugin/index.js
@@ -61,6 +61,7 @@ export default class Plugin extends Component {
pageSize: 12,
selectedRowKeys: [],
name: "",
+ role: "",
enabled: null,
popup: "",
localeName: window.sessionStorage.getItem("locale")
@@ -102,9 +103,11 @@ export default class Plugin extends Component {
};
currentQueryPayload = (override) => {
- const { name, namespaceId, enabled, currentPage, pageSize } = this.state;
+ const { name, role, namespaceId, enabled, currentPage, pageSize } =
+ this.state;
return {
name,
+ role,
namespaceId,
enabled,
currentPage,
@@ -208,10 +211,14 @@ export default class Plugin extends Component {
});
};
- searchOnchange = (e) => {
+ searchOnNamechange = (e) => {
this.setState({ name: e.target.value }, this.query);
};
+ searchOnRolechange = (e) => {
+ this.setState({ role: e.target.value }, this.query);
+ };
+
enabledOnchange = (e) => {
this.setState({ enabled: e }, this.query);
};
@@ -420,7 +427,7 @@ export default class Plugin extends Component {
dataIndex: "enabled",
key: "enabled",
ellipsis: true,
- width: 80,
+ width: 85,
sorter: (a, b) =>
(a.enabled || "-1") > (b.enabled || "-1") ? 1 : -1,
render: (text, row) => (
@@ -498,8 +505,15 @@ export default class Plugin extends Component {
render() {
const { plugin, loading, authMenu } = this.props;
const { pluginList, total } = plugin;
- const { currentPage, pageSize, selectedRowKeys, name, enabled, popup } =
- this.state;
+ const {
+ currentPage,
+ pageSize,
+ selectedRowKeys,
+ name,
+ role,
+ enabled,
+ popup,
+ } = this.state;
const columns = this.state.columns.map((col, index) => ({
...col,
onHeaderCell: (column) => ({
@@ -533,10 +547,17 @@ export default class Plugin extends Component {
<Input
allowClear
value={name}
- onChange={this.searchOnchange}
+ onChange={this.searchOnNamechange}
placeholder={getIntlContent("SHENYU.PLUGIN.INPUTNAME")}
style={{ width: 240 }}
/>
+ <Input
+ allowClear
+ value={role}
+ onChange={this.searchOnRolechange}
+ placeholder={getIntlContent("SHENYU.SYSTEM.ROLE")}
+ style={{ width: 200, marginLeft: 20 }}
+ />
<Select
value={enabled != null ? enabled : undefined}
onChange={this.enabledOnchange}