Skip to content

Commit

Permalink
fix(System/Nodes): minor fixes [YTFRONT-3297]
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-efremoff committed Oct 17, 2024
1 parent 9badece commit cf2862a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
cursor: pointer;
margin-left: 4px;
padding-right: 20px;

&_right-padding_small {
padding-right: 8px;
}
}

.elements {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import block from 'bem-cn-lite';

import ErrorBoundary from '../../components/ErrorBoundary/ErrorBoundary';
Expand All @@ -15,16 +14,6 @@ type PropsStateLess = CollapsibleSectionProps & {
};

export class CollapsibleSectionStateLess extends Component<PropsStateLess> {
static propTypes = {
name: PropTypes.node.isRequired,
collapsed: PropTypes.bool,
onToggle: PropTypes.func.isRequired,
size: PropTypes.oneOf(['s', 'ss', 'xs', 'm', 'l', 'xl', 'ns']),
children: PropTypes.node,
overview: PropTypes.node,
className: PropTypes.string,
};

static defaultProps = {
size: 'm',
collapsed: false,
Expand All @@ -38,7 +27,16 @@ export class CollapsibleSectionStateLess extends Component<PropsStateLess> {
};

render() {
const {name, children, size, overview, className, collapsed, marginDirection} = this.props;
const {
name,
children,
size,
overview,
className,
collapsed,
marginDirection,
togglerRightPadding,
} = this.props;

return (
<ErrorBoundary>
Expand All @@ -57,7 +55,7 @@ export class CollapsibleSectionStateLess extends Component<PropsStateLess> {
{name}
<a>
<Icon
className={b('toggler')}
className={b('toggler', {'right-padding': togglerRightPadding})}
awesome={collapsed ? 'angle-down' : 'angle-up'}
/>
</a>
Expand All @@ -83,6 +81,8 @@ export interface CollapsibleSectionProps {
overview?: React.ReactNode;

marginDirection?: 'top' | 'bottom';

togglerRightPadding?: 'small';
}

export default function CollapsibleSection(props: CollapsibleSectionProps) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/ui/pages/system/Nodes/Nodes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

&__expand-btn {
margin-left: 20px;
margin-left: 8px;
margin-right: 10px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function ProxiesImpl({
onToggle={onToggleCollapsed}
collapsed={collapsed}
size={UI_COLLAPSIBLE_SIZE}
togglerRightPadding="small"
>
<RoleGroupsContainer>
{map_(roleGroups, (data) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/ui/pages/system/ProxiesImpl/StatsInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const COLORS_BY_STATUS = {
ONLINE: ['var(--success-color)', 'var(--success-text)', 'var(--default-color)'],
OFFLINE: ['var(--danger-color)', 'var(--danger-text)', 'var(--default-color)'],
BANNED: ['var(--warning-color)', 'var(--warning-text)', 'var(--default-color)'],
OTHER: [],
OTHER: ['var(--info-color)', 'var(--info-text)', 'var(--default-color)'],
FULL: [],
};

Expand Down Expand Up @@ -80,7 +80,7 @@ export const StatsInfo = ({
</Text>
<Progress className={block('progress')} stack={stack ?? []} size="xs" />

<TextCountUrl text="ALERT" count={alertNumber} color="warning" url={alertsUrl} />
<TextCountUrl text="ALERT" count={alertNumber} color="primary" url={alertsUrl} />
<TextCountUrl text="DEC" count={decNumber} color="primary" url={decUrl} />
</div>
);
Expand Down

0 comments on commit cf2862a

Please # to comment.