Skip to content

Commit

Permalink
feat: Add a new domain column to the route list (higress-group#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO authored Jan 3, 2025
1 parent fdebdac commit 3b1e51e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@
"route": {
"columns": {
"name": "Route Name",
"domains": "Domain",
"routePredicates": "Route Predicates",
"services": "Service",
"action": "Action"
Expand Down
1 change: 1 addition & 0 deletions frontend/src/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
"route": {
"columns": {
"name": "路由名称",
"domains": "域名",
"routePredicates": "路由条件",
"services": "目标服务",
"action": "操作"
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/pages/route/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ const RouteList: React.FC = () => {
key: 'name',
ellipsis: true,
},
{
title: t('route.columns.domains'),
dataIndex: 'domains',
key: 'domains',
render: (value) => {
if (!Array.isArray(value) || !value.length) {
return '-';
}
return value.map((token) => <span>{token}</span>).reduce((prev, curr) => [prev, <br />, curr]);
},
},
{
title: t('route.columns.routePredicates'),
dataIndex: 'path',
Expand Down

0 comments on commit 3b1e51e

Please sign in to comment.