You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by zh...@apache.org on 2022/07/02 12:55:13 UTC
[incubator-shenyu-dashboard] branch master updated: feature: use path to search (#213)
This is an automated email from the ASF dual-hosted git repository.
zhangzicheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new 488e388c feature: use path to search (#213)
488e388c is described below
commit 488e388c54d1816a4ada5711791ffb9cdcc2ec71
Author: zhengpeng <84...@qq.com>
AuthorDate: Sat Jul 2 20:55:09 2022 +0800
feature: use path to search (#213)
* feature: use path to search.
* feature: use path to search input placeholder
---
src/locales/en-US.json | 2 +-
src/locales/zh-CN.json | 2 +-
src/routes/System/Metadata/index.js | 13 +++++++------
src/services/api.js | 4 ++--
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index 31fbce90..0dbddda0 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -245,7 +245,7 @@
"SHENYU.DIC.DESCRIBE": "DictionaryDescribe",
"SHENYU.DIC": "Dictionary",
"SHENYU.AUTH.INPUTAPPKEY": "AppKey",
- "SHENYU.META.INPUTAPPNAME": "AppName",
+ "SHENYU.META.INPUTPATH": "Path",
"SHENYU.DIC.INPUTTYPE": "DictionaryType",
"SHENYU.DIC.INPUTCODE": "DictionaryCode",
"SHENYU.DIC.INPUTNAME": "DictionaryName",
diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json
index 4ca3f1c3..941704be 100644
--- a/src/locales/zh-CN.json
+++ b/src/locales/zh-CN.json
@@ -238,7 +238,7 @@
"SHENYU.DIC.DESCRIBE": "字典描述或备注",
"SHENYU.DIC": "字典",
"SHENYU.AUTH.INPUTAPPKEY": "请输入AppKey",
- "SHENYU.META.INPUTAPPNAME": "请输入应用名称",
+ "SHENYU.META.INPUTPATH": "请输入路径",
"SHENYU.DIC.INPUTTYPE": "请输入类型",
"SHENYU.DIC.INPUTCODE": "请输入字典编码",
"SHENYU.DIC.INPUTNAME": "请输入字典名称",
diff --git a/src/routes/System/Metadata/index.js b/src/routes/System/Metadata/index.js
index dbf7dfa4..59370449 100644
--- a/src/routes/System/Metadata/index.js
+++ b/src/routes/System/Metadata/index.js
@@ -37,6 +37,7 @@ export default class Metadata extends Component {
currentPage: 1,
selectedRowKeys: [],
appName: "",
+ path: "",
popup: "",
localeName: window.sessionStorage.getItem('locale') ? window.sessionStorage.getItem('locale') : 'en-US',
};
@@ -73,11 +74,11 @@ export default class Metadata extends Component {
query = () => {
const { dispatch } = this.props;
- const { appName, currentPage } = this.state;
+ const { path, currentPage } = this.state;
dispatch({
type: "metadata/fetch",
payload: {
- appName,
+ path,
currentPage,
pageSize: 12
}
@@ -144,7 +145,7 @@ export default class Metadata extends Component {
};
searchOnchange = e => {
- this.setState({ appName: e.target.value, currentPage: 1 },this.query);
+ this.setState({ path: e.target.value, currentPage: 1 },this.query);
};
searchClick = () => {
@@ -381,7 +382,7 @@ export default class Metadata extends Component {
const { metadata, loading } = this.props;
const { userList, total } = metadata;
- const { currentPage, selectedRowKeys, appName, popup } = this.state;
+ const { currentPage, selectedRowKeys, path, popup } = this.state;
const columns = this.state.columns.map((col, index) => ({
...col,
onHeaderCell: column => ({
@@ -398,9 +399,9 @@ export default class Metadata extends Component {
<div className="plug-content-wrap">
<div style={{ display: "flex" }}>
<Input
- value={appName}
+ value={path}
onChange={this.searchOnchange}
- placeholder={getIntlContent("SHENYU.META.INPUTAPPNAME")}
+ placeholder={getIntlContent("SHENYU.META.INPUTPATH")}
style={{ width: 240 }}
/>
<AuthButton perms="system:meta:list">
diff --git a/src/services/api.js b/src/services/api.js
index 6c02c8f7..f79bb22e 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -66,10 +66,10 @@ export async function updatePassword(params) {
/* get all metadata */
export async function getAllMetadata(params) {
- const { appName, currentPage, pageSize } = params;
+ const { path, currentPage, pageSize } = params;
return request(
`${baseUrl}/meta-data/queryList?${stringify(
- appName ? params : { currentPage, pageSize }
+ path ? params : { currentPage, pageSize }
)}`,
{
method: `GET`