Skip to content

Commit

Permalink
feat: set width for table columns
Browse files Browse the repository at this point in the history
  • Loading branch information
YounixM authored and amlannandy committed Jan 3, 2025
1 parent 9615fbc commit aad4cb1
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
display: flex;
align-items: center;
gap: 16px;
font-size: 11px;

&.pod-group-header {
padding-left: 12px;
Expand All @@ -142,14 +143,39 @@
}

.k8s-list {
.column {
min-width: 180px;
max-width: 180px;

font-size: 12px !important;
}

.column-pod-name {
min-width: 200px;
max-width: 200px;
}

.column-pod-group {
min-width: 200px;
max-width: 200px;
}

.column-progress-bar {
min-width: 180px;
max-width: 180px;
}

.column-dummy {
min-width: 32px;
max-width: 32px;
}

.pod-group {
display: flex;
align-items: center;
gap: 4px;
flex-wrap: wrap;

min-width: 120px;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand All @@ -169,13 +195,7 @@
}

.pod-name {
display: flex;
align-items: center;
gap: 4px;
flex-wrap: wrap;

min-width: 120px;
max-width: 120px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand Down Expand Up @@ -305,6 +325,7 @@
.progress-container {
display: flex;
align-items: center;
flex-direction: column;
}

.progress-bar {
Expand Down Expand Up @@ -495,12 +516,22 @@
.expanded-table-footer {
display: flex;
justify-content: flex-start;
gap: 8px;
padding: 8px;
padding-left: 56px;
padding-left: 42px;
margin-top: 8px;

.periscope-btn {
font-size: 11px;
font-size: 10px;

display: flex;
align-items: center;
gap: 4px;
}

.view-all-text {
font-size: 10px;
color: var(--bg-vanilla-400);
}
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 22 additions & 12 deletions frontend/src/container/InfraMonitoringK8s/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface IPodColumn {
canRemove: boolean;
}

const columnProgressBarClassName = 'column-progress-bar';

export const defaultAddedColumns: IPodColumn[] = [
{
label: 'Pod name',
Expand Down Expand Up @@ -129,34 +131,31 @@ const podGroupColumnConfig = {
),
dataIndex: 'podGroup',
key: 'podGroup',
ellipsis: {
showTitle: false,
},
width: 120,
align: 'left',
ellipsis: true,
width: 180,
sorter: false,
className: 'column column-pod-group',
};

export const dummyColumnConfig = {
title: <div className="column-header dummy-column">&nbsp;</div>,
dataIndex: 'dummy',
key: 'dummy',
width: 25,
width: 26,
sorter: false,
align: 'left',
className: 'column column-dummy',
};

const columnsConfig = [
{
title: <div className="column-header pod-name-header">Pod Name</div>,
dataIndex: 'podName',
key: 'podName',
ellipsis: {
showTitle: false,
},
width: 120,
width: 180,
ellipsis: true,
sorter: true,
align: 'left',
className: 'column column-pod-name',
},
{
title: (
Expand All @@ -168,9 +167,11 @@ const columnsConfig = [
),
dataIndex: 'cpu_request',
key: 'cpu_request',
width: 150,
width: 180,
ellipsis: true,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
{
title: (
Expand All @@ -185,6 +186,7 @@ const columnsConfig = [
width: 150,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
{
title: (
Expand All @@ -199,6 +201,7 @@ const columnsConfig = [
width: 80,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
{
title: (
Expand All @@ -213,6 +216,7 @@ const columnsConfig = [
width: 150,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
{
title: (
Expand All @@ -227,6 +231,7 @@ const columnsConfig = [
width: 150,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
{
title: (
Expand All @@ -242,6 +247,7 @@ const columnsConfig = [
ellipsis: true,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
{
title: (
Expand All @@ -255,6 +261,7 @@ const columnsConfig = [
ellipsis: true,
sorter: true,
align: 'left',
className: `column ${columnProgressBarClassName}`,
},
];

Expand All @@ -266,6 +273,7 @@ export const namespaceColumnConfig = {
sorter: true,
ellipsis: true,
align: 'left',
className: 'column column-namespace',
};

export const nodeColumnConfig = {
Expand All @@ -276,6 +284,7 @@ export const nodeColumnConfig = {
sorter: true,
ellipsis: true,
align: 'left',
className: 'column column-node',
};

export const clusterColumnConfig = {
Expand All @@ -286,6 +295,7 @@ export const clusterColumnConfig = {
sorter: true,
ellipsis: true,
align: 'left',
className: 'column column-cluster',
};

export const columnConfigMap = {
Expand Down

0 comments on commit aad4cb1

Please sign in to comment.