Skip to content

Commit

Permalink
frontend: Node: Fix table columns and empty values
Browse files Browse the repository at this point in the history
This change adjusts the width of the table columns to prevent UI issues
and fills in empty values where applicable.

Fixes: #2100

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
  • Loading branch information
skoeva committed Dec 6, 2024
1 parent 0f93861 commit 7a92511
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/node/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function NodeList() {
{
id: 'cpu',
label: t('CPU'),
gridTemplate: 'min-content',
getValue: node => {
const [used] = getResourceMetrics(node, nodeMetrics || [], 'cpu');
return used;
Expand Down Expand Up @@ -58,7 +59,6 @@ export default function NodeList() {
{
id: 'ready',
label: t('translation|Ready'),
gridTemplate: 'minmax(150px, .3fr)',
getValue: node => {
const isReady = !!node.status.conditions?.find(
condition => condition.type === 'Ready' && condition.status === 'True'
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function NodeList() {
{
id: 'externalIP',
label: t('External IP'),
getValue: node => node.getExternalIP(),
getValue: node => node.getExternalIP() || t('translation|None'),
},
{
id: 'version',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
</div>
</div>
<table
class="MuiTable-root css-15wqx7-MuiTable-root"
class="MuiTable-root css-9umj5b-MuiTable-root"
>
<thead
class="MuiTableHead-root css-1tmrira-MuiTableHead-root"
Expand Down Expand Up @@ -795,7 +795,9 @@
/>
<td
class="MuiTableCell-root MuiTableCell-alignLeft MuiTableCell-sizeMedium css-vl9lcz-MuiTableCell-root"
/>
>
None
</td>
<td
class="MuiTableCell-root MuiTableCell-alignLeft MuiTableCell-sizeMedium css-15vcj44-MuiTableCell-root"
/>
Expand Down Expand Up @@ -891,7 +893,9 @@
/>
<td
class="MuiTableCell-root MuiTableCell-alignLeft MuiTableCell-sizeMedium css-vl9lcz-MuiTableCell-root"
/>
>
None
</td>
<td
class="MuiTableCell-root MuiTableCell-alignLeft MuiTableCell-sizeMedium css-15vcj44-MuiTableCell-root"
/>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/node/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Box, Chip, Tooltip } from '@mui/material';
import { styled } from '@mui/system';
import { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import Node from '../../lib/k8s/node';

const WrappingBox = styled(Box)(({ theme }) => ({
Expand All @@ -19,8 +20,9 @@ const PaddedChip = styled(Chip)({

export function NodeTaintsLabel(props: { node: Node }) {
const { node } = props;
const { t } = useTranslation(['glossary', 'translation']);
if (node.spec?.taints === undefined) {
return <WrappingBox></WrappingBox>;
return <WrappingBox>{t('translation|None')}</WrappingBox>;
}
const limits: ReactNode[] = [];
node.spec.taints.forEach(taint => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"Taints": "",
"Not ready yet!": "Noch nicht fertig!",
"Internal IP": "Interne IP",
"None": "",
"Software": "Software",
"Redirecting to main page…": "Weiterleiten zur Hauptseite…",
"Logs are paused. Click the follow button to resume following them.": "Ereignisprotokolle wurden angehalten. Klicken Sie auf die Schaltfläche \"Verfolgen\", um die Protokollanzeige fortzusetzen.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"Taints": "Taints",
"Not ready yet!": "Not ready yet!",
"Internal IP": "Internal IP",
"None": "None",
"Software": "Software",
"Redirecting to main page…": "Redirecting to main page…",
"Logs are paused. Click the follow button to resume following them.": "Logs are paused. Click the follow button to resume following them.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
"Taints": "",
"Not ready yet!": "¡No listo todavía!",
"Internal IP": "IP interna",
"None": "",
"Software": "Software",
"Redirecting to main page…": "Redireccionando a la página principal…",
"Logs are paused. Click the follow button to resume following them.": "Los registros están en pausa. Haga clic en el botón siguiente para continuar a seguirlos.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
"Taints": "",
"Not ready yet!": "Pas encore prêt !",
"Internal IP": "IP interne",
"None": "",
"Software": "Logiciel",
"Redirecting to main page…": "Redirection vers la page principale…",
"Logs are paused. Click the follow button to resume following them.": "Les journaux sont en pause. Cliquez sur le bouton suivre pour reprendre leur suivi.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
"Taints": "",
"Not ready yet!": "Ainda não pronto!",
"Internal IP": "IP Interno",
"None": "",
"Software": "Software",
"Redirecting to main page…": "A redireccionar para a página principal…",
"Logs are paused. Click the follow button to resume following them.": "Os \"logs\" estão pausados. Clique no seguinte botão para voltar a segui-los.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/zh-tw/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
"Taints": "污點",
"Not ready yet!": "尚未準備好!",
"Internal IP": "內部 IP",
"None": "",
"Software": "軟體",
"Redirecting to main page…": "正在重定向到首頁…",
"Logs are paused. Click the follow button to resume following them.": "日誌已暫停。點擊跟隨按鈕以繼續跟隨它們。",
Expand Down

0 comments on commit 7a92511

Please sign in to comment.