ydb-embedded-ui 1.0.1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ### [1.0.4](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.0.3...v1.0.4) (2022-03-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * freeze deps ([349dee8](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/349dee8cbc7376e316e3cb87f5eb46142975de6c))
9
+ * styles ([502bc0b](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/502bc0bd319a141e2d3e90787eae41abcd24e76d))
10
+
11
+ ### [1.0.3](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.0.2...v1.0.3) (2022-03-21)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * query status should not be shown when query is loading ([d214eee](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/d214eee575b63341082f0be33163e3fce520df88))
17
+ * should set correct initial current index in queries history ([c3228d7](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/c3228d7a6a0c810982db1bdbec7762889ac44ffa))
18
+ * **Storage:** wording fixed [YDB-1552] ([3f487ff](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/3f487ff01117963760b676d14281e93e5f3002c0))
19
+
20
+ ### [1.0.2](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.0.1...v1.0.2) (2022-03-11)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **Header:** add link to internal viewer ([64af24f](https://www.github.com/ydb-platform/ydb-embedded-ui/commit/64af24f8d78cf0d34466ac129be10c0764cce3d4))
26
+
3
27
  ### [1.0.1](https://www.github.com/ydb-platform/ydb-embedded-ui/compare/v1.0.0...v1.0.1) (2022-03-05)
4
28
 
5
29
 
@@ -25,4 +25,16 @@
25
25
  font-size: var(--yc-text-body2-font-size);
26
26
  font-weight: 500;
27
27
  }
28
+
29
+ &__cluster-name-wrapper {
30
+ display: flex;
31
+ align-items: center;
32
+
33
+ height: 100%;
34
+ gap: 5px;
35
+ }
36
+
37
+ &__divider {
38
+ height: 80%;
39
+ }
28
40
  }
@@ -1,15 +1,19 @@
1
- import {useEffect} from 'react';
1
+ import React, {useEffect} from 'react';
2
2
  import {useDispatch, useSelector} from 'react-redux';
3
3
  import cn from 'bem-cn-lite';
4
4
  import {useHistory, useLocation} from 'react-router';
5
+ import {Breadcrumbs, BreadcrumbsItem, Link} from '@yandex-cloud/uikit';
5
6
 
6
- import {clusterName as clusterNameLocation} from '../../store';
7
+ import Divider from '../../components/Divider/Divider';
8
+ //@ts-ignore
9
+ import Icon from '../../components/Icon/Icon';
10
+
11
+ import {clusterName as clusterNameLocation, backend, customBackend} from '../../store';
7
12
  import {getClusterInfo} from '../../store/reducers/cluster';
8
13
  import {getHostInfo} from '../../store/reducers/host';
14
+ import {HeaderItemType} from '../../store/reducers/header';
9
15
 
10
16
  import './Header.scss';
11
- import {Breadcrumbs, BreadcrumbsItem} from '@yandex-cloud/uikit';
12
- import {HeaderItemType} from '../../store/reducers/header';
13
17
 
14
18
  const b = cn('header');
15
19
 
@@ -49,6 +53,12 @@ function Header() {
49
53
  const renderHeader = () => {
50
54
  const clusterNameFinal = singleClusterMode ? host.ClusterName : clusterName;
51
55
 
56
+ let link = backend + '/internal';
57
+
58
+ if (singleClusterMode && !customBackend) {
59
+ link = `/internal`;
60
+ }
61
+
52
62
  const breadcrumbItems = header.reduce((acc, el) => {
53
63
  acc.push({text: el.text, action: () => history.push(el.link)});
54
64
  return acc;
@@ -63,8 +73,20 @@ function Header() {
63
73
  firstDisplayedItemsCount={1}
64
74
  />
65
75
  </div>
66
- <div>
67
- {clusterNameFinal && <ClusterName name={clusterNameFinal} />}
76
+
77
+ <div className={b('cluster-name-wrapper')}>
78
+ <Link href={link} target="_blank">
79
+ Internal viewer{' '}
80
+ <Icon name="external" viewBox={'0 0 16 16'} width={16} height={16} />
81
+ </Link>
82
+ {clusterNameFinal && (
83
+ <React.Fragment>
84
+ <div className={b('divider')}>
85
+ <Divider />
86
+ </div>
87
+ <ClusterName name={clusterNameFinal} />
88
+ </React.Fragment>
89
+ )}
68
90
  </div>
69
91
  </header>
70
92
  );
@@ -210,13 +210,16 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
210
210
  ];
211
211
 
212
212
  let columns = allColumns;
213
+ let emptyMessage = 'No such groups.';
213
214
 
214
215
  if (visibleEntities === VisibleEntities.Space) {
215
216
  columns = allColumns.filter((col) => col.name !== TableColumnsIds.Missing);
217
+ emptyMessage = 'No storage groups with space problems.';
216
218
  }
217
219
 
218
220
  if (visibleEntities === VisibleEntities.Missing) {
219
221
  columns = allColumns.filter((col) => col.name !== TableColumnsIds.UsedSpaceFlag);
222
+ emptyMessage = 'No degraded groups.';
220
223
  }
221
224
  return data ? (
222
225
  <DataTable
@@ -226,7 +229,7 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
226
229
  columns={columns}
227
230
  settings={tableSettings}
228
231
  initialSortOrder={setSortOrder(visibleEntities)}
229
- emptyDataMessage="No such groups."
232
+ emptyDataMessage={emptyMessage}
230
233
  />
231
234
  ) : null;
232
235
  }
@@ -114,9 +114,14 @@ function StorageNodes({data, tableSettings, visibleEntities}: StorageGroupsProps
114
114
  ];
115
115
 
116
116
  let columns = allColumns;
117
+ let emptyMessage = 'No such nodes.';
117
118
 
118
119
  if (visibleEntities === VisibleEntities.Space) {
119
120
  columns = allColumns.filter((col) => col.name !== TableColumnsIds.Missing);
121
+ emptyMessage = 'No nodes with space problems.';
122
+ }
123
+ if (visibleEntities === VisibleEntities.Missing) {
124
+ emptyMessage = 'No degraded nodes.';
120
125
  }
121
126
 
122
127
  return data ? (
@@ -127,7 +132,7 @@ function StorageNodes({data, tableSettings, visibleEntities}: StorageGroupsProps
127
132
  columns={columns}
128
133
  settings={tableSettings}
129
134
  initialSortOrder={setSortOrder(visibleEntities)}
130
- emptyDataMessage="No such nodes."
135
+ emptyDataMessage={emptyMessage}
131
136
  />
132
137
  ) : null;
133
138
  }
@@ -147,6 +147,7 @@
147
147
  &__path-name {
148
148
  overflow: hidden;
149
149
 
150
+ white-space: nowrap;
150
151
  text-overflow: ellipsis;
151
152
  }
152
153
 
@@ -154,7 +154,7 @@ function QueryEditor(props) {
154
154
  useEffect(() => {
155
155
  const {monacoHotKey, setMonacoHotKey} = props;
156
156
  if (monacoHotKey === null) {
157
- return
157
+ return;
158
158
  }
159
159
  setMonacoHotKey(null);
160
160
  switch (monacoHotKey) {
@@ -464,19 +464,12 @@ function QueryEditor(props) {
464
464
  };
465
465
 
466
466
  const getExecuteResult = () => {
467
- const {
468
- data = [],
469
- error,
470
- loading,
471
- history: {queries},
472
- } = props.executeQuery;
467
+ const {data = [], error} = props.executeQuery;
473
468
 
474
469
  if (error) {
475
470
  return error.data || error;
476
471
  } else if (data.length > 0) {
477
472
  return data;
478
- } else if (!loading && queries.length) {
479
- return 'The request was successful';
480
473
  } else {
481
474
  return '';
482
475
  }
@@ -252,28 +252,32 @@ function QueryExplain(props) {
252
252
  return (
253
253
  <React.Fragment>
254
254
  <div className={b('controls')}>
255
- <div className={b('controls-right')}>
256
- <QueryExecutionStatus hasError={Boolean(props.error)} />
257
- {!props.error && (
258
- <React.Fragment>
259
- <Divider />
260
- <RadioButton
261
- options={explainOptions}
262
- value={activeOption}
263
- onUpdate={onSelectOption}
255
+ {!props.loading && (
256
+ <React.Fragment>
257
+ <div className={b('controls-right')}>
258
+ <QueryExecutionStatus hasError={Boolean(props.error)} />
259
+ {!props.error && (
260
+ <React.Fragment>
261
+ <Divider />
262
+ <RadioButton
263
+ options={explainOptions}
264
+ value={activeOption}
265
+ onUpdate={onSelectOption}
266
+ />
267
+ </React.Fragment>
268
+ )}
269
+ </div>
270
+ <div className={b('controls-left')}>
271
+ <EnableFullscreenButton disabled={Boolean(props.error)} />
272
+ <PaneVisibilityToggleButtons
273
+ onCollapse={props.onCollapseResults}
274
+ onExpand={props.onExpandResults}
275
+ isCollapsed={props.isResultsCollapsed}
276
+ initialDirection="bottom"
264
277
  />
265
- </React.Fragment>
266
- )}
267
- </div>
268
- <div className={b('controls-left')}>
269
- <EnableFullscreenButton disabled={Boolean(props.error)} />
270
- <PaneVisibilityToggleButtons
271
- onCollapse={props.onCollapseResults}
272
- onExpand={props.onExpandResults}
273
- isCollapsed={props.isResultsCollapsed}
274
- initialDirection="bottom"
275
- />
276
- </div>
278
+ </div>
279
+ </React.Fragment>
280
+ )}
277
281
  </div>
278
282
  <div className={b('result')}>{renderContent()}</div>
279
283
  </React.Fragment>
@@ -19,6 +19,7 @@
19
19
  justify-content: space-between;
20
20
  align-items: center;
21
21
 
22
+ height: 53px;
22
23
  padding: 12px 20px;
23
24
 
24
25
  border-bottom: 1px solid var(--yc-color-line-generic);
@@ -28,6 +28,7 @@
28
28
  justify-content: space-between;
29
29
  align-items: center;
30
30
 
31
+ height: 53px;
31
32
  padding: 12px 20px;
32
33
 
33
34
  border-bottom: 1px solid var(--yc-color-line-generic);
@@ -34,7 +34,10 @@ const initialState = {
34
34
  input: '',
35
35
  history: {
36
36
  queries: queriesHistoryInitial.slice(sliceLimit < 0 ? 0 : sliceLimit),
37
- currentIndex: -1,
37
+ currentIndex:
38
+ queriesHistoryInitial.length > MAXIMUM_QUERIES_IN_HISTORY
39
+ ? MAXIMUM_QUERIES_IN_HISTORY - 1
40
+ : queriesHistoryInitial.length - 1,
38
41
  },
39
42
  runAction: RUN_ACTIONS_VALUES.script,
40
43
  monacoHotKey: null,
@@ -6,8 +6,8 @@ import {calcUptime} from '../../utils';
6
6
 
7
7
  export const VisibleEntities = {
8
8
  All: 'All',
9
- Missing: 'Missing',
10
- Space: 'Space',
9
+ Missing: 'Degraded',
10
+ Space: 'Out of space',
11
11
  };
12
12
 
13
13
  export const StorageTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -9,38 +9,38 @@
9
9
  "url": "git@github.com:ydb-platform/ydb-embedded-ui.git"
10
10
  },
11
11
  "dependencies": {
12
- "@testing-library/jest-dom": "^5.15.0",
13
- "@testing-library/react": "^11.2.7",
14
- "@testing-library/user-event": "^12.8.3",
15
- "@types/qs": "^6.9.7",
16
- "@yandex-cloud/i18n": "^0.2.0",
17
- "@yandex-cloud/paranoid": "^1.0.0",
18
- "@yandex-cloud/react-data-table": "^0.2.1",
19
- "axios": "^0.19.2",
20
- "bem-cn-lite": "^4.0.0",
21
- "history": "^4.9.0",
22
- "js-cookie": "^2.2.1",
23
- "keymaster": "^1.6.2",
24
- "lodash": "^4.17.11",
25
- "monaco-editor": "^0.24.0",
26
- "numeral": "^2.0.6",
27
- "path-to-regexp": "^3.0.0",
28
- "react-json-inspector": "^7.1.1",
29
- "react-list": "^0.8.11",
30
- "react-monaco-editor": "^0.30.1",
31
- "react-redux": "^7.0.3",
32
- "react-router": "^5.0.1",
33
- "react-router-dom": "^5.0.1",
12
+ "@testing-library/jest-dom": "5.15.0",
13
+ "@testing-library/react": "11.2.7",
14
+ "@testing-library/user-event": "12.8.3",
15
+ "@types/qs": "6.9.7",
16
+ "@yandex-cloud/i18n": "0.2.0",
17
+ "@yandex-cloud/paranoid": "1.0.0",
18
+ "@yandex-cloud/react-data-table": "0.2.1",
19
+ "axios": "0.19.2",
20
+ "bem-cn-lite": "4.0.0",
21
+ "history": "4.9.0",
22
+ "js-cookie": "2.2.1",
23
+ "keymaster": "1.6.2",
24
+ "lodash": "4.17.11",
25
+ "monaco-editor": "0.24.0",
26
+ "numeral": "2.0.6",
27
+ "path-to-regexp": "3.0.0",
28
+ "react-json-inspector": "7.1.1",
29
+ "react-list": "0.8.11",
30
+ "react-monaco-editor": "0.30.1",
31
+ "react-redux": "7.2.6",
32
+ "react-router": "5.2.0",
33
+ "react-router-dom": "5.2.0",
34
34
  "react-scripts": "4.0.3",
35
- "react-split": "^2.0.14",
36
- "react-transition-group": "^4.4.2",
37
- "react-treeview": "^0.4.7",
38
- "redux": "^4.0.1",
39
- "redux-location-state": "^2.6.0",
40
- "redux-thunk": "^2.3.0",
41
- "reselect": "^4.0.0",
42
- "sass": "^1.32.8",
43
- "web-vitals": "^1.1.2"
35
+ "react-split": "2.0.14",
36
+ "react-transition-group": "4.4.2",
37
+ "react-treeview": "0.4.7",
38
+ "redux": "4.0.1",
39
+ "redux-location-state": "2.6.0",
40
+ "redux-thunk": "2.3.0",
41
+ "reselect": "4.0.0",
42
+ "sass": "1.32.8",
43
+ "web-vitals": "1.1.2"
44
44
  },
45
45
  "scripts": {
46
46
  "start": "react-app-rewired start",
@@ -66,28 +66,29 @@
66
66
  ]
67
67
  },
68
68
  "devDependencies": {
69
- "@commitlint/cli": "^15.0.0",
70
- "@commitlint/config-conventional": "^15.0.0",
71
- "@types/lodash": "^4.14.178",
72
- "@types/react-dom": "^17.0.11",
73
- "@types/react-router": "^5.1.17",
74
- "@types/react-router-dom": "^5.3.2",
75
- "@types/react-transition-group": "^4.4.4",
76
- "@types/react-virtualized-auto-sizer": "^1.0.1",
77
- "@yandex-cloud/axios-wrapper": "^1.0.2",
78
- "@yandex-cloud/eslint-config": "^1.0.0",
79
- "@yandex-cloud/prettier-config": "^1.0.0",
80
- "@yandex-cloud/stylelint-config": "^1.1.0",
81
- "@yandex-cloud/tsconfig": "^1.0.0",
82
- "@yandex-cloud/uikit": "^1.7.0",
83
- "copyfiles": "^2.4.1",
84
- "eslint-config-prettier": "^8.3.0",
85
- "postcss": "^8.4.6",
86
- "prettier": "^2.5.1",
87
- "react": "^17.0.2",
88
- "react-app-rewired": "^2.1.11",
89
- "react-dom": "^17.0.2",
90
- "stylelint": "^14.3.0",
91
- "typescript": "^4.5.4"
69
+ "@commitlint/cli": "15.0.0",
70
+ "@commitlint/config-conventional": "15.0.0",
71
+ "@types/history": "4.7.11",
72
+ "@types/lodash": "4.14.178",
73
+ "@types/react-dom": "17.0.11",
74
+ "@types/react-router": "5.1.17",
75
+ "@types/react-router-dom": "5.3.2",
76
+ "@types/react-transition-group": "4.4.4",
77
+ "@types/react-virtualized-auto-sizer": "1.0.1",
78
+ "@yandex-cloud/axios-wrapper": "1.0.2",
79
+ "@yandex-cloud/eslint-config": "1.0.0",
80
+ "@yandex-cloud/prettier-config": "1.0.0",
81
+ "@yandex-cloud/stylelint-config": "1.1.0",
82
+ "@yandex-cloud/tsconfig": "1.0.0",
83
+ "@yandex-cloud/uikit": "1.7.0",
84
+ "copyfiles": "2.4.1",
85
+ "eslint-config-prettier": "8.3.0",
86
+ "postcss": "8.4.6",
87
+ "prettier": "2.5.1",
88
+ "react": "17.0.2",
89
+ "react-app-rewired": "2.1.11",
90
+ "react-dom": "17.0.2",
91
+ "stylelint": "14.3.0",
92
+ "typescript": "4.5.4"
92
93
  }
93
94
  }