Skip to content
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

fix: use DC and Rack from Location for nodes #713

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Feb 12, 2024

In raw data we have DataCenter field. However, in code we reference it as DC, also backend sort works only with field short name. So replaced DataCenter field with DC everywhere, use DataCenter and Rack from node Location field, where it's possible (it's not present in /viewer/json/compute endpoint)

DC and Rack should appear in Node page, in Nodes and Storage tables, also sort by DC in Nodes and Storage tables now should work properly (experiment "Use table with data load on scroll for Nodes and Storage tabs" should be turned off).

Node page:
Screen Shot 2024-02-12 at 15 51 40

Nodes table:
Screen Shot 2024-02-12 at 15 52 50

Node to test UI: https://nda.ya.ru/t/se1OYEka74Uxro

import type {TEvSystemStateResponse} from '../../../types/api/systemState';
import type {PreparedNode} from './types';

export const prepareNodeData = (data: TEvSystemStateResponse): PreparedNode => {
Copy link
Member Author

Choose a reason for hiding this comment

The 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 - /viewer/json/sysinfo, so there should be different handler

@artemmufazalov artemmufazalov force-pushed the use-dc-from-location branch 2 times, most recently from 6b691e4 to 129386d Compare February 12, 2024 12:37
@@ -34,7 +33,7 @@ export const FullNodeViewer = ({node, className}: FullNodeViewerProps) => {
commonInfo.push(
{label: 'Version', value: node?.Version},
{label: 'Uptime', value: calcUptime(node?.StartTime)},
{label: 'DC', value: node?.DataCenterDescription},
{label: 'DC', value: node?.DataCenterDescription || node?.DC},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataCenterDescription has more data, but it could be empty and short DC name should be used in this case

@@ -12,6 +12,8 @@ const prepareComputeNode = (node: TComputeNodeInfo, tenantName?: string) => {
TenantName: node.Tenant ?? tenantName,
SystemState: node?.Overall,
Uptime: calcUptime(node?.StartTime),

DC: node.DataCenter,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have Location filed in viewer/json/compute

@artemmufazalov artemmufazalov marked this pull request as ready for review February 12, 2024 12:53
@artemmufazalov artemmufazalov merged commit e64c3b0 into main Feb 13, 2024
@artemmufazalov artemmufazalov deleted the use-dc-from-location branch February 13, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Nodes] use DC and Rack from Location field Database/Nodes tab – sort by DC is not working
2 participants