Skip to content

Commit

Permalink
add locales
Browse files Browse the repository at this point in the history
fix console error
  • Loading branch information
majian159 committed Sep 3, 2021
1 parent 441a159 commit 263c190
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ swagger-gen:

air:
$(GOBIN)/air -c .air.linux.conf

run-apiserver:
go run cmd/apiserver/main.go

run-dashboard:
cd dashboard && yarn && yarn start
2 changes: 2 additions & 0 deletions dashboard/src/locales/en-US/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ export default {
'menu.cluster.list': 'Clusters',
'menu.application': 'Application',
'menu.application.list': 'Applications',
'menu.application.create': 'Create Application',
'menu.application.edit': 'Edit Application',
};
2 changes: 2 additions & 0 deletions dashboard/src/locales/zh-CN/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ export default {
'menu.cluster.list': '集群列表',
'menu.application': '应用',
'menu.application.list': '应用列表',
'menu.application.create': '创建应用',
'menu.application.edit': '编辑应用',
};
13 changes: 11 additions & 2 deletions dashboard/src/pages/application/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ const Table: React.FC = () => {
);
}}
columns={[
{ title: 'Name', dataIndex: 'name', sorter: true },
{
title: 'Name',
dataIndex: 'name',
sorter: true,
render: (v) => {
return <Link to={`./applications/${v}`}>{v}</Link>;
},
},
{ title: 'Description', dataIndex: 'description', search: false },
{
title: 'Created',
Expand All @@ -65,7 +72,9 @@ const Table: React.FC = () => {
width: 180,
valueType: 'option',
render: (_, record) => [
<Link to={`./applications/${record.name}`}>Edit</Link>,
<Link key="edit" to={`./applications/${record.name}`}>
Edit
</Link>,
<Popconfirm
key="delete"
title="Are you sure to delete this application?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const ApplicationForm: React.FC<{
) : (
app?.components.map((c) => (
<ProCard
key={c.name}
{...componentCardProps}
onClick={() => setEditComponent(c)}
style={{ maxWidth: 300 }}
Expand Down

0 comments on commit 263c190

Please sign in to comment.