This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch chore-route
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/chore-route by this push:
new 8289513 ui: added description for Route
8289513 is described below
commit 828951377f7847e9c3c1fa2927565e08457e16d4
Author: juzhiyuan <[email protected]>
AuthorDate: Wed Apr 7 18:10:59 2021 +0800
ui: added description for Route
---
web/src/pages/Route/List.tsx | 48 +++++++++++++++++++-----------------
web/src/pages/Route/locales/en-US.ts | 4 ++-
web/src/pages/Route/locales/zh-CN.ts | 4 ++-
3 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/web/src/pages/Route/List.tsx b/web/src/pages/Route/List.tsx
index f996310..ccbfc91 100644
--- a/web/src/pages/Route/List.tsx
+++ b/web/src/pages/Route/List.tsx
@@ -188,7 +188,7 @@ const Page: React.FC = () => {
history.push('/plugin-template/list')
}
}, {
- name: formatMessage({ id: 'component.global.createWithEditor' }),
+ name: formatMessage({ id: 'component.global.data.editor' }),
icon: <PlusOutlined />,
onClick: () => {
setVisible(true);
@@ -248,6 +248,29 @@ const Page: React.FC = () => {
onClick: () => {
history.push(`/routes/${record.id}/duplicate`)
}
+ }, {
+ name: formatMessage({ id: 'component.global.delete' }),
+ onClick: () => {
+ Modal.confirm({
+ type: "warning",
+ title: formatMessage({ id:
'component.global.popconfirm.title.delete' }),
+ content: (
+ <>
+ {formatMessage({ id: 'component.global.name' })} -
{record.name}<br />
+ ID - {record.id}
+ </>
+ ),
+ onOk: () => {
+ remove(record.id!).then(() => {
+ handleTableActionSuccessResponse(
+ `${formatMessage({ id: 'component.global.delete' })}
${formatMessage({
+ id: 'menu.routes',
+ })} ${formatMessage({ id: 'component.status.success' })}`,
+ );
+ });
+ }
+ })
+ }
}
]
@@ -503,27 +526,6 @@ const Page: React.FC = () => {
<Button type="primary" onClick={() =>
history.push(`/routes/${record.id}/edit`)}>
{formatMessage({ id: 'component.global.edit' })}
</Button>
- <Popconfirm
- title={formatMessage({ id:
'component.global.popconfirm.title.delete' })}
- onConfirm={() => {
- remove(record.id!).then(() => {
- handleTableActionSuccessResponse(
- `${formatMessage({ id: 'component.global.delete' })}
${formatMessage({
- id: 'menu.routes',
- })} ${formatMessage({ id: 'component.status.success' })}`,
- );
- });
- }}
- okButtonProps={{
- danger: true,
- }}
- okText={formatMessage({ id: 'component.global.confirm' })}
- cancelText={formatMessage({ id: 'component.global.cancel' })}
- >
- <Button type="primary" danger>
- {formatMessage({ id: 'component.global.delete' })}
- </Button>
- </Popconfirm>
<RecordActionDropdown record={record} />
</Space>
</>
@@ -532,7 +534,7 @@ const Page: React.FC = () => {
];
return (
- <PageHeaderWrapper title={formatMessage({ id: 'page.route.list' })}>
+ <PageHeaderWrapper title={formatMessage({ id: 'page.route.list' })}
content={formatMessage({ id: 'page.route.list.description' })}>
<ProTable<RouteModule.ResponseBody>
actionRef={ref}
rowKey="id"
diff --git a/web/src/pages/Route/locales/en-US.ts
b/web/src/pages/Route/locales/en-US.ts
index 9ac5d2b..5d4be8a 100644
--- a/web/src/pages/Route/locales/en-US.ts
+++ b/web/src/pages/Route/locales/en-US.ts
@@ -148,5 +148,7 @@ export default {
'page.route.tooltip.pluginOrchWithoutRedirect': 'Plugin orchestration mode
cannot be used when Redirect in Step 1 is selected to enable HTTPS.',
'page.route.tabs.normalMode': 'Normal mode',
- 'page.route.tabs.orchestration': 'Plugin orchestration'
+ 'page.route.tabs.orchestration': 'Plugin orchestration',
+
+ 'page.route.list.description': 'A Route is the entry point of a request,
which defines the matching rules between a client request and a service. A
route can be associated with a service (Service), an upstream (Upstream), a
service can correspond to a set of routes, and a route can correspond to an
upstream object (a set of backend service nodes), so each request matching to a
route will be proxied by the gateway to the route-bound upstream service.'
};
diff --git a/web/src/pages/Route/locales/zh-CN.ts
b/web/src/pages/Route/locales/zh-CN.ts
index f2a0d28..54410b2 100644
--- a/web/src/pages/Route/locales/zh-CN.ts
+++ b/web/src/pages/Route/locales/zh-CN.ts
@@ -147,5 +147,7 @@ export default {
'page.route.tooltip.pluginOrchWithoutRedirect': '当步骤一中 重定向 选择为 启用 HTTPS
时,不可使用插件编排模式。',
'page.route.tabs.normalMode': '普通模式',
- 'page.route.tabs.orchestration': '插件编排'
+ 'page.route.tabs.orchestration': '插件编排',
+
+ 'page.route.list.description':
'路由(Route)是请求的入口点,它定义了客户端请求与服务之间的匹配规则。路由可以与服务(Service)、上游(Upstream)关联,一个服务可对应一组路由,一个路由可以对应一个上游对象(一组后端服务节点),因此,每个匹配到路由的请求将被网关代理到路由绑定的上游服务中。'
};