Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Transform the 'divide,' 'grpc,' and 'websocket' plugins for discovery #388

Merged
merged 35 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1987466
refactor: change "tcp" to "discovery"
eurecalulu Nov 1, 2023
e59aa3a
refactor: Change the parameters of componentDidUpdate to adapt to the…
eurecalulu Nov 3, 2023
822709c
feature: add tabPane to divide plugin selector
eurecalulu Nov 4, 2023
da6b588
refactor: Modify variables with the same name
eurecalulu Nov 4, 2023
d3f44e9
refactor: Completed the addition of the discovery page in the divide …
eurecalulu Nov 5, 2023
a42157b
refactor: Completed the addition of the discovery page in the divide …
eurecalulu Nov 5, 2023
9ffe6eb
feature: addSelector success
eurecalulu Nov 6, 2023
2d879ae
feature: updateSelector success
eurecalulu Nov 6, 2023
5d5f7b4
refactor: refactor updateSelector success
eurecalulu Nov 6, 2023
5108b26
fix: fix discovery upstream data acquisition
eurecalulu Nov 7, 2023
faf2fa5
[feature] Add discovery tabPane to Websocket and Grpc
eurecalulu Nov 23, 2023
d874876
feature: add upstream api
eurecalulu Dec 1, 2023
e1e679e
fix: selector update bug
eurecalulu Dec 2, 2023
db7893c
fix:upstream bug
eurecalulu Dec 4, 2023
fb432bd
Revert "fix:upstream bug"
eurecalulu Dec 4, 2023
26e440f
refactor:upstream update
eurecalulu Dec 4, 2023
c9ed610
fix:upstream bug
eurecalulu Dec 5, 2023
8c44e86
feature:config import from backend
eurecalulu Dec 5, 2023
6deb018
fix:null config bug
eurecalulu Dec 5, 2023
36b7eaf
refactor: change table to editableTable
eurecalulu Dec 11, 2023
85b366c
refactor: remove unused code
eurecalulu Dec 11, 2023
400d534
refactor: remove protocol in upstreamTable, change tcp table to edita…
eurecalulu Dec 20, 2023
79ea8f2
Merge remote-tracking branch 'upstream/master' into discovery_divide
eurecalulu Dec 26, 2023
5e0ca56
fix: add startupTime and warmupTime
eurecalulu Dec 26, 2023
e48d1d9
refactor: change editableTable
eurecalulu Dec 27, 2023
e0b3aeb
fix: fix DiscoveryImportModal
eurecalulu Dec 28, 2023
8d921e1
fix: fix button
eurecalulu Dec 28, 2023
2ad47cd
fix: remove unused code
eurecalulu Dec 28, 2023
6ce004e
fix: discovery props set
eurecalulu Dec 28, 2023
b996063
refactor: tcp editableTable
eurecalulu Dec 28, 2023
ab552d8
fix: add eureka discovery icon
eurecalulu Dec 29, 2023
30627ff
fix: remove unused local variable
eurecalulu Dec 29, 2023
79b7e72
fix: remove unused code
eurecalulu Dec 30, 2023
e6de475
fix: fix discovery props style bug and add i18n fields
eurecalulu Dec 30, 2023
3322de1
fix: remove unused component
eurecalulu Dec 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,19 @@
"SHENYU.DISCOVERY.SELECTOR.CONFIGURATION": "Discovery Configuration",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM": "Discovery Upstreams",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.ADD": "Add Discovery Upstream",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DELETE": "Sure to delete?",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DELETE.CONFIRM": "Sure to delete?",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.CANCEL.CONFIRM": "Sure to cancel?",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.OPERATION": "operation",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.CANCEL": "Cancel",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.SAVE": "Save",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.EDIT": "Edit",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DateCreated": "DateCreated",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DateUpdated": "DateUpdated",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.BASIC": "Basic Config",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.DISCOVERY": "Discovery Config",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.IMPORT": "Import Background Discovery Config",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.IMPORT.CONFIRM": "Configuration Import Confirmation",
"SHENYU.DISCOVERY.SELECTOR.DELETE.CONFIRM": "Are you sure to delete this selector?",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.IMPORT.SURE": "Import",
"SHENYU.COMMON.REFRESH": "Refresh"
}
}
9 changes: 8 additions & 1 deletion src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,19 @@
"SHENYU.DISCOVERY.SELECTOR.CONFIGURATION": "服务发现配置",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM": "服务下游列表",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.ADD": "添加下游服务",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DELETE": "确定删除吗",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DELETE.CONFIRM": "确定删除吗",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.CANCEL.CONFIRM": "确定取消吗",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.OPERATION": "操作",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.CANCEL": "取消",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.SAVE": "保存",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.EDIT": "编辑",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DateCreated": "创建时间",
"SHENYU.DISCOVERY.SELECTOR.UPSTREAM.DateUpdated": "更新时间",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.BASIC": "基本配置",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.DISCOVERY": "服务发现",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.IMPORT": "导入后台服务发现配置",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.IMPORT.CONFIRM": "后台配置导入确认",
"SHENYU.DISCOVERY.SELECTOR.CONFIG.IMPORT.SURE": "导入",
"SHENYU.DISCOVERY.SELECTOR.DELETE.CONFIRM": "确定删除该选择器吗?",
"SHENYU.COMMON.REFRESH": "刷新"
}
3 changes: 2 additions & 1 deletion src/models/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export default {
const json = yield call(addSelector, payload);
if (json.code === 200) {
message.success(getIntlContent('SHENYU.COMMON.RESPONSE.ADD.SUCCESS'));
callback();
const selectorId = json.data;
callback(selectorId);
yield put({ type: "reload", fetchValue });
} else {
message.warn(json.message);
Expand Down
41 changes: 33 additions & 8 deletions src/models/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import {
updateProxySelector,
getDiscovery,
refreshProxySelector,
deleteDiscovery

deleteDiscovery,
bindingSelector,
updateDiscoveryUpstream
} from "../services/api";
import {getIntlContent} from "../utils/IntlUtils";

Expand All @@ -35,15 +36,15 @@ export default {

state: {
typeEnums: [],
selectorList: [],
proxySelectorList: [],
chosenType: '',
totalPage: 0,
currentPage: 1,
pageSize: 6
},

effects: {
* fetchSelector(params, {call, put}) {
* fetchProxySelectors(params, {call, put}) {
const {payload} = params;
const json = yield call(fetchProxySelector, payload);
if (json.code === 200) {
Expand Down Expand Up @@ -80,6 +81,7 @@ export default {
message.warn(json.message);
}
},

* delete(params, {call, put}) {
const {payload, fetchValue} = params;
const { list } = payload;
Expand All @@ -92,6 +94,7 @@ export default {
message.warn(json.message);
}
},

* update(params, {call, put}) {
const {payload, callback, fetchValue} = params;
const json = yield call(updateProxySelector, payload);
Expand All @@ -103,11 +106,12 @@ export default {
message.warn(json.message);
}
},

* reload(params, {put}) {
const {fetchValue} = params;
const {name = '', currentPage, pageSize} = fetchValue;
const payload = {name, currentPage, pageSize};
yield put({type: "fetchSelector", payload});
yield put({type: "fetchProxySelectors", payload});
},


Expand All @@ -116,9 +120,9 @@ export default {
const json = yield call(postDiscoveryInsertOrUpdate, payload);
if (json.code === 200) {
message.success(getIntlContent('SHENYU.COMMON.RESPONSE.CONFIGURATION.SUCCESS'));
const { data } = json;
const discoveryConfigData = json.data;
if (callback) {
callback(data);
callback(discoveryConfigData);
}
} else {
message.warn(json.message);
Expand Down Expand Up @@ -162,14 +166,35 @@ export default {
}
},

* bindSelector(params, {call}) {
const {payload} = params;
const json = yield call(bindingSelector, payload);
if (json.code === 200) {
// message.success(getIntlContent('SHENYU.COMMON.RESPONSE.ADD.SUCCESS'));
// callback();
} else {
message.warn(json.message);
}
},

* updateDiscoveryUpstream(params, {call}) {
const { discoveryHandlerId, upstreams } = params.payload;
const json = yield call(updateDiscoveryUpstream, discoveryHandlerId, upstreams);
if (json.code === 200) {
// message.success(getIntlContent('SHENYU.COMMON.RESPONSE.UPDATE.SUCCESS'));
} else {
message.warn(json.message);
}
},

},

reducers: {
saveProxySelectors(state, {payload}) {
return {
...state,
totalPage: payload.total,
selectorList: payload.dataList,
proxySelectorList: payload.dataList,
};
},

Expand Down
Loading
Loading