-
Notifications
You must be signed in to change notification settings - Fork 14
feat(Healthcheck): redesign #2348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
503e6c4
fix: loader position for tenant
Raubzeug 5aaf47a
refactor: move EmptyFilter to components
Raubzeug bca7007
feat(Healthcheck): redesign
Raubzeug 85d4064
fix: tests
Raubzeug 0b2b0a2
fix: tests
Raubzeug 41341d6
fix: tests
Raubzeug 4ef00d6
fix(SplitPane): gutter z-index 0
Raubzeug e3087ca
feat(MetricCards): add network utilization
Raubzeug f531ff7
fix: design review
Raubzeug 996c701
fix: add animation
Raubzeug 4eeb23d
fix: add animation
Raubzeug 56713a2
fix: review
Raubzeug 2ce27ab
fix: review
Raubzeug 7281810
fix: animation
Raubzeug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...iners/Storage/EmptyFilter/EmptyFilter.tsx → src/components/EmptyFilter/EmptyFilter.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...tainers/Storage/EmptyFilter/i18n/index.ts → src/components/EmptyFilter/i18n/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"title_fullscreen": "Fullscreen" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {registerKeysets} from '../../../utils/i18n'; | ||
|
||
import en from './en.json'; | ||
|
||
const COMPONENT = 'ydb-fullscreen-button'; | ||
|
||
export default registerKeysets(COMPONENT, {en}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { | ||
CircleCheck, | ||
CircleExclamation, | ||
CircleInfo, | ||
PlugConnection, | ||
TriangleExclamation, | ||
} from '@gravity-ui/icons'; | ||
import type {LabelProps} from '@gravity-ui/uikit'; | ||
import {Icon, Label} from '@gravity-ui/uikit'; | ||
|
||
import {SelfCheckResult} from '../../types/api/healthcheck'; | ||
|
||
import i18n from './i18n'; | ||
|
||
const SelfCheckResultToLabelTheme: Record<SelfCheckResult, LabelProps['theme']> = { | ||
[SelfCheckResult.GOOD]: 'success', | ||
[SelfCheckResult.DEGRADED]: 'info', | ||
[SelfCheckResult.MAINTENANCE_REQUIRED]: 'warning', | ||
[SelfCheckResult.EMERGENCY]: 'danger', | ||
[SelfCheckResult.UNSPECIFIED]: 'normal', | ||
}; | ||
|
||
const SelfCheckResultToIcon: Record< | ||
SelfCheckResult, | ||
(props: React.SVGProps<SVGSVGElement>) => React.JSX.Element | ||
> = { | ||
[SelfCheckResult.GOOD]: CircleCheck, | ||
[SelfCheckResult.DEGRADED]: CircleInfo, | ||
[SelfCheckResult.MAINTENANCE_REQUIRED]: TriangleExclamation, | ||
[SelfCheckResult.EMERGENCY]: CircleExclamation, | ||
[SelfCheckResult.UNSPECIFIED]: PlugConnection, | ||
}; | ||
|
||
const SelfCheckResultToText: Record<SelfCheckResult, string> = { | ||
get [SelfCheckResult.GOOD]() { | ||
return i18n('title_good'); | ||
}, | ||
get [SelfCheckResult.DEGRADED]() { | ||
return i18n('title_degraded'); | ||
}, | ||
get [SelfCheckResult.MAINTENANCE_REQUIRED]() { | ||
return i18n('title_maintenance'); | ||
}, | ||
get [SelfCheckResult.EMERGENCY]() { | ||
return i18n('title_emergency'); | ||
}, | ||
get [SelfCheckResult.UNSPECIFIED]() { | ||
return i18n('title_unspecified'); | ||
}, | ||
}; | ||
|
||
interface HealthcheckStatusProps { | ||
status: SelfCheckResult; | ||
size?: LabelProps['size']; | ||
} | ||
|
||
export function HealthcheckStatus({status, size = 'm'}: HealthcheckStatusProps) { | ||
const theme = SelfCheckResultToLabelTheme[status]; | ||
|
||
return ( | ||
<Label | ||
theme={theme} | ||
icon={<Icon size={14} data={SelfCheckResultToIcon[status]} />} | ||
size={size} | ||
> | ||
{SelfCheckResultToText[status]} | ||
</Label> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"title_degraded": "Degraded", | ||
"title_emergency": "Emergency", | ||
"title_maintenance": "Maintenance required", | ||
"title_good": "Good", | ||
"title_unspecified": "Unspecified" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {registerKeysets} from '../../../utils/i18n'; | ||
|
||
import en from './en.json'; | ||
|
||
const COMPONENT = 'ydb-healthcheck-status'; | ||
|
||
export default registerKeysets(COMPONENT, {en}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ Props description: | |
6) inverseColorize - invert the colors of the progress bar | ||
7) warningThreshold - the percentage of fullness at which the color of the progress bar changes to yellow | ||
8) dangerThreshold - the percentage of fullness at which the color of the progress bar changes to red | ||
9) withOverflow - percents may be more that 100% | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pErcents |
||
|
||
export interface ProgressViewerProps { | ||
|
@@ -49,13 +50,15 @@ export interface ProgressViewerProps { | |
warningThreshold?: number; | ||
dangerThreshold?: number; | ||
hideCapacity?: boolean; | ||
withOverflow?: boolean; | ||
} | ||
|
||
export function ProgressViewer({ | ||
value, | ||
capacity, | ||
formatValues = defaultFormatValues, | ||
percents, | ||
withOverflow, | ||
className, | ||
size = 'xs', | ||
colorizeProgress, | ||
|
@@ -68,12 +71,13 @@ export function ProgressViewer({ | |
|
||
let fillWidth = | ||
Math.floor((parseFloat(String(value)) / parseFloat(String(capacity))) * 100) || 0; | ||
const rawFillWidth = fillWidth; | ||
fillWidth = fillWidth > 100 ? 100 : fillWidth; | ||
let valueText: number | string | undefined = value, | ||
capacityText: number | string | undefined = capacity, | ||
divider = '/'; | ||
if (percents) { | ||
valueText = fillWidth + '%'; | ||
valueText = (withOverflow ? rawFillWidth : fillWidth) + '%'; | ||
capacityText = ''; | ||
divider = ''; | ||
} else if (formatValues) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
|
||
.gutter { | ||
position: relative; | ||
z-index: 10; | ||
|
||
background: var(--g-color-base-background); | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/containers/Storage/PaginatedStorageGroupsTable/StorageGroupsEmptyDataMessage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/containers/Storage/PaginatedStorageNodesTable/StorageNodesEmptyDataMessage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 0 additions & 106 deletions
106
src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's map SelfCheckResultToLabelTheme, no need to translate here