-
Notifications
You must be signed in to change notification settings - Fork 17
fix: use DC and Rack from Location for nodes #713
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import type {TEvSystemStateResponse} from '../../../types/api/systemState'; | ||
| import type {PreparedNode} from './types'; | ||
|
|
||
| export const prepareNodeData = (data: TEvSystemStateResponse): PreparedNode => { | ||
|
Member
Author
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. Although is looks similar to other nodes preparation functions, it's different endpoint - |
||
| if (!data.SystemStateInfo?.length) { | ||
| return {}; | ||
| } | ||
|
|
||
| const nodeData = data.SystemStateInfo[0]; | ||
|
|
||
| return { | ||
| ...nodeData, | ||
| DC: nodeData.Location?.DataCenter, | ||
| Rack: nodeData.Location?.Rack, | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ const prepareComputeNode = (node: TComputeNodeInfo, tenantName?: string) => { | |
| TenantName: node.Tenant ?? tenantName, | ||
| SystemState: node?.Overall, | ||
| Uptime: calcUptime(node?.StartTime), | ||
|
|
||
| DC: node.DataCenter, | ||
|
Member
Author
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. We don't have |
||
| }; | ||
| }; | ||
|
|
||
|
|
@@ -60,6 +62,9 @@ export const prepareNodesData = (data: TNodesInfo): NodesHandledResponse => { | |
| Uptime: calcUptime(node.SystemState?.StartTime), | ||
| TenantName: node.SystemState?.Tenants?.[0], | ||
|
|
||
| DC: node.SystemState.Location?.DataCenter, | ||
| Rack: node.SystemState.Location?.Rack, | ||
|
|
||
| SharedCacheUsed: node.SystemState.SharedCacheStats?.UsedBytes, | ||
| SharedCacheLimit: sharedCacheLimit, | ||
| }; | ||
|
|
||
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.
DataCenterDescriptionhas more data, but it could be empty and short DC name should be used in this case