Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/common/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ export const menuData = [
path: "dict",
locale: "SHENYU.MENU.SYSTEM.MANAGMENT.DICTIONARY",
},
{
name: getIntlContent("SHENYU.MENU.SYSTEM.MANAGMENT.INSTANCE"),
path: "instance",
locale: "SHENYU.MENU.SYSTEM.MANAGMENT.INSTANCE",
},
],
},
{
Expand Down
7 changes: 7 additions & 0 deletions src/common/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export const getRouterData = (app) => {
() => import("../routes/System/Plugin"),
),
},
"/config/instance": {
component: dynamicWrapper(
app,
["instance"],
() => import("../routes/System/Instance"),
),
},
"/config/namespacePlugin": {
component: dynamicWrapper(
app,
Expand Down
7 changes: 7 additions & 0 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"SHENYU.MENU.SYSTEM.MANAGMENT.AUTHEN": "Authentication",
"SHENYU.MENU.SYSTEM.MANAGMENT.METADATA": "Metadata",
"SHENYU.MENU.SYSTEM.MANAGMENT.DICTIONARY": "Dictionary",
"SHENYU.MENU.SYSTEM.MANAGMENT.INSTANCE": "Instance",
"SHENYU.MENU.SYSTEM.MANAGMENT.NAMESPACE": "Namespace",
"SHENYU.MENU.CONFIG.MANAGMENT": "BasicConfig",
"SHENYU.PLUGIN.SELECTOR.LIST.TITLE": "SelectorList",
Expand Down Expand Up @@ -334,6 +335,12 @@
"SHENYU.BUTTON.DATA.PERMISSION.CONFIG": "ConfigureDataPermission",
"SHENYU.MESSAGE.SESSION.INVALID": "Session is invalid",
"SHENYU.MESSAGE.SESSION.RELOGIN": "Please login in again",
"SHENYU.INSTANCE.IP": "Instance IP",
"SHENYU.INSTANCE.PORT": "Instance Port",
"SHENYU.INSTANCE.INFO": "Instance Info",
"SHENYU.INSTANCE.SELECT.TYPE": "Instance Type",
"SHENYU.INSTANCE.SELECT.TYPE.BOOTSTRAP": "Bootstrap",
"SHENYU.INSTANCE.SELECT.TYPE.CLIENT": "Client",
"SHENYU.PLUGIN.SELECT.STATUS": "Select Status",
"SHENYU.PLUGIN.REQUEST.HEADER.KEY": "Header Key",
"SHENYU.PLUGIN.REQUEST.HEADER.VALUE": "Header Value",
Expand Down
7 changes: 7 additions & 0 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"SHENYU.MENU.SYSTEM.MANAGMENT.AUTHEN": "认证管理",
"SHENYU.MENU.SYSTEM.MANAGMENT.METADATA": "元数据管理",
"SHENYU.MENU.SYSTEM.MANAGMENT.DICTIONARY": "字典管理",
"SHENYU.MENU.SYSTEM.MANAGMENT.INSTANCE": "实例管理",
"SHENYU.MENU.CONFIG.MANAGMENT": "基础配置",
"SHENYU.MENU.SYSTEM.MANAGMENT.NAMESPACE": "命名空间管理",
"SHENYU.PLUGIN.SELECTOR.LIST.TITLE": "选择器列表",
Expand Down Expand Up @@ -338,6 +339,12 @@
"SHENYU.BUTTON.DATA.PERMISSION.CONFIG": "配置数据权限",
"SHENYU.MESSAGE.SESSION.INVALID": "会话超时",
"SHENYU.MESSAGE.SESSION.RELOGIN": "会话超时,请重新登录",
"SHENYU.INSTANCE.IP": "实例IP",
"SHENYU.INSTANCE.PORT": "实例端口",
"SHENYU.INSTANCE.INFO": "实例信息",
"SHENYU.INSTANCE.SELECT.TYPE": "实例类型",
"SHENYU.INSTANCE.SELECT.TYPE.BOOTSTRAP": "网关实例",
"SHENYU.INSTANCE.SELECT.TYPE.CLIENT": "客户端实例",
"SHENYU.PLUGIN.SELECT.STATUS": "选择状态",
"SHENYU.PLUGIN.REQUEST.HEADER.KEY": "Header Key",
"SHENYU.PLUGIN.REQUEST.HEADER.VALUE": "Header Value",
Expand Down
79 changes: 79 additions & 0 deletions src/models/instance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getInstancesByNamespace, findInstance } from "../services/api";

export default {
namespace: "instance",

state: {
instanceList: [],
total: 0,
},

effects: {
*fetch(params, { call, put }) {
const { payload } = params;
const json = yield call(getInstancesByNamespace, payload);
if (json.code === 200) {
let { page, dataList } = json.data;
dataList = dataList.map((item) => {
item.key = item.id;
return item;
});
yield put({
type: "saveInstances",
payload: {
total: page.totalCount,
dataList,
},
});
}
},
*fetchItem(params, { call }) {
const { payload, callback } = params;
const json = yield call(findInstance, payload);
if (json.code === 200) {
const instance = json.data;
callback(instance);
}
},
*reload(params, { put }) {
const { fetchValue } = params;
const { name, currentPage, instanceType, instanceIp, pageSize } =
fetchValue;
const payload = {
name,
instanceType,
instanceIp,
currentPage,
pageSize,
};
yield put({ type: "fetch", payload });
},
},

reducers: {
saveInstances(state, { payload }) {
return {
...state,
instanceList: payload.dataList,
total: payload.total,
};
},
},
};
Loading