Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/MemoryViewer/MemoryViewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ $memory-type-colors: (
min-width: 150px;
padding: 0 var(--g-spacing-1);

&_width_full {
width: 100%;
min-width: 40px;
}

&__progress-container {
position: relative;

Expand Down
4 changes: 3 additions & 1 deletion src/components/MemoryViewer/MemoryViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface MemoryProgressViewerProps {
dangerThreshold?: number;
formatValues: FormatProgressViewerValues;
percents?: boolean;
width?: 'full';
}

export function MemoryViewer({
Expand All @@ -52,6 +53,7 @@ export function MemoryViewer({
className,
warningThreshold,
dangerThreshold,
width,
}: MemoryProgressViewerProps) {
const memoryUsage = stats.AnonRss ?? calculateAllocatedMemory(stats);

Expand Down Expand Up @@ -134,7 +136,7 @@ export function MemoryViewer({
</DefinitionList>
)}
>
<div className={b({theme, status}, className)}>
<div className={b({theme, status, width}, className)}>
<div className={b('progress-container')}>
{memorySegments
.filter(({isInfo}) => !isInfo)
Expand Down
5 changes: 5 additions & 0 deletions src/components/ProgressViewer/ProgressViewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
border-radius: 2px;
background: var(--g-color-base-generic);

&_width_full {
width: 100%;
min-width: 40px;
}

&_theme_dark {
color: var(--g-color-text-light-primary);

Expand Down
4 changes: 3 additions & 1 deletion src/components/ProgressViewer/ProgressViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface ProgressViewerProps {
dangerThreshold?: number;
hideCapacity?: boolean;
withOverflow?: boolean;
width?: 'full';
}

export function ProgressViewer({
Expand All @@ -53,6 +54,7 @@ export function ProgressViewer({
warningThreshold,
dangerThreshold,
hideCapacity,
width,
}: ProgressViewerProps) {
const theme = useTheme();

Expand Down Expand Up @@ -96,7 +98,7 @@ export function ProgressViewer({

if (isNumeric(value)) {
return (
<div className={b({size, theme, status}, className)}>
<div className={b({size, theme, status, width}, className)}>
<div className={b('line')} style={lineStyle}></div>
<span className={b('text')}>{renderContent()}</span>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/nodesColumns/NodesColumns.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.ydb-nodes-columns {
&__column-ram,
&__column-cpu {
flex: 1;

min-width: 40px;
}
}
7 changes: 6 additions & 1 deletion src/components/nodesColumns/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,18 @@ export function getMemoryColumn<
defaultOrder: DataTable.DESCENDING,
render: ({row}) => {
return row.MemoryStats ? (
<MemoryViewer formatValues={formatStorageValuesToGb} stats={row.MemoryStats} />
<MemoryViewer
formatValues={formatStorageValuesToGb}
stats={row.MemoryStats}
width="full"
/>
) : (
<ProgressViewer
value={row.MemoryUsed}
capacity={row.MemoryLimit}
formatValues={formatStorageValuesToGb}
colorizeProgress={true}
width="full"
/>
);
},
Expand Down
5 changes: 3 additions & 2 deletions src/containers/Node/Threads/CpuUsageBar/CpuUsageBar.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.cpu-usage-bar {
&__progress {
width: 60px;
min-width: 60px;
flex: 1;

min-width: 40px;
}
}