chore: update Consumer (#1748)
diff --git a/web/src/locales/en-US/component.ts b/web/src/locales/en-US/component.ts
index d3095bd..fe9e2ea 100644
--- a/web/src/locales/en-US/component.ts
+++ b/web/src/locales/en-US/component.ts
@@ -42,6 +42,7 @@
'component.global.loading': 'Loading',
'component.global.list': 'List',
'component.global.description': 'Description',
+ 'component.global.description.required': 'Please enter the description',
'component.global.labels': 'Labels',
'component.global.version': 'Version',
'component.global.operation': 'Operation',
diff --git a/web/src/locales/zh-CN/component.ts b/web/src/locales/zh-CN/component.ts
index e5f95ce..bf5ee19 100644
--- a/web/src/locales/zh-CN/component.ts
+++ b/web/src/locales/zh-CN/component.ts
@@ -41,7 +41,8 @@
'component.global.edit.plugin': '配置插件',
'component.global.loading': '加载中',
'component.global.list': '列表',
- 'component.global.description': '描述信息',
+ 'component.global.description': '描述',
+ 'component.global.description.required': '请输入描述信息',
'component.global.labels': '标签',
'component.global.version': '路由版本',
'component.global.operation': '操作',
diff --git a/web/src/pages/Consumer/Create.tsx b/web/src/pages/Consumer/Create.tsx
index 112ed59..6350fa8 100644
--- a/web/src/pages/Consumer/Create.tsx
+++ b/web/src/pages/Consumer/Create.tsx
@@ -52,13 +52,12 @@
(username ? update(username, data) : create(data))
.then(() => {
notification.success({
- message: `${
- username
- ? formatMessage({ id: 'component.global.edit' })
- : formatMessage({ id: 'component.global.create' })
- } ${formatMessage({ id: 'menu.consumer' })} ${formatMessage({
- id: 'component.status.success',
- })}`,
+ message: `${username
+ ? formatMessage({ id: 'component.global.edit' })
+ : formatMessage({ id: 'component.global.create' })
+ } ${formatMessage({ id: 'menu.consumer' })} ${formatMessage({
+ id: 'component.status.success',
+ })}`,
});
history.push('/consumer/list');
})
@@ -99,11 +98,10 @@
return (
<>
<PageContainer
- title={`${
- (props as any).match.params.username
- ? formatMessage({ id: 'component.global.edit' })
- : formatMessage({ id: 'component.global.create' })
- } ${formatMessage({ id: 'menu.consumer' })}`}
+ title={`${(props as any).match.params.username
+ ? formatMessage({ id: 'page.consumer.configure' })
+ : formatMessage({ id: 'page.consumer.create' })
+ }`}
>
<Card bordered={false}>
<Steps current={step - 1} style={{ marginBottom: 30 }}>
diff --git a/web/src/pages/Consumer/List.tsx b/web/src/pages/Consumer/List.tsx
index a08a722..d85bf6b 100644
--- a/web/src/pages/Consumer/List.tsx
+++ b/web/src/pages/Consumer/List.tsx
@@ -111,7 +111,7 @@
];
return (
- <PageContainer title={formatMessage({ id: 'page.consumer.list' })}>
+ <PageContainer title={formatMessage({ id: 'page.consumer.list' })} content={formatMessage({ id: "page.consumer.description" })}>
<ProTable<ConsumerModule.ResEntity>
actionRef={ref}
columns={columns}
diff --git a/web/src/pages/Consumer/components/Step1.tsx b/web/src/pages/Consumer/components/Step1.tsx
index 561352b..ce23093 100644
--- a/web/src/pages/Consumer/components/Step1.tsx
+++ b/web/src/pages/Consumer/components/Step1.tsx
@@ -47,20 +47,15 @@
message: formatMessage({ id: 'page.consumer.form.itemRuleMessage.username' }),
},
]}
- extra={formatMessage({ id: 'page.consumer.form.itemExtraMessage.username' })}
>
<Input
- placeholder={`${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
- id: 'page.consumer.username',
- })}`}
+ placeholder={formatMessage({ id: 'page.consumer.username.required' })}
disabled={disabled || window.location.pathname.indexOf('edit') !== -1}
/>
</Form.Item>
<Form.Item label={formatMessage({ id: 'component.global.description' })} name="desc">
<Input.TextArea
- placeholder={`${formatMessage({ id: 'component.global.pleaseEnter' })} ${formatMessage({
- id: 'component.global.description',
- })}`}
+ placeholder={formatMessage({ id: 'component.global.description.required' })}
disabled={disabled}
/>
</Form.Item>
diff --git a/web/src/pages/Consumer/locales/en-US.ts b/web/src/pages/Consumer/locales/en-US.ts
index 80aa1cf..cc2cf0c 100644
--- a/web/src/pages/Consumer/locales/en-US.ts
+++ b/web/src/pages/Consumer/locales/en-US.ts
@@ -21,6 +21,10 @@
'page.consumer.notification.warning.enableAuthenticationPlugin':
'Please enable one authentication plugin',
'page.consumer.username': 'Name',
+ 'page.consumer.username.required': 'Please enter the Consumer\'s name',
'page.consumer.updateTime': 'Update Time',
- 'page.consumer.list': 'Consumer List'
+ 'page.consumer.list': 'Consumer List',
+ 'page.consumer.description': 'Consumers are the consumers of Routes, e.g developers, end users, API calls, etc. When creating a consumer, you need to bind at least one Authentication plugin.',
+ 'page.consumer.create': 'Create Consumer',
+ 'page.consumer.configure': 'Configure Consumer',
};
diff --git a/web/src/pages/Consumer/locales/zh-CN.ts b/web/src/pages/Consumer/locales/zh-CN.ts
index cfb1f68..3c48fc1 100644
--- a/web/src/pages/Consumer/locales/zh-CN.ts
+++ b/web/src/pages/Consumer/locales/zh-CN.ts
@@ -20,6 +20,10 @@
'page.consumer.form.itemExtraMessage.username': '名称需唯一',
'page.consumer.notification.warning.enableAuthenticationPlugin': '请启用一种身份认证类插件',
'page.consumer.username': '名称',
+ 'page.consumer.username.required': '请输入消费者名称',
'page.consumer.updateTime': '更新时间',
- 'page.consumer.list': '消费者列表'
+ 'page.consumer.list': '消费者列表',
+ 'page.consumer.description': '消费者是路由的消费方,形式包括开发者、最终用户、API 调用等。创建消费者时,需绑定至少一个认证类插件。',
+ 'page.consumer.create': '创建消费者',
+ 'page.consumer.configure': '配置消费者',
};