Skip to content

Commit

Permalink
fix a small issue
Browse files Browse the repository at this point in the history
Signed-off-by: farodin91 <[email protected]>
  • Loading branch information
farodin91 committed Dec 12, 2024
1 parent e8b9bc5 commit a1a6c60
Show file tree
Hide file tree
Showing 12 changed files with 1,953 additions and 2,492 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/gateway/HTTPRouteDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function HTTPRouteDetails(props: { name?: string; namespace?: str
httpRoute && [
{
name: 'Hostnames',
value: <LabelListItem labels={httpRoute.hostnames?.map(tls => `${tls}`)} />,
value: <LabelListItem labels={httpRoute.hostnames.map(tls => `${tls}`)} />,
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/gateway/HTTPRouteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function HTTPRouteList() {
{
id: 'rules',
label: t('translation|rules'),
getValue: (httpRoute: HTTPRoute) => httpRoute.spec.rules.length,
getValue: (httpRoute: HTTPRoute) => httpRoute.spec.rules?.length,
},
'age',
]}
Expand Down
1,016 changes: 444 additions & 572 deletions frontend/src/components/gateway/__snapshots__/ClassList.Items.stories.storyshot

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
>
GRPCRoute
GRPCRoute: default-httproute
</h1>
<div
class="MuiBox-root css-ldp2l3"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
>
Gateway
Gateway: default-gateway
</h1>
<div
class="MuiBox-root css-ldp2l3"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
>
HTTPRoute
HTTPRoute: default-httproute
</h1>
<div
class="MuiBox-root css-ldp2l3"
Expand Down

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions frontend/src/i18n/locales/zh-tw/glossary.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,22 @@
"Port": "端口",
"Protocol": "協定",
"Endpoints": "端點",
"Controller Name": "",
"Gateway Classes": "",
"Controller": "控制器",
"Class Name": "類別名稱",
"Addresses": "",
"Listeners": "",
"No data": "",
"Gateways": "",
"GRPCRoutes": "",
"Rules": "規則",
"HttpRoutes": "",
"Hostnames": "",
"Horizontal Pod Autoscalers": "水平 Pod 自動擴縮",
"Ingress Classes": "Ingress 類別",
"Default Ingress Class": "預設 Ingress 類別",
"Controller": "控制器",
"Default Backend": "預設後端",
"Class Name": "類別名稱",
"Rules": "規則",
"Backends": "後端",
"Ingresses": "Ingresses",
"Hosts": "主機",
Expand Down Expand Up @@ -165,6 +174,9 @@
"Persistent Volumes": "持續性卷",
"Storage Classes": "儲存類別",
"Network": "網路",
"Gateway": "",
"HTTP Routes": "",
"GRPC Routes": "",
"Security": "安全",
"Configuration": "配置",
"HPAs": "水平 Pod 自動擴縮",
Expand Down
15 changes: 13 additions & 2 deletions frontend/src/i18n/locales/zh-tw/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,19 @@
"Current": "當前",
"Desired//context:pods": "期望",
"Addresses": "地址",
"Hostname": "",
"Port": "",
"Protocol": "",
"No addresses data to be shown.": "",
"Listeners": "",
"BackendRefs": "",
"Matches": "",
"rules": "",
"ParentRefs": "",
"No rules data to be shown.": "無規則數據顯示。",
"Namespace": "命名空間",
"Kind": "",
"Section Name": "",
"Search": "搜索",
"Press<1>/</1>to search": "按<1>/</1>搜索",
"Search resources, pages, clusters by name": "按名稱搜索資源、頁面、叢集",
Expand All @@ -338,7 +351,6 @@
"Targets": "目標",
"more…": "更多…",
"Default": "預設",
"No rules data to be shown.": "無規則數據顯示。",
"Host": "主機",
"Path": "路徑",
"Duration": "持續時間",
Expand Down Expand Up @@ -393,7 +405,6 @@
"Zoom out": "縮小",
"No data to be shown. Try to change filters or select a different namespace.": "無數據顯示。嘗試更改篩選器或選擇不同的命名空間。",
"Group By: {{ name }}": "分組:{{ name }}",
"Namespace": "命名空間",
"Instance": "實例",
"Node": "節點",
"Status: Error or Warning": "狀態:錯誤或警告",
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/lib/k8s/httpRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export interface HTTPRouteRule {
*/
export interface KubeHTTPRoute extends KubeObjectInterface {
spec: {
hostnames: string[];
parentRefs: GatewayParentReference[];
rules: HTTPRouteRule[];
hostnames?: string[];
parentRefs?: GatewayParentReference[];
rules?: HTTPRouteRule[];
[key: string]: any;
};
}
Expand All @@ -42,15 +42,15 @@ class HTTPRoute extends KubeObject<KubeHTTPRoute> {
}

get hostnames(): string[] {
return this.jsonData.spec.hostnames;
return this.jsonData.spec.hostnames || [];
}

get rules(): HTTPRouteRule[] {
return this.jsonData.spec.rules;
return this.jsonData.spec.rules || [];
}

get parentRefs(): GatewayParentReference[] {
return this.jsonData.spec.parentRefs;
return this.jsonData.spec.parentRefs || [];
}

static get pluralName() {
Expand Down

0 comments on commit a1a6c60

Please sign in to comment.