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

chore: update Service module #1749

Merged
merged 2 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions web/src/locales/en-US/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default {
'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',
Expand Down
3 changes: 2 additions & 1 deletion web/src/locales/zh-CN/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default {
'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': '操作',
Expand Down
21 changes: 9 additions & 12 deletions web/src/pages/Service/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,12 @@ const Page: React.FC = (props) => {
(serviceId ? update(serviceId, data) : create(data))
.then(() => {
notification.success({
message: `${
serviceId
? formatMessage({ id: 'component.global.edit' })
: formatMessage({ id: 'component.global.create' })
} ${formatMessage({ id: 'menu.service' })} ${formatMessage({
id: 'component.status.success',
})}`,
message: `${serviceId
? formatMessage({ id: 'component.global.edit' })
: formatMessage({ id: 'component.global.create' })
} ${formatMessage({ id: 'menu.service' })} ${formatMessage({
id: 'component.status.success',
})}`,
});
history.push('/service/list');
})
Expand Down Expand Up @@ -115,11 +114,9 @@ const Page: React.FC = (props) => {
return (
<>
<PageHeaderWrapper
title={`${
(props as any).match.params.serviceId
? formatMessage({ id: 'component.global.edit' })
: formatMessage({ id: 'component.global.create' })
} ${formatMessage({ id: 'menu.service' })}`}
title={(props as any).match.params.serviceId
? formatMessage({ id: 'page.service.configure' })
: formatMessage({ id: 'page.service.create' })}
>
<Card bordered={false}>
<Steps current={step - 1} style={{ marginBottom: '25px' }}>
Expand Down
5 changes: 2 additions & 3 deletions web/src/pages/Service/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const Page: React.FC = () => {
];

return (
<PageHeaderWrapper title={formatMessage({ id: 'page.service.list' })}>
<PageHeaderWrapper title={formatMessage({ id: 'page.service.list' })} content={formatMessage({ id: 'page.service.description' })}>
<ProTable<ServiceModule.ResponseBody>
actionRef={ref}
rowKey="id"
Expand All @@ -129,12 +129,11 @@ const Page: React.FC = () => {
<PlusOutlined />
{formatMessage({ id: 'component.global.create' })}
</Button>,
<Button type="primary" onClick={() => {
<Button type="default" onClick={() => {
setVisible(true);
setEditorMode('create');
setRawData({});
}}>
<PlusOutlined />
{formatMessage({ id: 'component.global.data.editor' })}
</Button>,
]}
Expand Down
6 changes: 3 additions & 3 deletions web/src/pages/Service/components/Step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const Step1: React.FC<ServiceModule.Step1PassProps> = ({
return (
<>
<Form {...FORM_LAYOUT} form={form}>
<Form.Item name="name" label={formatMessage({ id: 'component.global.name' })}>
<Input disabled={disabled} />
<Form.Item name="name" label={formatMessage({ id: 'component.global.name' })} required>
juzhiyuan marked this conversation as resolved.
Show resolved Hide resolved
<Input disabled={disabled} placeholder={formatMessage({ id: 'page.service.fields.name.required' })} />
</Form.Item>
<Form.Item name="desc" label={formatMessage({ id: 'component.global.description' })}>
<Input.TextArea disabled={disabled} />
<Input.TextArea disabled={disabled} placeholder={formatMessage({ id: 'component.global.description.required' })} />
</Form.Item>
</Form>
<UpstreamForm
Expand Down
5 changes: 4 additions & 1 deletion web/src/pages/Service/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ export default {
'page.service.steps.stepTitle.basicInformation': 'Basic Information',
'page.service.steps.stepTitle.pluginConfig': 'Plugin Config',
'page.service.steps.stepTitle.preview': 'Preview',
'page.service.list': 'Service List'
'page.service.list': 'Service List',
'page.service.description': 'A service consists of a combination of public plugin configuration and upstream target information in a route. Services are associated with Routes and Upstreams, and a service can correspond to a set of upstream nodes and can be bound by multiple routes.',
'page.service.create': 'Create Service',
'page.service.configure': 'Configure Service'
};
6 changes: 5 additions & 1 deletion web/src/pages/Service/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ export default {
'page.service.steps.stepTitle.basicInformation': '基本信息',
'page.service.steps.stepTitle.pluginConfig': '插件配置',
'page.service.steps.stepTitle.preview': '预览',
'page.service.list': '服务列表'
'page.service.list': '服务列表',
'page.service.description': '服务由路由中公共的插件配置、上游目标信息组合而成。服务与路由、上游关联,一个服务可对应一组上游节点、可被多条路由绑定。',
'page.service.fields.name.required': '请输入服务名称',
'page.service.create': '创建服务',
'page.service.configure': '配置服务'
};