-
Notifications
You must be signed in to change notification settings - Fork 17
feat: support system view #2899
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 2 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,33 @@ | ||
| import type {YDBDefinitionListItem} from '../../../../components/YDBDefinitionList/YDBDefinitionList'; | ||
| import {YDBDefinitionList} from '../../../../components/YDBDefinitionList/YDBDefinitionList'; | ||
| import type {TEvDescribeSchemeResult} from '../../../../types/api/schema'; | ||
| import {prepareSystemViewType} from '../../../../utils/schema'; | ||
| import {getEntityName} from '../../utils'; | ||
| import i18n from '../i18n'; | ||
|
|
||
| const prepareSystemViewItems = (data: TEvDescribeSchemeResult): YDBDefinitionListItem[] => { | ||
| const systemViewType = data.PathDescription?.SysViewDescription?.Type; | ||
|
|
||
| return [ | ||
| { | ||
| name: i18n('field_system-view-type'), | ||
| content: prepareSystemViewType(systemViewType), | ||
| }, | ||
| ]; | ||
| }; | ||
|
|
||
| interface SystemViewInfoProps { | ||
| data?: TEvDescribeSchemeResult; | ||
| } | ||
|
|
||
| export function SystemViewInfo({data}: SystemViewInfoProps) { | ||
| const entityName = getEntityName(data?.PathDescription); | ||
|
|
||
| if (!data) { | ||
| return <div className="error">{i18n('no-entity-data', {entityName})}</div>; | ||
|
||
| } | ||
|
|
||
| const items = prepareSystemViewItems(data); | ||
|
|
||
| return <YDBDefinitionList title={entityName} items={items} />; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import type {TPathID} from './shared'; | ||
|
|
||
| export interface TSysViewDescription { | ||
| Name?: string; | ||
| Type?: ESysViewType; | ||
| SourceObject?: TPathID; | ||
| } | ||
|
|
||
| export type ESysViewType = | ||
| | 'EPartitionStats' | ||
| | 'ENodes' | ||
| | 'ETopQueriesByDurationOneMinute' | ||
| | 'ETopQueriesByDurationOneHour' | ||
| | 'ETopQueriesByReadBytesOneMinute' | ||
| | 'ETopQueriesByReadBytesOneHour' | ||
| | 'ETopQueriesByCpuTimeOneMinute' | ||
| | 'ETopQueriesByCpuTimeOneHour' | ||
| | 'ETopQueriesByRequestUnitsOneMinute' | ||
| | 'ETopQueriesByRequestUnitsOneHour' | ||
| | 'EQuerySessions' | ||
| | 'EPDisks' | ||
| | 'EVSlots' | ||
| | 'EGroups' | ||
| | 'EStoragePools' | ||
| | 'EStorageStats' | ||
| | 'ETablets' | ||
| | 'EQueryMetricsOneMinute' | ||
| | 'ETopPartitionsByCpuOneMinute' | ||
| | 'ETopPartitionsByCpuOneHour' | ||
| | 'ETopPartitionsByTliOneMinute' | ||
| | 'ETopPartitionsByTliOneHour' | ||
| | 'EResourcePoolClassifiers' | ||
| | 'EResourcePools' | ||
| | 'EAuthUsers' | ||
| | 'EAuthGroups' | ||
| | 'EAuthGroupMembers' | ||
| | 'EAuthOwners' | ||
| | 'EAuthPermissions' | ||
| | 'EAuthEffectivePermissions' | ||
| | 'EPgTables' | ||
| | 'EInformationSchemaTables' | ||
| | 'EPgClass' | ||
| | 'EShowCreate' | ||
| | 'ECompileCacheQueries'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import type {ESysViewType} from '../types/api/schema/sysView'; | ||
|
|
||
| export function prepareSystemViewType(type?: ESysViewType) { | ||
| if (!type) { | ||
| return undefined; | ||
| } | ||
| if (type.startsWith('E')) { | ||
|
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. That looks fragile - would be great if you left some comment what and why is 'E' 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. Added comment |
||
| return type.slice(1); | ||
| } | ||
| return type; | ||
artemmufazalov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.