@ytsaurus/ui 1.20.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/@types/core.d.ts +1 -1
- package/build/cjs/server/ServerFactory.d.ts +3 -0
- package/build/cjs/server/ServerFactory.js +3 -0
- package/build/cjs/server/ServerFactory.js.map +1 -1
- package/build/cjs/server/controllers/availability.js +36 -18
- package/build/cjs/server/controllers/availability.js.map +1 -1
- package/build/cjs/server/controllers/odin-proxy-api.js +3 -4
- package/build/cjs/server/controllers/odin-proxy-api.js.map +1 -1
- package/build/cjs/ui/pages/navigation/Navigation/ContentViewer/helpers/getComponentByContentType.js +2 -0
- package/build/cjs/ui/pages/navigation/Navigation/ContentViewer/helpers/getComponentByContentType.js.map +1 -1
- package/build/cjs/ui/pages/odin/_actions/odin-overview.js +1 -1
- package/build/cjs/ui/pages/odin/_actions/odin-overview.js.map +1 -1
- package/build/cjs/ui/pages/odin/controls/OdinToolbar.js +2 -1
- package/build/cjs/ui/pages/odin/controls/OdinToolbar.js.map +1 -1
- package/build/cjs/ui/pages/odin/odin-utils.d.ts +1 -1
- package/build/cjs/ui/pages/odin/odin-utils.js +2 -2
- package/build/cjs/ui/pages/odin/odin-utils.js.map +1 -1
- package/build/cjs/ui/store/actions/operations/jobs-monitor.js +5 -3
- package/build/cjs/ui/store/actions/operations/jobs-monitor.js.map +1 -1
- package/build/cjs/ui/store/selectors/operations/operation.d.ts +8 -1676
- package/build/cjs/ui/store/selectors/operations/operation.js +9 -12
- package/build/cjs/ui/store/selectors/operations/operation.js.map +1 -1
- package/build/cjs/ui/utils/navigation/path-editor.js +1 -0
- package/build/cjs/ui/utils/navigation/path-editor.js.map +1 -1
- package/build/esm/@types/core.d.ts +1 -1
- package/build/esm/server/ServerFactory.d.ts +3 -0
- package/build/esm/server/ServerFactory.js +4 -0
- package/build/esm/server/ServerFactory.js.map +1 -1
- package/build/esm/server/controllers/availability.js +43 -23
- package/build/esm/server/controllers/availability.js.map +1 -1
- package/build/esm/server/controllers/odin-proxy-api.js +9 -10
- package/build/esm/server/controllers/odin-proxy-api.js.map +1 -1
- package/build/esm/ui/pages/navigation/Navigation/ContentViewer/helpers/getComponentByContentType.js +2 -0
- package/build/esm/ui/pages/navigation/Navigation/ContentViewer/helpers/getComponentByContentType.js.map +1 -1
- package/build/esm/ui/pages/odin/_actions/odin-overview.js +1 -1
- package/build/esm/ui/pages/odin/_actions/odin-overview.js.map +1 -1
- package/build/esm/ui/pages/odin/controls/OdinToolbar.js +3 -2
- package/build/esm/ui/pages/odin/controls/OdinToolbar.js.map +1 -1
- package/build/esm/ui/pages/odin/odin-utils.d.ts +1 -1
- package/build/esm/ui/pages/odin/odin-utils.js +2 -2
- package/build/esm/ui/pages/odin/odin-utils.js.map +1 -1
- package/build/esm/ui/store/actions/operations/jobs-monitor.js +6 -4
- package/build/esm/ui/store/actions/operations/jobs-monitor.js.map +1 -1
- package/build/esm/ui/store/selectors/operations/operation.d.ts +8 -1676
- package/build/esm/ui/store/selectors/operations/operation.js +8 -11
- package/build/esm/ui/store/selectors/operations/operation.js.map +1 -1
- package/build/esm/ui/utils/navigation/path-editor.js +1 -0
- package/build/esm/ui/utils/navigation/path-editor.js.map +1 -1
- package/dist/public/build/assets-manifest.json +8 -8
- package/dist/public/build/js/main.724df837.js +3 -0
- package/dist/public/build/js/{main.5ce7c259.js.map → main.724df837.js.map} +1 -1
- package/dist/public/build/js/vendors.e6a251eb.js +3 -0
- package/dist/public/build/js/vendors.e6a251eb.js.map +1 -0
- package/dist/public/build/manifest.json +4 -4
- package/dist/server/ServerFactory.d.ts +3 -0
- package/dist/server/ServerFactory.js +3 -0
- package/dist/server/controllers/availability.js +36 -18
- package/dist/server/controllers/odin-proxy-api.js +3 -4
- package/package.json +2 -2
- package/dist/public/build/js/main.5ce7c259.js +0 -3
- package/dist/public/build/js/vendors.3a95f920.js +0 -3
- package/dist/public/build/js/vendors.3a95f920.js.map +0 -1
- /package/dist/public/build/js/{main.5ce7c259.js.LICENSE.txt → main.724df837.js.LICENSE.txt} +0 -0
- /package/dist/public/build/js/{vendors.3a95f920.js.LICENSE.txt → vendors.e6a251eb.js.LICENSE.txt} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"main.css": "css/main.77009ada.css",
|
3
|
-
"main.js": "js/main.
|
3
|
+
"main.js": "js/main.724df837.js",
|
4
4
|
"runtime.js": "js/runtime.22e88c00.js",
|
5
5
|
"css/861.c5a67589.chunk.css": "css/861.c5a67589.chunk.css",
|
6
6
|
"js/861.a0939319.chunk.js": "js/861.a0939319.chunk.js",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"js/505.7d7675f5.chunk.js": "js/505.7d7675f5.chunk.js",
|
26
26
|
"js/364.3e4b8059.chunk.js": "js/364.3e4b8059.chunk.js",
|
27
27
|
"vis-network.js": "js/vis-network.b367d390.chunk.js",
|
28
|
-
"vendors.js": "js/vendors.
|
28
|
+
"vendors.js": "js/vendors.e6a251eb.js",
|
29
29
|
"js/122.8dcbdc87.chunk.js": "js/122.8dcbdc87.chunk.js",
|
30
30
|
"css/122.63a98264.chunk.css": "css/122.63a98264.chunk.css",
|
31
31
|
"js/64.73cd3d66.chunk.js": "js/64.73cd3d66.chunk.js",
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"assets/images/ui.jpg": "assets/images/ui.bab31938.jpg",
|
53
53
|
"assets/images/cluster-2x.svg": "assets/images/cluster-2x.e53788d6.svg",
|
54
54
|
"main.77009ada.css.map": "css/main.77009ada.css.map",
|
55
|
-
"main.
|
55
|
+
"main.724df837.js.map": "js/main.724df837.js.map",
|
56
56
|
"runtime.22e88c00.js.map": "js/runtime.22e88c00.js.map",
|
57
57
|
"861.c5a67589.chunk.css.map": "css/861.c5a67589.chunk.css.map",
|
58
58
|
"861.a0939319.chunk.js.map": "js/861.a0939319.chunk.js.map",
|
@@ -77,7 +77,7 @@
|
|
77
77
|
"505.7d7675f5.chunk.js.map": "js/505.7d7675f5.chunk.js.map",
|
78
78
|
"364.3e4b8059.chunk.js.map": "js/364.3e4b8059.chunk.js.map",
|
79
79
|
"vis-network.b367d390.chunk.js.map": "js/vis-network.b367d390.chunk.js.map",
|
80
|
-
"vendors.
|
80
|
+
"vendors.e6a251eb.js.map": "js/vendors.e6a251eb.js.map",
|
81
81
|
"122.63a98264.chunk.css.map": "css/122.63a98264.chunk.css.map",
|
82
82
|
"64.5615c430.chunk.css.map": "css/64.5615c430.chunk.css.map",
|
83
83
|
"132.b9a412c7.chunk.js.map": "js/132.b9a412c7.chunk.js.map",
|
@@ -8,6 +8,9 @@ export interface ServerFactory {
|
|
8
8
|
renderLayout(params: AppLayoutConfig, req: Request, res: Response): Promise<string>;
|
9
9
|
}
|
10
10
|
export declare function rememberApp(v: ExpressKit): void;
|
11
|
+
/**
|
12
|
+
* @deprecated use req.ctx.config instead of App().config
|
13
|
+
*/
|
11
14
|
export declare function getApp(): ExpressKit;
|
12
15
|
export declare function configureServerFactory(overrides: Partial<ServerFactory>): void;
|
13
16
|
declare const _default: ServerFactory;
|
@@ -8,7 +8,6 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
9
9
|
const utils_1 = require("../components/utils");
|
10
10
|
const utils_2 = require("../utils");
|
11
|
-
const ServerFactory_1 = require("../ServerFactory");
|
12
11
|
function getClusterAvailability(clusterConfig, odinPath) {
|
13
12
|
const ODIN_PERIOD = 5;
|
14
13
|
const ODIN_METRIC = 'master';
|
@@ -28,38 +27,57 @@ function getClusterAvailability(clusterConfig, odinPath) {
|
|
28
27
|
return response.data;
|
29
28
|
});
|
30
29
|
}
|
31
|
-
function getAvailability(req, clusters
|
32
|
-
const
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
function getAvailability(req, clusters) {
|
31
|
+
const odinBaseUrl = req.ctx.config.odinBaseUrl;
|
32
|
+
const isMultiOdinBaseUrl = 'string' !== typeof odinBaseUrl;
|
33
|
+
const makeOdinIsAliveUrl = (odinBaseUrl) => `${odinBaseUrl}/is_alive`;
|
34
|
+
const commonIsAlive = isMultiOdinBaseUrl
|
35
|
+
? Promise.resolve({ data: true })
|
36
|
+
: axios_1.default.request({ url: makeOdinIsAliveUrl(odinBaseUrl) });
|
37
|
+
return commonIsAlive
|
38
|
+
.then(({ data: commonAlive }) => {
|
39
|
+
if (!commonAlive) {
|
37
40
|
return [];
|
38
41
|
}
|
39
42
|
return Promise.all(lodash_1.default.map(clusters, (clusterConfig) => {
|
40
|
-
const
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
const odinPath = isMultiOdinBaseUrl
|
44
|
+
? odinBaseUrl === null || odinBaseUrl === void 0 ? void 0 : odinBaseUrl[clusterConfig.id]
|
45
|
+
: odinBaseUrl;
|
46
|
+
if (!odinPath) {
|
47
|
+
return {};
|
48
|
+
}
|
49
|
+
const alive = isMultiOdinBaseUrl
|
50
|
+
? axios_1.default.get(makeOdinIsAliveUrl(odinPath)).catch((e) => {
|
51
|
+
req.ctx.logError(`Error of getting ${odinPath}`, e);
|
52
|
+
return { data: false };
|
53
|
+
})
|
54
|
+
: Promise.resolve({ data: true });
|
55
|
+
return alive.then(({ data }) => {
|
56
|
+
if (data != true) {
|
57
|
+
return {};
|
58
|
+
}
|
59
|
+
return getClusterAvailability(clusterConfig, odinPath)
|
60
|
+
.then((availability) => ({ id: clusterConfig.id, availability }))
|
61
|
+
.catch((error) => {
|
62
|
+
req.ctx.logError('getAvailability error', error);
|
63
|
+
return {};
|
64
|
+
});
|
46
65
|
});
|
47
66
|
}));
|
48
67
|
})
|
49
68
|
.catch((e) => {
|
50
|
-
req.ctx.logError(`Error of getting ${
|
69
|
+
req.ctx.logError(`Error of getting ${odinBaseUrl}`, e);
|
51
70
|
return [];
|
52
71
|
});
|
53
72
|
}
|
54
73
|
async function getClustersAvailability(req, res) {
|
55
|
-
|
56
|
-
|
57
|
-
if (!odinPath) {
|
74
|
+
const odinBaseUrl = req.ctx.config.odinBaseUrl;
|
75
|
+
if (!odinBaseUrl) {
|
58
76
|
(0, utils_2.sendAndLogError)(req.ctx, res, 500, new Error('odin base url is not configured'));
|
59
77
|
return;
|
60
78
|
}
|
61
79
|
const clusters = (0, utils_1.getClustersFromConfig)();
|
62
|
-
await getAvailability(req, clusters
|
80
|
+
await getAvailability(req, clusters)
|
63
81
|
.then((data) => (0, utils_2.sendResponse)(res, data))
|
64
82
|
.catch((error) => (0, utils_2.sendError)(res, error));
|
65
83
|
}
|
@@ -8,7 +8,6 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
9
9
|
const qs_1 = __importDefault(require("qs"));
|
10
10
|
const utils_1 = require("../utils");
|
11
|
-
const ServerFactory_1 = require("../ServerFactory");
|
12
11
|
async function odinProxyApi(req, res) {
|
13
12
|
try {
|
14
13
|
await odinProxyApiImpl(req, res);
|
@@ -23,14 +22,14 @@ async function odinProxyApi(req, res) {
|
|
23
22
|
}
|
24
23
|
exports.odinProxyApi = odinProxyApi;
|
25
24
|
async function odinProxyApiImpl(req, res) {
|
26
|
-
|
27
|
-
const
|
25
|
+
const { action, ytAuthCluster: cluster } = req.params;
|
26
|
+
const { odinBaseUrl } = req.ctx.config;
|
27
|
+
const odinPath = typeof odinBaseUrl === 'string' ? odinBaseUrl : odinBaseUrl === null || odinBaseUrl === void 0 ? void 0 : odinBaseUrl[cluster];
|
28
28
|
if (!odinPath) {
|
29
29
|
return (0, utils_1.sendAndLogError)(req.ctx, res, 500, new Error('Odin base url is not configured'));
|
30
30
|
}
|
31
31
|
const { ctx, query } = req;
|
32
32
|
const search = lodash_1.default.isEmpty(query) ? '' : `?${qs_1.default.stringify(query)}`;
|
33
|
-
const { action, ytAuthCluster: cluster } = req.params;
|
34
33
|
const allowedActionsUrls = {
|
35
34
|
service_list: `${odinPath}/service_list`,
|
36
35
|
exists: `${odinPath}/${action}/${cluster}`,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ytsaurus/ui",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.22.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "github",
|
6
6
|
"url": "https://github.com/YTsaurus/ytsaurus-ui/tree/main/packages/ui"
|
@@ -186,7 +186,7 @@
|
|
186
186
|
"engines": {
|
187
187
|
"node": ">=18"
|
188
188
|
},
|
189
|
-
"gitHead": "
|
189
|
+
"gitHead": "66ccb4490df0e9e7ae17ce0e61f5841ac9b477fe",
|
190
190
|
"overrides": {
|
191
191
|
"react-split-pane": {
|
192
192
|
"react": "$react",
|