ydb-embedded-ui 5.3.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. package/dist/components/DiskPageTitle/DiskPageTitle.d.ts +11 -0
  2. package/dist/components/DiskPageTitle/DiskPageTitle.js +8 -0
  3. package/dist/components/DiskPageTitle/DiskPageTitle.scss +17 -0
  4. package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.js +3 -3
  5. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  6. package/dist/components/GroupInfo/GroupInfo.d.ts +8 -0
  7. package/dist/components/GroupInfo/GroupInfo.js +28 -0
  8. package/dist/components/GroupInfo/i18n/en.json +6 -0
  9. package/dist/components/GroupInfo/i18n/index.d.ts +1 -0
  10. package/dist/components/GroupInfo/i18n/index.js +4 -0
  11. package/dist/components/MetricChart/MetricChart.js +12 -5
  12. package/dist/components/MetricChart/colors.d.ts +2 -0
  13. package/dist/components/MetricChart/colors.js +21 -0
  14. package/dist/components/MetricChart/getDefaultDataFormatter.js +9 -0
  15. package/dist/components/MetricChart/types.d.ts +11 -2
  16. package/dist/components/MonacoEditor/MonacoEditor.d.ts +2 -0
  17. package/dist/components/MonacoEditor/MonacoEditor.js +7 -0
  18. package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.d.ts +3 -3
  19. package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.js +6 -5
  20. package/dist/components/PageMeta/PageMeta.d.ts +2 -1
  21. package/dist/components/PageMeta/PageMeta.js +9 -2
  22. package/dist/components/PageMeta/PageMeta.scss +9 -0
  23. package/dist/components/Stack/Stack.scss +2 -0
  24. package/dist/{containers/Storage → components}/VDisk/VDisk.d.ts +2 -2
  25. package/dist/{containers/Storage → components}/VDisk/VDisk.js +8 -8
  26. package/dist/{containers/Storage → components}/VDisk/VDisk.scss +1 -1
  27. package/dist/components/VDisk/VDiskWithDonorsStack.d.ts +12 -0
  28. package/dist/components/VDisk/VDiskWithDonorsStack.js +14 -0
  29. package/dist/components/VDiskInfo/VDiskInfo.d.ts +10 -0
  30. package/dist/components/VDiskInfo/VDiskInfo.js +113 -0
  31. package/dist/components/VDiskInfo/VDiskInfo.scss +8 -0
  32. package/dist/components/VDiskInfo/i18n/en.json +23 -0
  33. package/dist/components/VDiskInfo/i18n/index.d.ts +1 -0
  34. package/dist/components/VDiskInfo/i18n/index.js +4 -0
  35. package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.d.ts +3 -3
  36. package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.js +8 -7
  37. package/dist/components/VirtualTable/TableHead.d.ts +2 -1
  38. package/dist/components/VirtualTable/TableHead.js +6 -6
  39. package/dist/components/VirtualTable/constants.d.ts +1 -0
  40. package/dist/components/VirtualTable/constants.js +1 -0
  41. package/dist/containers/App/App.js +0 -2
  42. package/dist/containers/App/App.scss +3 -0
  43. package/dist/containers/App/Content.js +19 -5
  44. package/dist/containers/App/appSlots.d.ts +9 -3
  45. package/dist/containers/App/appSlots.js +2 -1
  46. package/dist/containers/Header/breadcrumbs.js +12 -0
  47. package/dist/containers/Header/i18n/en.json +1 -0
  48. package/dist/containers/Header/i18n/index.d.ts +1 -1
  49. package/dist/containers/Heatmap/HeatmapCanvas/HeatmapCanvas.js +2 -2
  50. package/dist/containers/Node/NodeStructure/NodeStructure.js +1 -1
  51. package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
  52. package/dist/containers/Node/NodeStructure/Vdisk.d.ts +6 -2
  53. package/dist/containers/Node/NodeStructure/Vdisk.js +5 -78
  54. package/dist/containers/Nodes/getNodesColumns.js +0 -1
  55. package/dist/containers/PDiskPage/PDiskPage.d.ts +3 -0
  56. package/dist/containers/{PDisk/PDisk.js → PDiskPage/PDiskPage.js} +30 -14
  57. package/dist/containers/{PDisk/PDisk.scss → PDiskPage/PDiskPage.scss} +1 -14
  58. package/dist/containers/PDiskPage/i18n/en.json +8 -0
  59. package/dist/containers/PDiskPage/i18n/index.d.ts +1 -0
  60. package/dist/containers/Storage/PDisk/PDisk.js +4 -10
  61. package/dist/containers/Storage/PDisk/PDisk.scss +0 -2
  62. package/dist/containers/Storage/Storage.js +1 -2
  63. package/dist/containers/Storage/StorageGroups/StorageGroups.scss +1 -7
  64. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +1 -1
  65. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +9 -17
  66. package/dist/containers/Storage/VirtualStorage.js +3 -7
  67. package/dist/containers/Tablet/TabletControls/TabletControls.js +2 -1
  68. package/dist/containers/TabletsFilters/TabletsFilters.d.ts +2 -2
  69. package/dist/containers/TabletsFilters/TabletsFilters.js +7 -6
  70. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +1 -1
  71. package/dist/containers/Tenant/Diagnostics/Network/Network.js +2 -2
  72. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +1 -2
  73. package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.js +1 -1
  74. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/cpuDashboardConfig.js +14 -5
  75. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +1 -1
  76. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +5 -3
  77. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +6 -4
  78. package/dist/containers/Tenant/Query/SaveQuery/SaveQuery.js +2 -2
  79. package/dist/containers/Tenant/Tenant.js +10 -5
  80. package/dist/containers/Tenants/Tenants.js +3 -2
  81. package/dist/containers/VDiskPage/VDiskPage.d.ts +3 -0
  82. package/dist/containers/VDiskPage/VDiskPage.js +109 -0
  83. package/dist/containers/VDiskPage/VDiskPage.scss +32 -0
  84. package/dist/containers/VDiskPage/i18n/en.json +9 -0
  85. package/dist/containers/VDiskPage/i18n/index.d.ts +1 -0
  86. package/dist/containers/VDiskPage/i18n/index.js +4 -0
  87. package/dist/containers/Versions/groupNodes.js +1 -1
  88. package/dist/routes.d.ts +3 -0
  89. package/dist/routes.js +5 -0
  90. package/dist/services/api.d.ts +12 -4
  91. package/dist/services/api.js +39 -4
  92. package/dist/store/configureStore.d.ts +4 -0
  93. package/dist/store/defaultStore.d.ts +2 -0
  94. package/dist/store/reducers/authentication/authentication.d.ts +3 -0
  95. package/dist/store/reducers/cluster/cluster.d.ts +1 -0
  96. package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +1 -0
  97. package/dist/store/reducers/clusters/clusters.d.ts +1 -0
  98. package/dist/store/reducers/clusters/selectors.js +1 -1
  99. package/dist/store/reducers/describe.d.ts +2 -0
  100. package/dist/store/reducers/executeQuery.d.ts +1 -0
  101. package/dist/store/reducers/explainQuery.d.ts +2 -0
  102. package/dist/store/reducers/header/types.d.ts +4 -1
  103. package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +1 -0
  104. package/dist/store/reducers/heatmap.d.ts +1 -0
  105. package/dist/store/reducers/host.d.ts +1 -0
  106. package/dist/store/reducers/index.d.ts +3 -0
  107. package/dist/store/reducers/index.js +2 -0
  108. package/dist/store/reducers/network/network.d.ts +1 -0
  109. package/dist/store/reducers/node/node.d.ts +2 -0
  110. package/dist/store/reducers/node/selectors.js +1 -1
  111. package/dist/store/reducers/nodes/nodes.d.ts +2 -0
  112. package/dist/store/reducers/nodesList.d.ts +1 -0
  113. package/dist/store/reducers/olapStats.d.ts +1 -0
  114. package/dist/store/reducers/overview/overview.d.ts +2 -0
  115. package/dist/store/reducers/partitions/partitions.d.ts +1 -0
  116. package/dist/store/reducers/pdisk/pdisk.d.ts +2 -0
  117. package/dist/store/reducers/pdisk/utils.js +1 -1
  118. package/dist/store/reducers/preview.d.ts +1 -0
  119. package/dist/store/reducers/schema/schema.d.ts +1 -0
  120. package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +1 -0
  121. package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +1 -0
  122. package/dist/store/reducers/storage/storage.d.ts +2 -0
  123. package/dist/store/reducers/storage/types.d.ts +3 -1
  124. package/dist/store/reducers/storage/utils.d.ts +1 -1
  125. package/dist/store/reducers/storage/utils.js +8 -9
  126. package/dist/store/reducers/tablet.d.ts +2 -0
  127. package/dist/store/reducers/tablets.d.ts +1 -0
  128. package/dist/store/reducers/tabletsFilters.d.ts +1 -0
  129. package/dist/store/reducers/tenant/tenant.d.ts +1 -0
  130. package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +1 -0
  131. package/dist/store/reducers/tenantOverview/topNodesByCpu/topNodesByCpu.d.ts +1 -0
  132. package/dist/store/reducers/tenantOverview/topNodesByLoad/topNodesByLoad.d.ts +1 -0
  133. package/dist/store/reducers/tenantOverview/topNodesByMemory/topNodesByMemory.d.ts +1 -0
  134. package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.d.ts +1 -0
  135. package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +1 -0
  136. package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +1 -0
  137. package/dist/store/reducers/tenants/selectors.js +1 -1
  138. package/dist/store/reducers/tenants/tenants.d.ts +1 -0
  139. package/dist/store/reducers/topic.d.ts +1 -0
  140. package/dist/store/reducers/vdisk/types.d.ts +25 -0
  141. package/dist/store/reducers/vdisk/utils.d.ts +11 -0
  142. package/dist/store/reducers/vdisk/utils.js +33 -0
  143. package/dist/store/reducers/vdisk/vdisk.d.ts +100 -0
  144. package/dist/store/reducers/vdisk/vdisk.js +64 -0
  145. package/dist/store/state-url-mapping.js +6 -4
  146. package/dist/types/api/storage.d.ts +2 -0
  147. package/dist/utils/bytesParsers/__test__/formatBytes.test.js +7 -7
  148. package/dist/utils/clusterVersionColors.js +1 -1
  149. package/dist/utils/dataFormatters/dataFormatters.js +1 -0
  150. package/dist/utils/disks/constants.js +2 -2
  151. package/dist/utils/disks/types.d.ts +5 -1
  152. package/dist/utils/filters.js +1 -1
  153. package/dist/utils/hooks/useTableResize.d.ts +1 -1
  154. package/dist/utils/hooks/useTableResize.js +5 -3
  155. package/dist/utils/lazyComponent.d.ts +4 -0
  156. package/dist/utils/lazyComponent.js +25 -0
  157. package/dist/utils/monaco/index.d.ts +1 -0
  158. package/dist/utils/monaco/index.js +4 -0
  159. package/dist/utils/monaco/s-expression/constants.d.ts +1 -0
  160. package/dist/utils/monaco/s-expression/constants.js +1 -0
  161. package/dist/utils/monaco/s-expression/registerLanguage.d.ts +1 -0
  162. package/dist/utils/{monaco.js → monaco/s-expression/registerLanguage.js} +2 -19
  163. package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/generateSuggestions.d.ts +2 -2
  164. package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/generateSuggestions.js +40 -11
  165. package/dist/utils/monaco/yqlSuggestions/registerCompletionItemProvider.d.ts +1 -0
  166. package/dist/utils/monaco/yqlSuggestions/registerCompletionItemProvider.js +15 -0
  167. package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/yqlSuggestions.js +1 -1
  168. package/dist/utils/numeral.js +7 -1
  169. package/dist/utils/storage.d.ts +1 -0
  170. package/dist/utils/storage.js +1 -0
  171. package/dist/utils/timeParsers/parsers.js +1 -1
  172. package/package.json +5 -2
  173. package/dist/containers/PDisk/PDisk.d.ts +0 -3
  174. package/dist/containers/PDisk/i18n/en.json +0 -6
  175. package/dist/containers/PDisk/i18n/index.d.ts +0 -1
  176. package/dist/containers/Storage/DiskStateProgressBar/index.d.ts +0 -1
  177. package/dist/containers/Storage/DiskStateProgressBar/index.js +0 -1
  178. package/dist/containers/Storage/PDiskPopup/index.d.ts +0 -1
  179. package/dist/containers/Storage/PDiskPopup/index.js +0 -1
  180. package/dist/containers/Storage/VDisk/index.d.ts +0 -1
  181. package/dist/containers/Storage/VDisk/index.js +0 -1
  182. package/dist/containers/Storage/VDiskPopup/index.d.ts +0 -1
  183. package/dist/containers/Storage/VDiskPopup/index.js +0 -1
  184. package/dist/containers/Storage/utils/types.d.ts +0 -5
  185. package/dist/utils/monaco.d.ts +0 -3
  186. /package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.d.ts +0 -0
  187. /package/dist/{containers/Storage → components}/DiskStateProgressBar/DiskStateProgressBar.scss +0 -0
  188. /package/dist/{containers/Storage → components}/PDiskPopup/PDiskPopup.scss +0 -0
  189. /package/dist/{containers/Storage → components}/VDiskPopup/VDiskPopup.scss +0 -0
  190. /package/dist/containers/{PDisk → PDiskPage}/PDiskGroups.d.ts +0 -0
  191. /package/dist/containers/{PDisk → PDiskPage}/PDiskGroups.js +0 -0
  192. /package/dist/containers/{PDisk → PDiskPage}/i18n/index.js +0 -0
  193. /package/dist/containers/{PDisk → PDiskPage}/shared.d.ts +0 -0
  194. /package/dist/containers/{PDisk → PDiskPage}/shared.js +0 -0
  195. /package/dist/{containers/Storage/utils → store/reducers/vdisk}/types.js +0 -0
  196. /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/constants.d.ts +0 -0
  197. /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/constants.js +0 -0
  198. /package/dist/utils/{yqlSuggestions → monaco/yqlSuggestions}/yqlSuggestions.d.ts +0 -0
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { EFlag } from '../../types/api/enums';
3
+ import './DiskPageTitle.scss';
4
+ interface DiskPageTitleProps {
5
+ entityName: ReactNode;
6
+ status: EFlag;
7
+ id: ReactNode;
8
+ className?: string;
9
+ }
10
+ export declare function DiskPageTitle({ entityName, status, id, className }: DiskPageTitleProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../utils/cn';
3
+ import { StatusIcon } from '../StatusIcon/StatusIcon';
4
+ import './DiskPageTitle.scss';
5
+ const b = cn('ydb-disk-page-title');
6
+ export function DiskPageTitle({ entityName, status, id, className }) {
7
+ return (_jsxs("div", Object.assign({ className: b(null, className) }, { children: [_jsx("span", Object.assign({ className: b('prefix') }, { children: entityName })), _jsx(StatusIcon, { status: status, size: "s" }), id] })));
8
+ }
@@ -0,0 +1,17 @@
1
+ @import '../../styles/mixins.scss';
2
+
3
+ .ydb-disk-page-title {
4
+ display: flex;
5
+ flex-flow: row nowrap;
6
+ align-items: baseline;
7
+
8
+ text-wrap: nowrap;
9
+
10
+ @include header-2-typography();
11
+
12
+ &__prefix {
13
+ margin-right: 6px;
14
+
15
+ color: var(--g-color-text-secondary);
16
+ }
17
+ }
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import cn from 'bem-cn-lite';
4
- import { INVERTED_DISKS_KEY } from '../../../utils/constants';
5
- import { useSetting } from '../../../utils/hooks';
6
- import { getSeverityColor } from '../../../utils/disks/helpers';
4
+ import { INVERTED_DISKS_KEY } from '../../utils/constants';
5
+ import { useSetting } from '../../utils/hooks';
6
+ import { getSeverityColor } from '../../utils/disks/helpers';
7
7
  import './DiskStateProgressBar.scss';
8
8
  const b = cn('storage-disk-progress-bar');
9
9
  export function DiskStateProgressBar({ diskAllocatedPercent = -1, severity, compact, }) {
@@ -12,7 +12,7 @@ export declare function ErrorBoundaryInner({ children, useRetry, onReportProblem
12
12
  interface ErrorBoundaryFallbackProps {
13
13
  error: Error;
14
14
  useRetry?: boolean;
15
- resetErrorBoundary: () => void;
15
+ resetErrorBoundary?: () => void;
16
16
  onReportProblem?: (error?: Error) => void;
17
17
  }
18
18
  export declare function ErrorBoundaryFallback({ error, resetErrorBoundary, useRetry, onReportProblem, }: ErrorBoundaryFallbackProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { PreparedStorageGroup } from '../../store/reducers/storage/types';
3
+ import type { InfoViewerProps } from '../InfoViewer/InfoViewer';
4
+ interface GroupInfoProps<T extends Partial<PreparedStorageGroup>> extends Omit<InfoViewerProps, 'info'> {
5
+ data: T;
6
+ }
7
+ export declare function GroupInfo<T extends Partial<PreparedStorageGroup>>({ data, ...infoViewerProps }: GroupInfoProps<T>): JSX.Element;
8
+ export {};
@@ -0,0 +1,28 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { valueIsDefined } from '../../utils';
4
+ import { formatStorageValuesToGb } from '../../utils/dataFormatters/dataFormatters';
5
+ import { InfoViewer } from '../InfoViewer';
6
+ import { ProgressViewer } from '../ProgressViewer/ProgressViewer';
7
+ import { groupInfoKeyset } from './i18n';
8
+ export function GroupInfo(_a) {
9
+ var { data } = _a, infoViewerProps = __rest(_a, ["data"]);
10
+ const { GroupID, PoolName, Used, Limit, ErasureSpecies } = data;
11
+ const groupInfo = [];
12
+ if (valueIsDefined(GroupID)) {
13
+ groupInfo.push({ label: groupInfoKeyset('group-id'), value: GroupID });
14
+ }
15
+ if (valueIsDefined(PoolName)) {
16
+ groupInfo.push({ label: groupInfoKeyset('pool-name'), value: PoolName });
17
+ }
18
+ if (valueIsDefined(ErasureSpecies)) {
19
+ groupInfo.push({ label: groupInfoKeyset('erasure'), value: ErasureSpecies });
20
+ }
21
+ if (Number(Used) >= 0 && Number(Limit) >= 0) {
22
+ groupInfo.push({
23
+ label: groupInfoKeyset('size'),
24
+ value: (_jsx(ProgressViewer, { value: Used, capacity: Limit, formatValues: formatStorageValuesToGb, colorizeProgress: true })),
25
+ });
26
+ }
27
+ return _jsx(InfoViewer, Object.assign({ info: groupInfo }, infoViewerProps));
28
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "group-id": "Group ID",
3
+ "pool-name": "Storage Pool Name",
4
+ "size": "Size",
5
+ "erasure": "Erasure"
6
+ }
@@ -0,0 +1 @@
1
+ export declare const groupInfoKeyset: (key: "size" | "group-id" | "erasure" | "pool-name", params?: import("@gravity-ui/i18n").Params | undefined) => string;
@@ -0,0 +1,4 @@
1
+ import { registerKeysets } from '../../../utils/i18n';
2
+ import en from './en.json';
3
+ const COMPONENT = 'ydb-group-info';
4
+ export const groupInfoKeyset = registerKeysets(COMPONENT, { en });
@@ -3,7 +3,6 @@ import { useCallback, useEffect, useReducer, useRef } from 'react';
3
3
  import { YagrPlugin } from '@gravity-ui/chartkit/yagr';
4
4
  import ChartKit, { settings } from '@gravity-ui/chartkit';
5
5
  import { useAutofetcher } from '../../utils/hooks';
6
- import { COLORS } from '../../utils/versions';
7
6
  import { cn } from '../../utils/cn';
8
7
  import { Loader } from '../Loader';
9
8
  import { ResponseError } from '../Errors/ResponseError';
@@ -11,21 +10,26 @@ import { convertResponse } from './convertReponse';
11
10
  import { getDefaultDataFormatter } from './getDefaultDataFormatter';
12
11
  import { getChartData } from './getChartData';
13
12
  import { chartReducer, initialChartState, setChartData, setChartDataLoading, setChartDataWasNotLoaded, setChartError, } from './reducer';
13
+ import { colorToRGBA, colors } from './colors';
14
14
  import i18n from './i18n';
15
15
  import './MetricChart.scss';
16
16
  const b = cn('ydb-metric-chart');
17
17
  settings.set({ plugins: [YagrPlugin] });
18
18
  const prepareWidgetData = (data, options = {}) => {
19
- const { dataType } = options;
19
+ const { dataType, scaleRange } = options;
20
20
  const defaultDataFormatter = getDefaultDataFormatter(dataType);
21
21
  const isDataEmpty = !data.metrics.length;
22
22
  const graphs = data.metrics.map((metric, index) => {
23
+ const lineColor = metric.color || colors[index];
24
+ const color = colorToRGBA(lineColor, 0.1);
23
25
  return {
24
26
  id: metric.target,
25
27
  name: metric.title || metric.target,
26
- color: metric.color || COLORS[index],
27
28
  data: metric.data,
28
29
  formatter: defaultDataFormatter,
30
+ lineColor,
31
+ color,
32
+ legendColorKey: 'lineColor',
29
33
  };
30
34
  });
31
35
  return {
@@ -41,7 +45,8 @@ const prepareWidgetData = (data, options = {}) => {
41
45
  padding: isDataEmpty ? [10, 0, 10, 0] : undefined,
42
46
  },
43
47
  series: {
44
- type: 'line',
48
+ type: 'area',
49
+ lineWidth: 1.5,
45
50
  },
46
51
  select: {
47
52
  zoom: false,
@@ -51,6 +56,8 @@ const prepareWidgetData = (data, options = {}) => {
51
56
  y: {
52
57
  type: 'linear',
53
58
  range: 'nice',
59
+ min: (scaleRange === null || scaleRange === void 0 ? void 0 : scaleRange.min) || 0,
60
+ max: scaleRange === null || scaleRange === void 0 ? void 0 : scaleRange.max,
54
61
  },
55
62
  },
56
63
  axes: {
@@ -128,7 +135,7 @@ export const MetricChart = ({ database, title, metrics, timeFrame = '1h', autore
128
135
  }
129
136
  dispatch(setChartError(err));
130
137
  }
131
- }, [metrics, timeFrame, width]);
138
+ }, [database, metrics, timeFrame, width]);
132
139
  useAutofetcher(fetchChartData, [fetchChartData], autorefresh);
133
140
  const convertedData = prepareWidgetData(data, chartOptions);
134
141
  const renderContent = () => {
@@ -0,0 +1,2 @@
1
+ export declare const colors: string[];
2
+ export declare function colorToRGBA(initialColor: string, opacity: number): string;
@@ -0,0 +1,21 @@
1
+ import { colord } from 'colord';
2
+ // Grafana classic palette
3
+ export const colors = [
4
+ '#7EB26D',
5
+ '#EAB839',
6
+ '#6ED0E0',
7
+ '#EF843C',
8
+ '#E24D42',
9
+ '#1F78C1',
10
+ '#BA43A9',
11
+ '#705DA0',
12
+ '#508642',
13
+ '#CCA300', // 9: dark sand
14
+ ];
15
+ export function colorToRGBA(initialColor, opacity) {
16
+ const color = colord(initialColor);
17
+ if (!color.isValid()) {
18
+ throw new Error('Invalid color is passed');
19
+ }
20
+ return color.alpha(opacity).toRgbString();
21
+ }
@@ -11,6 +11,9 @@ export const getDefaultDataFormatter = (dataType) => {
11
11
  case 'size': {
12
12
  return formatChartValueToSize;
13
13
  }
14
+ case 'percent': {
15
+ return formatChartValueToPercent;
16
+ }
14
17
  default:
15
18
  return undefined;
16
19
  }
@@ -29,6 +32,12 @@ function formatChartValueToSize(value) {
29
32
  }
30
33
  return formatBytes({ value: convertToNumber(value), precision: 3 });
31
34
  }
35
+ function formatChartValueToPercent(value) {
36
+ if (value === null) {
37
+ return EMPTY_DATA_PLACEHOLDER;
38
+ }
39
+ return Math.round(convertToNumber(value) * 100) + '%';
40
+ }
32
41
  // Numeric values expected, not numeric value should be displayd as 0
33
42
  function convertToNumber(value) {
34
43
  if (isNumeric(value)) {
@@ -1,4 +1,8 @@
1
- export type Metric = 'queries.requests' | 'queries.latencies.p50' | 'queries.latencies.p75' | 'queries.latencies.p90' | 'queries.latencies.p99' | 'resources.cpu.usage' | 'resources.memory.used_bytes' | 'resources.storage.used_bytes';
1
+ import type { PoolName } from '../../types/api/nodes';
2
+ type Percentile = 'p50' | 'p75' | 'p90' | 'p99';
3
+ type QueriesLatenciesMetric = `queries.latencies.${Percentile}`;
4
+ type PoolUsageMetric = `resources.cpu.${PoolName}.usage`;
5
+ export type Metric = 'queries.requests' | 'resources.memory.used_bytes' | 'resources.storage.used_bytes' | 'resources.cpu.usage' | PoolUsageMetric | QueriesLatenciesMetric;
2
6
  export interface MetricDescription {
3
7
  target: Metric;
4
8
  title?: string;
@@ -12,9 +16,14 @@ export interface PreparedMetricsData {
12
16
  metrics: PreparedMetric[];
13
17
  }
14
18
  export type ChartValue = number | string | null;
15
- export type ChartDataType = 'ms' | 'size';
19
+ export type ChartDataType = 'ms' | 'size' | 'percent';
16
20
  export interface ChartOptions {
17
21
  dataType?: ChartDataType;
22
+ scaleRange?: {
23
+ min?: number;
24
+ max?: number;
25
+ };
18
26
  }
19
27
  export type ChartDataStatus = 'loading' | 'success' | 'error';
20
28
  export type OnChartDataStatusChange = (newStatus: ChartDataStatus) => void;
29
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const MonacoEditor: import("react").ForwardRefExoticComponent<import("react-monaco-editor").MonacoEditorProps & import("react").RefAttributes<typeof import("react-monaco-editor/lib/editor").default>>;
@@ -0,0 +1,7 @@
1
+ import { lazyComponent } from '../../utils/lazyComponent';
2
+ export const MonacoEditor = lazyComponent(async () => {
3
+ const Editor = (await import('react-monaco-editor')).default;
4
+ const { registerLanguages } = await import('../../utils/monaco');
5
+ registerLanguages();
6
+ return { Editor };
7
+ }, 'Editor');
@@ -1,7 +1,7 @@
1
1
  import { PopupProps } from '@gravity-ui/uikit';
2
- import type { NodesMap } from '../../../types/store/nodesList';
3
- import { InfoViewerItem } from '../../../components/InfoViewer';
4
- import type { PreparedPDisk } from '../../../utils/disks/types';
2
+ import type { NodesMap } from '../../types/store/nodesList';
3
+ import type { PreparedPDisk } from '../../utils/disks/types';
4
+ import { InfoViewerItem } from '../InfoViewer';
5
5
  import './PDiskPopup.scss';
6
6
  export declare const preparePDiskData: (data: PreparedPDisk, nodes?: NodesMap) => InfoViewerItem[];
7
7
  interface PDiskPopupProps extends PopupProps {
@@ -3,17 +3,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useMemo } from 'react';
4
4
  import cn from 'bem-cn-lite';
5
5
  import { Popup } from '@gravity-ui/uikit';
6
- import { InfoViewer } from '../../../components/InfoViewer';
7
- import { EFlag } from '../../../types/api/enums';
8
- import { getPDiskId } from '../../../utils/dataFormatters/dataFormatters';
9
- import { bytesToGB } from '../../../utils/utils';
6
+ import { EFlag } from '../../types/api/enums';
7
+ import { getPDiskId } from '../../utils/dataFormatters/dataFormatters';
8
+ import { bytesToGB } from '../../utils/utils';
9
+ import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants';
10
+ import { InfoViewer } from '../InfoViewer';
10
11
  import './PDiskPopup.scss';
11
12
  const b = cn('pdisk-storage-popup');
12
13
  const errorColors = [EFlag.Orange, EFlag.Red, EFlag.Yellow];
13
14
  export const preparePDiskData = (data, nodes) => {
14
15
  const { AvailableSize, TotalSize, State, PDiskId, NodeId, Path, Realtime, Type, Device } = data;
15
16
  const pdiskData = [
16
- { label: 'PDisk', value: getPDiskId({ NodeId, PDiskId }) || '-' },
17
+ { label: 'PDisk', value: getPDiskId({ NodeId, PDiskId }) || EMPTY_DATA_PLACEHOLDER },
17
18
  { label: 'State', value: State || 'not available' },
18
19
  { label: 'Type', value: Type || 'unknown' },
19
20
  ];
@@ -3,6 +3,7 @@ import './PageMeta.scss';
3
3
  interface PageMetaProps {
4
4
  items: (string | undefined)[];
5
5
  className?: string;
6
+ loading?: boolean;
6
7
  }
7
- export declare function PageMeta({ items, className }: PageMetaProps): JSX.Element;
8
+ export declare function PageMeta({ items, loading, className }: PageMetaProps): JSX.Element;
8
9
  export {};
@@ -1,7 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Skeleton } from '@gravity-ui/uikit';
2
3
  import { cn } from '../../utils/cn';
3
4
  import './PageMeta.scss';
4
5
  const b = cn('ydb-page-meta');
5
- export function PageMeta({ items, className }) {
6
- return (_jsx("div", Object.assign({ className: b(null, className) }, { children: items.filter((item) => Boolean(item)).join('\u00a0\u00a0\u00B7\u00a0\u00a0') })));
6
+ export function PageMeta({ items, loading, className }) {
7
+ const renderContent = () => {
8
+ if (loading) {
9
+ return _jsx(Skeleton, { className: b('skeleton') });
10
+ }
11
+ return items.filter((item) => Boolean(item)).join('\u00a0\u00a0\u00B7\u00a0\u00a0');
12
+ };
13
+ return _jsx("div", Object.assign({ className: b(null, className) }, { children: renderContent() }));
7
14
  }
@@ -4,7 +4,16 @@
4
4
  display: flex;
5
5
  flex-flow: row nowrap;
6
6
 
7
+ height: var(--g-text-body-2-line-height);
8
+
9
+ text-wrap: nowrap;
10
+
7
11
  color: var(--g-color-text-primary);
8
12
 
9
13
  @include body-2-typography();
14
+
15
+ &__skeleton {
16
+ width: 80%;
17
+ height: 80%;
18
+ }
10
19
  }
@@ -8,6 +8,8 @@
8
8
  position: relative;
9
9
 
10
10
  &__layer {
11
+ background: var(--g-color-base-background);
12
+
11
13
  transition: transform 0.1s ease-out;
12
14
 
13
15
  &:first-child {
@@ -1,5 +1,5 @@
1
- import type { NodesMap } from '../../../types/store/nodesList';
2
- import type { PreparedVDisk } from '../../../utils/disks/types';
1
+ import type { NodesMap } from '../../types/store/nodesList';
2
+ import type { PreparedVDisk } from '../../utils/disks/types';
3
3
  import './VDisk.scss';
4
4
  interface VDiskProps {
5
5
  data?: PreparedVDisk;
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useRef } from 'react';
3
3
  import cn from 'bem-cn-lite';
4
- import { InternalLink } from '../../../components/InternalLink';
5
- import routes, { createHref } from '../../../routes';
6
- import { stringifyVdiskId } from '../../../utils/dataFormatters/dataFormatters';
7
- import { isFullVDiskData } from '../../../utils/disks/helpers';
8
- import { STRUCTURE } from '../../Node/NodePages';
9
- import { DiskStateProgressBar } from '../DiskStateProgressBar';
10
- import { VDiskPopup } from '../VDiskPopup';
4
+ import routes, { createHref } from '../../routes';
5
+ import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
6
+ import { isFullVDiskData } from '../../utils/disks/helpers';
7
+ import { STRUCTURE } from '../../containers/Node/NodePages';
8
+ import { VDiskPopup } from '../VDiskPopup/VDiskPopup';
9
+ import { DiskStateProgressBar } from '../DiskStateProgressBar/DiskStateProgressBar';
10
+ import { InternalLink } from '../InternalLink';
11
11
  import './VDisk.scss';
12
- const b = cn('vdisk-storage');
12
+ const b = cn('ydb-vdisk-component');
13
13
  export const VDisk = ({ data = {}, nodes, compact }) => {
14
14
  var _a, _b;
15
15
  const isFullData = isFullVDiskData(data);
@@ -1,4 +1,4 @@
1
- .vdisk-storage {
1
+ .ydb-vdisk-component {
2
2
  border-radius: 4px; // to match interactive area with disk shape
3
3
 
4
4
  &__content {
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { NodesMap } from '../../types/store/nodesList';
3
+ import type { PreparedVDisk } from '../../utils/disks/types';
4
+ interface VDiskWithDonorsStackProps {
5
+ data?: PreparedVDisk;
6
+ nodes?: NodesMap;
7
+ compact?: boolean;
8
+ className?: string;
9
+ stackClassName?: string;
10
+ }
11
+ export declare function VDiskWithDonorsStack({ data, nodes, compact, className, stackClassName, }: VDiskWithDonorsStackProps): JSX.Element;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { stringifyVdiskId } from '../../utils/dataFormatters/dataFormatters';
3
+ import { isFullVDiskData } from '../../utils/disks/helpers';
4
+ import { Stack } from '../Stack/Stack';
5
+ import { VDisk } from './VDisk';
6
+ export function VDiskWithDonorsStack({ data, nodes, compact, className, stackClassName, }) {
7
+ const donors = data === null || data === void 0 ? void 0 : data.Donors;
8
+ const content = donors && donors.length > 0 ? (_jsxs(Stack, Object.assign({ className: stackClassName }, { children: [_jsx(VDisk, { data: data, nodes: nodes, compact: compact }), donors.map((donor) => {
9
+ const isFullData = isFullVDiskData(donor);
10
+ // donor and acceptor are always in the same group
11
+ return (_jsx(VDisk, { data: donor, nodes: nodes, compact: compact }, stringifyVdiskId(isFullData ? donor.VDiskId : donor)));
12
+ })] }))) : (_jsx(VDisk, { data: data, nodes: nodes, compact: compact }));
13
+ return _jsx("div", Object.assign({ className: className }, { children: content }));
14
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { PreparedVDisk } from '../../utils/disks/types';
3
+ import type { InfoViewerProps } from '../InfoViewer/InfoViewer';
4
+ import './VDiskInfo.scss';
5
+ interface VDiskInfoProps<T extends PreparedVDisk> extends Omit<InfoViewerProps, 'info'> {
6
+ data: T;
7
+ isVDiskPage?: boolean;
8
+ }
9
+ export declare function VDiskInfo<T extends PreparedVDisk>({ data, isVDiskPage, ...infoViewerProps }: VDiskInfoProps<T>): JSX.Element;
10
+ export {};
@@ -0,0 +1,113 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { valueIsDefined } from '../../utils';
4
+ import { formatStorageValuesToGb } from '../../utils/dataFormatters/dataFormatters';
5
+ import { bytesToSpeed } from '../../utils/utils';
6
+ import { cn } from '../../utils/cn';
7
+ import { createVDiskDeveloperUILink } from '../../utils/developerUI/developerUI';
8
+ import { getVDiskPagePath } from '../../routes';
9
+ import { InfoViewer } from '../InfoViewer';
10
+ import { EntityStatus } from '../EntityStatus/EntityStatus';
11
+ import { LinkWithIcon } from '../LinkWithIcon/LinkWithIcon';
12
+ import { ProgressViewer } from '../ProgressViewer/ProgressViewer';
13
+ import { vDiskInfoKeyset } from './i18n';
14
+ import './VDiskInfo.scss';
15
+ const b = cn('ydb-vdisk-info');
16
+ // eslint-disable-next-line complexity
17
+ export function VDiskInfo(_a) {
18
+ var _b, _c, _d, _e;
19
+ var { data, isVDiskPage = false } = _a, infoViewerProps = __rest(_a, ["data", "isVDiskPage"]);
20
+ const { AllocatedSize, DiskSpace, FrontQueues, Guid, Replicated, VDiskState, VDiskSlotId, Kind, SatisfactionRank, AvailableSize, HasUnreadableBlobs, IncarnationGuid, InstanceGuid, StoragePoolName, ReadThroughput, WriteThroughput, PDiskId, NodeId, } = data;
21
+ const vdiskInfo = [];
22
+ if (valueIsDefined(VDiskSlotId)) {
23
+ vdiskInfo.push({ label: vDiskInfoKeyset('slot-id'), value: VDiskSlotId });
24
+ }
25
+ if (valueIsDefined(StoragePoolName)) {
26
+ vdiskInfo.push({ label: vDiskInfoKeyset('pool-name'), value: StoragePoolName });
27
+ }
28
+ if (valueIsDefined(VDiskState)) {
29
+ vdiskInfo.push({
30
+ label: vDiskInfoKeyset('state-status'),
31
+ value: VDiskState,
32
+ });
33
+ }
34
+ if (Number(AllocatedSize) >= 0 && Number(AvailableSize) >= 0) {
35
+ vdiskInfo.push({
36
+ label: vDiskInfoKeyset('size'),
37
+ value: (_jsx(ProgressViewer, { value: AllocatedSize, capacity: Number(AllocatedSize) + Number(AvailableSize), formatValues: formatStorageValuesToGb, colorizeProgress: true })),
38
+ });
39
+ }
40
+ if (valueIsDefined(Kind)) {
41
+ vdiskInfo.push({ label: vDiskInfoKeyset('kind'), value: Kind });
42
+ }
43
+ if (valueIsDefined(Guid)) {
44
+ vdiskInfo.push({ label: vDiskInfoKeyset('guid'), value: Guid });
45
+ }
46
+ if (valueIsDefined(IncarnationGuid)) {
47
+ vdiskInfo.push({ label: vDiskInfoKeyset('incarnation-guid'), value: IncarnationGuid });
48
+ }
49
+ if (valueIsDefined(InstanceGuid)) {
50
+ vdiskInfo.push({ label: vDiskInfoKeyset('instance-guid'), value: InstanceGuid });
51
+ }
52
+ if (valueIsDefined(Replicated)) {
53
+ vdiskInfo.push({
54
+ label: vDiskInfoKeyset('replication-status'),
55
+ value: Replicated ? vDiskInfoKeyset('yes') : vDiskInfoKeyset('no'),
56
+ });
57
+ }
58
+ if (valueIsDefined(DiskSpace)) {
59
+ vdiskInfo.push({
60
+ label: vDiskInfoKeyset('space-status'),
61
+ value: _jsx(EntityStatus, { status: DiskSpace }),
62
+ });
63
+ }
64
+ if (valueIsDefined((_b = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.FreshRank) === null || _b === void 0 ? void 0 : _b.Flag)) {
65
+ vdiskInfo.push({
66
+ label: vDiskInfoKeyset('fresh-rank-satisfaction'),
67
+ value: _jsx(EntityStatus, { status: (_c = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.FreshRank) === null || _c === void 0 ? void 0 : _c.Flag }),
68
+ });
69
+ }
70
+ if (valueIsDefined((_d = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.LevelRank) === null || _d === void 0 ? void 0 : _d.Flag)) {
71
+ vdiskInfo.push({
72
+ label: vDiskInfoKeyset('level-rank-satisfaction'),
73
+ value: _jsx(EntityStatus, { status: (_e = SatisfactionRank === null || SatisfactionRank === void 0 ? void 0 : SatisfactionRank.LevelRank) === null || _e === void 0 ? void 0 : _e.Flag }),
74
+ });
75
+ }
76
+ if (valueIsDefined(FrontQueues)) {
77
+ vdiskInfo.push({
78
+ label: vDiskInfoKeyset('front-queues'),
79
+ value: _jsx(EntityStatus, { status: FrontQueues }),
80
+ });
81
+ }
82
+ if (valueIsDefined(HasUnreadableBlobs)) {
83
+ vdiskInfo.push({
84
+ label: vDiskInfoKeyset('has-unreadable-blobs'),
85
+ value: HasUnreadableBlobs ? vDiskInfoKeyset('yes') : vDiskInfoKeyset('no'),
86
+ });
87
+ }
88
+ if (valueIsDefined(ReadThroughput)) {
89
+ vdiskInfo.push({
90
+ label: vDiskInfoKeyset('read-throughput'),
91
+ value: bytesToSpeed(ReadThroughput),
92
+ });
93
+ }
94
+ if (valueIsDefined(WriteThroughput)) {
95
+ vdiskInfo.push({
96
+ label: vDiskInfoKeyset('write-throughput'),
97
+ value: bytesToSpeed(WriteThroughput),
98
+ });
99
+ }
100
+ if (valueIsDefined(PDiskId) && valueIsDefined(NodeId) && valueIsDefined(VDiskSlotId)) {
101
+ const vDiskPagePath = getVDiskPagePath(VDiskSlotId, PDiskId, NodeId);
102
+ const vDiskInternalViewerPath = createVDiskDeveloperUILink({
103
+ nodeId: NodeId,
104
+ pDiskId: PDiskId,
105
+ vDiskSlotId: VDiskSlotId,
106
+ });
107
+ vdiskInfo.push({
108
+ label: vDiskInfoKeyset('links'),
109
+ value: (_jsxs("span", Object.assign({ className: b('links') }, { children: [!isVDiskPage && (_jsx(LinkWithIcon, { title: vDiskInfoKeyset('vdisk-page'), url: vDiskPagePath, external: false })), _jsx(LinkWithIcon, { title: vDiskInfoKeyset('developer-ui'), url: vDiskInternalViewerPath })] }))),
110
+ });
111
+ }
112
+ return _jsx(InfoViewer, Object.assign({ info: vdiskInfo }, infoViewerProps));
113
+ }
@@ -0,0 +1,8 @@
1
+ .ydb-vdisk-info {
2
+ &__links {
3
+ display: flex;
4
+ flex-flow: row wrap;
5
+
6
+ gap: 12px;
7
+ }
8
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "slot-id": "VDisk Slot Id",
3
+ "pool-name": "Storage Pool Name",
4
+ "kind": "Kind",
5
+ "guid": "GUID",
6
+ "incarnation-guid": "Incarnation GUID",
7
+ "instance-guid": "Instance GUID",
8
+ "replication-status": "Replicated",
9
+ "state-status": "VDisk State",
10
+ "space-status": "Disk Space",
11
+ "fresh-rank-satisfaction": "Fresh Rank Satisfaction",
12
+ "level-rank-satisfaction": "Level Rank Satisfaction",
13
+ "front-queues": "Front Queues",
14
+ "has-unreadable-blobs": "Has Unreadable Blobs",
15
+ "size": "Size",
16
+ "read-throughput": "Read Throughput",
17
+ "write-throughput": "Write Throughput",
18
+ "links": "Links",
19
+ "vdisk-page": "VDisk Page",
20
+ "developer-ui": "Developer UI",
21
+ "yes": "Yes",
22
+ "no": "No"
23
+ }
@@ -0,0 +1 @@
1
+ export declare const vDiskInfoKeyset: (key: "size" | "kind" | "yes" | "no" | "links" | "guid" | "developer-ui" | "slot-id" | "pool-name" | "incarnation-guid" | "instance-guid" | "replication-status" | "state-status" | "space-status" | "fresh-rank-satisfaction" | "level-rank-satisfaction" | "front-queues" | "has-unreadable-blobs" | "read-throughput" | "write-throughput" | "vdisk-page", params?: import("@gravity-ui/i18n").Params | undefined) => string;
@@ -0,0 +1,4 @@
1
+ import { registerKeysets } from '../../../utils/i18n';
2
+ import en from './en.json';
3
+ const COMPONENT = 'ydb-vDisk-info';
4
+ export const vDiskInfoKeyset = registerKeysets(COMPONENT, { en });
@@ -1,7 +1,7 @@
1
1
  import { PopupProps } from '@gravity-ui/uikit';
2
- import type { NodesMap } from '../../../types/store/nodesList';
3
- import type { TVDiskStateInfo } from '../../../types/api/vdisk';
4
- import type { UnavailableDonor } from '../utils/types';
2
+ import type { NodesMap } from '../../types/store/nodesList';
3
+ import type { TVDiskStateInfo } from '../../types/api/vdisk';
4
+ import type { UnavailableDonor } from '../../utils/disks/types';
5
5
  import './VDiskPopup.scss';
6
6
  interface VDiskPopupProps extends PopupProps {
7
7
  data: TVDiskStateInfo | UnavailableDonor;