pollination-react-io 1.40.2 → 1.41.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/RunDetails/RunContent.types.d.ts +3 -1
- package/build/RunDetails/RunDetails.types.d.ts +3 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/useWindowDimensions.d.ts +4 -0
- package/build/index.esm.js +139 -68
- package/build/index.esm.js.map +1 -1
- package/build/index.js +139 -67
- package/build/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { APIClient } from '../hooks';
|
|
3
3
|
import { FileCardProps } from './Cards/FileCard';
|
|
4
|
+
import { FolderCardProps } from './Cards/FolderCard';
|
|
4
5
|
export interface RunContentProps {
|
|
5
6
|
title: string;
|
|
6
7
|
inputData: any[];
|
|
@@ -10,5 +11,6 @@ export interface RunContentProps {
|
|
|
10
11
|
projectName?: string;
|
|
11
12
|
client?: APIClient;
|
|
12
13
|
style?: CSSProperties;
|
|
13
|
-
|
|
14
|
+
getFileCard?: (card: FileCardProps) => any;
|
|
15
|
+
getFolderCard?: (card: FolderCardProps) => any;
|
|
14
16
|
}
|
|
@@ -2,6 +2,7 @@ import { Run, UserPrivate } from '@pollination-solutions/pollination-sdk';
|
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
3
|
import { APIClient } from '../hooks';
|
|
4
4
|
import { FileCardProps } from './Cards/FileCard';
|
|
5
|
+
import { FolderCardProps } from './Cards/FolderCard';
|
|
5
6
|
export interface LocalRun {
|
|
6
7
|
meta: any;
|
|
7
8
|
status: any;
|
|
@@ -16,5 +17,6 @@ export interface RunDetailsProps {
|
|
|
16
17
|
authUser?: UserPrivate;
|
|
17
18
|
client?: APIClient;
|
|
18
19
|
style?: CSSProperties;
|
|
19
|
-
|
|
20
|
+
getFileCard?: (card: FileCardProps) => any;
|
|
21
|
+
getFolderCard?: (card: FolderCardProps) => any;
|
|
20
22
|
}
|
package/build/hooks/index.d.ts
CHANGED
package/build/index.esm.js
CHANGED
|
@@ -40483,6 +40483,25 @@ var useSendHbjson = function () {
|
|
|
40483
40483
|
});
|
|
40484
40484
|
};
|
|
40485
40485
|
|
|
40486
|
+
var useWindowDimensions = function () {
|
|
40487
|
+
var getDimension = function () {
|
|
40488
|
+
var width = window.innerWidth, height = window.innerHeight;
|
|
40489
|
+
return {
|
|
40490
|
+
width: width,
|
|
40491
|
+
height: height
|
|
40492
|
+
};
|
|
40493
|
+
};
|
|
40494
|
+
var _a = useState(getDimension()), dimensions = _a[0], setDimensions = _a[1];
|
|
40495
|
+
useEffect(function () {
|
|
40496
|
+
function handleResize() {
|
|
40497
|
+
setDimensions(getDimension());
|
|
40498
|
+
}
|
|
40499
|
+
window.addEventListener('resize', handleResize);
|
|
40500
|
+
return function () { return window.removeEventListener('resize', handleResize); };
|
|
40501
|
+
}, []);
|
|
40502
|
+
return dimensions;
|
|
40503
|
+
};
|
|
40504
|
+
|
|
40486
40505
|
var AuthUser = function (config) {
|
|
40487
40506
|
var authUser = useAPIClient(config).authUser;
|
|
40488
40507
|
return (React__default.createElement(Avatar, { alt: authUser && authUser.name, src: authUser && authUser.picture, href: authUser && "https://app.pollination.cloud/".concat(authUser.username), fallback: authUser
|
|
@@ -46932,7 +46951,7 @@ var SendModel = function (_a) {
|
|
|
46932
46951
|
}], asButtons: true, label: buttonLabel, helpText: "".concat(selOpt ? selOpt.charAt(0).toUpperCase() + selOpt.replace('-', ' ').slice(1) : 'Send', " model.") }));
|
|
46933
46952
|
};
|
|
46934
46953
|
|
|
46935
|
-
var css_248z$3 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.item1 {\n grid-area: accountprj;\n font-size: 1rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item2 {\n grid-area: runworkspacedebug;\n text-align: right !important;\n font-size: 1.25rem;\n white-space: nowrap;\n}\n\n.item3 {\n grid-area: studyrun;\n font-size: 1.25rem;\n font-weight: 500;\n white-space: wrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item4 {\n grid-area: date;\n color: var(--slate10);\n font-size: 0.9rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: right !important;\n}\n\n.item5 {\n grid-area: author;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item6 {\n grid-area: recipe;\n white-space: wrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item7 {\n grid-area: description;\n white-space: wrap;\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.item8 {\n grid-area: status;\n font-size: 0.9rem;\n}\n\n.status-label {\n font-weight: 500;\n}\n\n.item9 {\n grid-area: time;\n text-align: right !important;\n white-space: wrap;\n}\n\n.item10 {\n grid-area: cpu;\n text-align: right !important;\n white-space: wrap;\n}\n\n.link {\n text-decoration: none;\n color: var(--primary3);\n}\n\n.link:hover {\n color: var(--primary3);\n}\n\n.light-text {\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj accountprj runworkspacedebug\" \"studyrun studyrun studyrun studyrun date date\" \"author recipe recipe recipe recipe recipe\" \"status status status status cpu time\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.35rem;\n transition: box-shadow 0.3s ease 0s, border-color 0.3s ease 0s;\n grid-template-rows: 52px 38px 46px 46px auto;\n border-radius: 6px;\n line-height: 1.5;\n}\n\n.grid-container:hover {\n box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 2px -2px, rgba(0, 0, 0, 0.12) 0px 3px 6px 0px, rgba(0, 0, 0, 0.09) 0px 5px 12px 4px;\n cursor: pointer;\n}\n\n.disable-click {\n box-shadow: none !important;\n cursor: default !important;\n}\n\n.grid-container > div {\n text-align: left;\n padding: 1rem;\n vertical-align: middle;\n}\n\n.description-expander {\n all: unset;\n}\n\n.description-expander:focus {\n outline: 0 !important;\n}\n\n@media (max-width: 600px) {\n .grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj accountprj runworkspacedebug\" \"studyrun studyrun studyrun
|
|
46954
|
+
var css_248z$3 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.item1 {\n grid-area: accountprj;\n font-size: 1rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item2 {\n grid-area: runworkspacedebug;\n text-align: right !important;\n font-size: 1.25rem;\n white-space: nowrap;\n}\n\n.item3 {\n grid-area: studyrun;\n font-size: 1.25rem;\n font-weight: 500;\n white-space: wrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item4 {\n grid-area: date;\n color: var(--slate10);\n font-size: 0.9rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: right !important;\n}\n\n.item5 {\n grid-area: author;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item6 {\n grid-area: recipe;\n white-space: wrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item7 {\n grid-area: description;\n white-space: wrap;\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.item8 {\n grid-area: status;\n font-size: 0.9rem;\n}\n\n.status-label {\n font-weight: 500;\n}\n\n.item9 {\n grid-area: time;\n text-align: right !important;\n white-space: wrap;\n}\n\n.item10 {\n grid-area: cpu;\n text-align: right !important;\n white-space: wrap;\n}\n\n.link {\n text-decoration: none;\n color: var(--primary3);\n}\n\n.link:hover {\n color: var(--primary3);\n}\n\n.light-text {\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj accountprj runworkspacedebug\" \"studyrun studyrun studyrun studyrun date date\" \"author recipe recipe recipe recipe recipe\" \"status status status status cpu time\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.35rem;\n transition: box-shadow 0.3s ease 0s, border-color 0.3s ease 0s;\n grid-template-rows: 52px 38px 46px 46px auto;\n border-radius: 6px;\n line-height: 1.5;\n}\n\n.grid-container:hover {\n box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 2px -2px, rgba(0, 0, 0, 0.12) 0px 3px 6px 0px, rgba(0, 0, 0, 0.09) 0px 5px 12px 4px;\n cursor: pointer;\n}\n\n.disable-click {\n box-shadow: none !important;\n cursor: default !important;\n}\n\n.grid-container > div {\n text-align: left;\n padding: 1rem;\n vertical-align: middle;\n}\n\n.description-expander {\n all: unset;\n}\n\n.description-expander:focus {\n outline: 0 !important;\n}\n\n@media (max-width: 600px) {\n .grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj accountprj runworkspacedebug\" \"studyrun studyrun studyrun date date date\" \"author author author recipe recipe recipe\" \"time time status status cpu cpu\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.15rem;\n transition: box-shadow 0.3s;\n grid-template-rows: 52px 52px 32px 52px auto;\n }\n .item1 {\n text-align: left !important;\n }\n .item2 {\n text-align: right !important;\n font-size: 1rem;\n white-space: nowrap;\n }\n .item3, .item4 {\n text-align: center !important;\n }\n .item5 {\n font-size: 0.8rem;\n }\n .item6 {\n white-space: nowrap;\n font-size: 0.8rem;\n }\n .item7 {\n font-size: 0.8rem;\n text-align: center !important;\n }\n .item8 {\n font-size: 1rem;\n text-align: center !important;\n }\n .item9 {\n text-align: left !important;\n font-size: 1rem;\n white-space: nowrap;\n }\n .item10 {\n text-align: right !important;\n }\n .grid-container > div {\n text-align: left;\n vertical-align: middle;\n }\n}";
|
|
46936
46955
|
styleInject(css_248z$3);
|
|
46937
46956
|
|
|
46938
46957
|
var IconContext = /*#__PURE__*/createContext({});
|
|
@@ -48428,9 +48447,10 @@ var StudyCard = function (_a) {
|
|
|
48428
48447
|
// Fetch _study
|
|
48429
48448
|
var _f = useJobs(client), fetchJob = _f.fetchJob, getDuration = _f.getDuration, statusMap = _f.statusMap;
|
|
48430
48449
|
var listRuns = useRuns(client).listRuns;
|
|
48431
|
-
var _g =
|
|
48450
|
+
var _g = useWindowDimensions(), width = _g.width; _g.height;
|
|
48451
|
+
var _h = useState(false), open = _h[0], setOpen = _h[1];
|
|
48432
48452
|
// From job to run
|
|
48433
|
-
var
|
|
48453
|
+
var _j = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
|
|
48434
48454
|
revalidateOnFocus: false,
|
|
48435
48455
|
refreshInterval: !_study || _study.status.finished_at ? undefined : 5000,
|
|
48436
48456
|
fallbackData: _study,
|
|
@@ -48451,7 +48471,7 @@ var StudyCard = function (_a) {
|
|
|
48451
48471
|
})
|
|
48452
48472
|
.catch(function () { setRun(undefined); });
|
|
48453
48473
|
}
|
|
48454
|
-
}), study =
|
|
48474
|
+
}), study = _j.data; _j.error; _j.isValidating;
|
|
48455
48475
|
var total = useMemo(function () {
|
|
48456
48476
|
if (!study)
|
|
48457
48477
|
return undefined;
|
|
@@ -48474,8 +48494,8 @@ var StudyCard = function (_a) {
|
|
|
48474
48494
|
}
|
|
48475
48495
|
return study.status.status.toLocaleLowerCase();
|
|
48476
48496
|
}, [study]);
|
|
48477
|
-
var
|
|
48478
|
-
var
|
|
48497
|
+
var _k = useState(), run = _k[0], setRun = _k[1];
|
|
48498
|
+
var _l = useState(getDuration(study)), duration = _l[0], setDuration = _l[1];
|
|
48479
48499
|
useEffect(function () {
|
|
48480
48500
|
setRun(undefined);
|
|
48481
48501
|
if (!study)
|
|
@@ -48492,16 +48512,19 @@ var StudyCard = function (_a) {
|
|
|
48492
48512
|
/*
|
|
48493
48513
|
* Manage hover
|
|
48494
48514
|
*/
|
|
48495
|
-
var
|
|
48515
|
+
var _m = useState({
|
|
48496
48516
|
account: false,
|
|
48497
48517
|
project: false,
|
|
48498
|
-
|
|
48499
|
-
|
|
48500
|
-
|
|
48518
|
+
details: false,
|
|
48519
|
+
workspace: false,
|
|
48520
|
+
debug: false,
|
|
48521
|
+
detailsOver: false,
|
|
48522
|
+
workspaceOver: false,
|
|
48523
|
+
debugOver: false,
|
|
48501
48524
|
author: false,
|
|
48502
48525
|
recipe: false,
|
|
48503
48526
|
info: false
|
|
48504
|
-
}), hover =
|
|
48527
|
+
}), hover = _m[0], setHover = _m[1];
|
|
48505
48528
|
var toggleHover = function (event, inputId, value) {
|
|
48506
48529
|
if (inputId === void 0) { inputId = undefined; }
|
|
48507
48530
|
if (value === void 0) { value = false; }
|
|
@@ -48534,16 +48557,43 @@ var StudyCard = function (_a) {
|
|
|
48534
48557
|
(study && !run) && total == 1 && React__default.createElement(LoadingOutlined$1, null),
|
|
48535
48558
|
study && run &&
|
|
48536
48559
|
React__default.createElement("div", null,
|
|
48537
|
-
React__default.createElement(
|
|
48538
|
-
|
|
48539
|
-
|
|
48540
|
-
|
|
48541
|
-
|
|
48542
|
-
|
|
48560
|
+
React__default.createElement(InfoCircleOutlined$1, { className: 'link', onClick: function (e) {
|
|
48561
|
+
e.stopPropagation();
|
|
48562
|
+
document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?tab=info");
|
|
48563
|
+
}, onMouseOver: function (e) {
|
|
48564
|
+
toggleHover(e, 'detailsOver', true);
|
|
48565
|
+
}, onMouseLeave: function (e) {
|
|
48566
|
+
toggleHover(e, 'detailsOver', false);
|
|
48567
|
+
}, style: { marginRight: '0.75rem',
|
|
48568
|
+
color: "".concat((hover.details || hover.detailsOver) ? '#40a9ff' : '#000') } }),
|
|
48569
|
+
React__default.createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
|
|
48570
|
+
e.stopPropagation();
|
|
48571
|
+
document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?tab=workspace&path=runs/").concat(run.id);
|
|
48572
|
+
}, onMouseOver: function (e) {
|
|
48573
|
+
toggleHover(e, 'workspaceOver', true);
|
|
48574
|
+
}, onMouseLeave: function (e) {
|
|
48575
|
+
toggleHover(e, 'workspaceOver', false);
|
|
48576
|
+
}, style: { marginRight: '0.75rem',
|
|
48577
|
+
color: "".concat((hover.workspace || hover.workspaceOver) ? '#40a9ff' : '#000') } }),
|
|
48578
|
+
React__default.createElement(PartitionOutlined$1, { className: 'link', onClick: function (e) {
|
|
48579
|
+
e.stopPropagation();
|
|
48580
|
+
document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?tab=debug");
|
|
48581
|
+
}, onMouseOver: function (e) {
|
|
48582
|
+
toggleHover(e, 'debugOver', true);
|
|
48583
|
+
}, onMouseLeave: function (e) {
|
|
48584
|
+
toggleHover(e, 'debugOver', false);
|
|
48585
|
+
}, style: { color: "".concat((hover.debug || hover.debugOver) ? '#40a9ff' : '#000') } })),
|
|
48543
48586
|
(study && total > 1) &&
|
|
48544
48587
|
React__default.createElement("div", null,
|
|
48545
|
-
React__default.createElement(
|
|
48546
|
-
|
|
48588
|
+
React__default.createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
|
|
48589
|
+
e.stopPropagation();
|
|
48590
|
+
document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/workspace");
|
|
48591
|
+
}, onMouseOver: function (e) {
|
|
48592
|
+
toggleHover(e, 'workspaceOver', true);
|
|
48593
|
+
}, onMouseLeave: function (e) {
|
|
48594
|
+
toggleHover(e, 'workspaceOver', false);
|
|
48595
|
+
}, style: { marginRight: '0.75rem',
|
|
48596
|
+
color: "".concat((hover.workspace || hover.workspaceOver) ? '#40a9ff' : '#000') } }))),
|
|
48547
48597
|
React__default.createElement("div", { className: 'item3' },
|
|
48548
48598
|
React__default.createElement("div", null,
|
|
48549
48599
|
study ? (_d = study.spec.name) !== null && _d !== void 0 ? _d : "Study: ".concat(study.id) : '--',
|
|
@@ -48556,11 +48606,11 @@ var StudyCard = function (_a) {
|
|
|
48556
48606
|
React__default.createElement("div", { className: 'item4' }, study ? dayjs_min(study.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
|
48557
48607
|
React__default.createElement("div", { className: 'item5' },
|
|
48558
48608
|
React__default.createElement("span", { style: { marginRight: '0.75rem' } },
|
|
48559
|
-
React__default.createElement(Avatar, { src: study ? study.author.picture_url : '', size: 24 })),
|
|
48609
|
+
React__default.createElement(Avatar, { src: study ? study.author.picture_url : '', size: 24, color: hover.author ? '#40a9ff' : undefined })),
|
|
48560
48610
|
React__default.createElement("a", { className: 'link', href: study ? "/".concat(study.author.name) : '', target: '_blank', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover(e, undefined, true); }, onMouseLeave: function (e) { return toggleHover(e, undefined, false); }, id: 'author', style: hover.author ? { color: '#40a9ff' } : {} }, study ? ((_e = study.author.display_name) !== null && _e !== void 0 ? _e : study.author.name) : '--')),
|
|
48561
48611
|
React__default.createElement("div", { className: 'item6' },
|
|
48562
48612
|
React__default.createElement("span", { style: { marginRight: '0.75rem' } },
|
|
48563
|
-
React__default.createElement(Avatar, { src: study ? study.recipe.metadata.icon : '', size: 24 })),
|
|
48613
|
+
React__default.createElement(Avatar, { src: study ? study.recipe.metadata.icon : '', size: 24, color: hover.recipe ? '#40a9ff' : undefined })),
|
|
48564
48614
|
React__default.createElement("a", { className: 'link', href: study ? recipeLinkFromSource(study.recipe.source) : '', target: '_blank', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover(e, undefined, true); }, onMouseLeave: function (e) { return toggleHover(e, undefined, false); }, id: 'recipe', style: hover.recipe ? { color: '#40a9ff' } : {} }, study ? study.recipe.metadata.name : '--'),
|
|
48565
48615
|
study && React__default.createElement("span", { className: 'light-text' },
|
|
48566
48616
|
" ",
|
|
@@ -48568,15 +48618,15 @@ var StudyCard = function (_a) {
|
|
|
48568
48618
|
React__default.createElement("div", { className: 'item8' },
|
|
48569
48619
|
React__default.createElement("span", { className: 'status-label', style: { marginRight: '0.75rem' } }, study ? status.charAt(0).toUpperCase() + status.slice(1) : '--'),
|
|
48570
48620
|
React__default.createElement("span", { className: 'light-text' },
|
|
48571
|
-
(study && total == 1) && run &&
|
|
48621
|
+
(study && total == 1) && run && width > 600 &&
|
|
48572
48622
|
"".concat(run.meta.progress.completed, " / ").concat(run.meta.progress.total, " steps"),
|
|
48573
|
-
(study && total > 1) &&
|
|
48623
|
+
(study && total > 1) && width > 600 &&
|
|
48574
48624
|
"".concat(study.status.runs_completed, " / ").concat(total, " runs"))),
|
|
48575
48625
|
React__default.createElement("div", { className: 'item9' },
|
|
48576
|
-
React__default.createElement(Cpu$1, { size: 18, style: { marginRight: '0.
|
|
48626
|
+
React__default.createElement(Cpu$1, { size: 18, style: { marginRight: '0.15rem' } }),
|
|
48577
48627
|
React__default.createElement("span", { className: 'light-text' }, study ? "".concat(formatDuration$1(dayjs_min.duration(study.resources_duration.cpu, 'seconds'))) : '--')),
|
|
48578
48628
|
React__default.createElement("div", { className: 'item10' },
|
|
48579
|
-
React__default.createElement(Clock$1, { size: 18, style: { marginRight: '0.
|
|
48629
|
+
React__default.createElement(Clock$1, { size: 18, style: { marginRight: '0.15rem' } }),
|
|
48580
48630
|
React__default.createElement("span", { className: 'light-text' }, study ? "".concat(formatDuration$1(duration)) : '--')),
|
|
48581
48631
|
open && React__default.createElement(React__default.Fragment, null,
|
|
48582
48632
|
React__default.createElement("div", { className: 'item7' }, study ? study.spec.description : '--'))));
|
|
@@ -48595,11 +48645,12 @@ var RunCard = function (_a) {
|
|
|
48595
48645
|
*/
|
|
48596
48646
|
var fetchJob = useJobs(client).fetchJob;
|
|
48597
48647
|
var _f = useRuns(client), fetchRun = _f.fetchRun, statusMap = _f.statusMap, getDuration = _f.getDuration;
|
|
48598
|
-
var _g =
|
|
48648
|
+
var _g = useWindowDimensions(), width = _g.width; _g.height;
|
|
48649
|
+
var _h = useState(false), open = _h[0], setOpen = _h[1];
|
|
48599
48650
|
/*
|
|
48600
48651
|
* From run to job
|
|
48601
48652
|
*/
|
|
48602
|
-
var
|
|
48653
|
+
var _j = useSWR(authUser && _run ? [projectOwner, projectName, _run.id] : undefined, fetchRun, {
|
|
48603
48654
|
revalidateOnFocus: false,
|
|
48604
48655
|
refreshInterval: !_run || _run.status.finished_at ? undefined : 5000,
|
|
48605
48656
|
fallbackData: _run,
|
|
@@ -48611,14 +48662,14 @@ var RunCard = function (_a) {
|
|
|
48611
48662
|
})
|
|
48612
48663
|
.catch(function () { setStudy(undefined); });
|
|
48613
48664
|
}
|
|
48614
|
-
}), run =
|
|
48665
|
+
}), run = _j.data; _j.error; _j.isValidating;
|
|
48615
48666
|
var status = useMemo(function () {
|
|
48616
48667
|
if (!run)
|
|
48617
48668
|
return undefined;
|
|
48618
48669
|
return run.status.status;
|
|
48619
48670
|
}, [run]);
|
|
48620
|
-
var
|
|
48621
|
-
var
|
|
48671
|
+
var _k = useState(), study = _k[0], setStudy = _k[1];
|
|
48672
|
+
var _l = useState(getDuration(run)), duration = _l[0], setDuration = _l[1];
|
|
48622
48673
|
useEffect(function () {
|
|
48623
48674
|
if (!run)
|
|
48624
48675
|
return undefined;
|
|
@@ -48634,16 +48685,19 @@ var RunCard = function (_a) {
|
|
|
48634
48685
|
/*
|
|
48635
48686
|
* Manage hover
|
|
48636
48687
|
*/
|
|
48637
|
-
var
|
|
48688
|
+
var _m = useState({
|
|
48638
48689
|
account: false,
|
|
48639
48690
|
project: false,
|
|
48640
|
-
|
|
48641
|
-
|
|
48642
|
-
|
|
48691
|
+
details: false,
|
|
48692
|
+
workspace: false,
|
|
48693
|
+
debug: false,
|
|
48694
|
+
detailsOver: false,
|
|
48695
|
+
workspaceOver: false,
|
|
48696
|
+
debugOver: false,
|
|
48643
48697
|
author: false,
|
|
48644
48698
|
recipe: false,
|
|
48645
48699
|
info: false
|
|
48646
|
-
}), hover =
|
|
48700
|
+
}), hover = _m[0], setHover = _m[1];
|
|
48647
48701
|
var toggleHover = function (event, inputId, value) {
|
|
48648
48702
|
if (inputId === void 0) { inputId = undefined; }
|
|
48649
48703
|
if (value === void 0) { value = false; }
|
|
@@ -48670,27 +48724,41 @@ var RunCard = function (_a) {
|
|
|
48670
48724
|
!study && run && React__default.createElement(LoadingOutlined$1, null),
|
|
48671
48725
|
run && study &&
|
|
48672
48726
|
React__default.createElement("div", null,
|
|
48673
|
-
React__default.createElement(
|
|
48674
|
-
// href={`/${projectOwner}/projects/${projectName}/studies/${study.id}/runs/${run.id}`}
|
|
48675
|
-
onClick: function (e) {
|
|
48727
|
+
React__default.createElement(InfoCircleOutlined$1, { className: 'link', onClick: function (e) {
|
|
48676
48728
|
e.stopPropagation();
|
|
48677
|
-
getValue('
|
|
48678
|
-
|
|
48679
|
-
|
|
48680
|
-
|
|
48681
|
-
|
|
48682
|
-
|
|
48729
|
+
getValue('details');
|
|
48730
|
+
toggleHover(e, 'workspace', false);
|
|
48731
|
+
toggleHover(e, 'details', true);
|
|
48732
|
+
toggleHover(e, 'debug', false);
|
|
48733
|
+
}, onMouseOver: function (e) {
|
|
48734
|
+
toggleHover(e, 'detailsOver', true);
|
|
48735
|
+
}, onMouseLeave: function (e) {
|
|
48736
|
+
toggleHover(e, 'detailsOver', false);
|
|
48737
|
+
}, style: { marginRight: '0.75rem',
|
|
48738
|
+
color: "".concat((hover.details || hover.detailsOver) ? '#40a9ff' : '#000') } }),
|
|
48739
|
+
React__default.createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
|
|
48683
48740
|
e.stopPropagation();
|
|
48684
48741
|
getValue('workspace');
|
|
48685
|
-
|
|
48686
|
-
|
|
48687
|
-
|
|
48688
|
-
|
|
48689
|
-
|
|
48742
|
+
toggleHover(e, 'workspace', true);
|
|
48743
|
+
toggleHover(e, 'details', false);
|
|
48744
|
+
toggleHover(e, 'debug', false);
|
|
48745
|
+
}, onMouseOver: function (e) {
|
|
48746
|
+
toggleHover(e, 'workspaceOver', true);
|
|
48747
|
+
}, onMouseLeave: function (e) {
|
|
48748
|
+
toggleHover(e, 'workspaceOver', false);
|
|
48749
|
+
}, style: { marginRight: '0.75rem',
|
|
48750
|
+
color: "".concat((hover.workspace || hover.workspaceOver) ? '#40a9ff' : '#000') } }),
|
|
48751
|
+
React__default.createElement(PartitionOutlined$1, { className: 'link', onClick: function (e) {
|
|
48690
48752
|
e.stopPropagation();
|
|
48691
48753
|
getValue('debug');
|
|
48692
|
-
|
|
48693
|
-
|
|
48754
|
+
toggleHover(e, 'workspace', false);
|
|
48755
|
+
toggleHover(e, 'details', false);
|
|
48756
|
+
toggleHover(e, 'debug', true);
|
|
48757
|
+
}, onMouseOver: function (e) {
|
|
48758
|
+
toggleHover(e, 'debugOver', true);
|
|
48759
|
+
}, onMouseLeave: function (e) {
|
|
48760
|
+
toggleHover(e, 'debugOver', false);
|
|
48761
|
+
}, style: { color: "".concat((hover.debug || hover.debugOver) ? '#40a9ff' : '#000') } }))),
|
|
48694
48762
|
React__default.createElement("div", { className: 'item3' },
|
|
48695
48763
|
React__default.createElement("div", null,
|
|
48696
48764
|
study ? (_d = study.spec.name) !== null && _d !== void 0 ? _d : "Study: ".concat(study.id) : '--',
|
|
@@ -48702,24 +48770,24 @@ var RunCard = function (_a) {
|
|
|
48702
48770
|
React__default.createElement("div", { className: 'item4' }, study ? dayjs_min(study.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
|
48703
48771
|
React__default.createElement("div", { className: 'item5' },
|
|
48704
48772
|
React__default.createElement("span", { style: { marginRight: '0.75rem' } },
|
|
48705
|
-
React__default.createElement(Avatar, { src: study ? study.author.picture_url : '', size: 24 })),
|
|
48773
|
+
React__default.createElement(Avatar, { color: hover.author ? '#40a9ff' : undefined, src: study ? study.author.picture_url : '', size: 24 })),
|
|
48706
48774
|
React__default.createElement("a", { className: 'link', href: study ? "/".concat(study.author.name) : '', target: '_blank', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover(e, undefined, true); }, onMouseLeave: function (e) { return toggleHover(e, undefined, false); }, id: 'author', style: hover.author ? { color: '#40a9ff' } : {} }, study ? ((_e = study.author.display_name) !== null && _e !== void 0 ? _e : study.author.name) : '--')),
|
|
48707
48775
|
React__default.createElement("div", { className: 'item6' },
|
|
48708
48776
|
React__default.createElement("span", { style: { marginRight: '0.75rem' } },
|
|
48709
|
-
React__default.createElement(Avatar, { src: study ? study.recipe.metadata.icon : '', size: 24 })),
|
|
48777
|
+
React__default.createElement(Avatar, { color: hover.recipe ? '#40a9ff' : undefined, src: study ? study.recipe.metadata.icon : '', size: 24 })),
|
|
48710
48778
|
React__default.createElement("a", { className: 'link', href: study ? recipeLinkFromSource(study.recipe.source) : '', target: '_blank', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover(e, undefined, true); }, onMouseLeave: function (e) { return toggleHover(e, undefined, false); }, id: 'recipe', style: hover.recipe ? { color: '#40a9ff' } : {} }, study ? study.recipe.metadata.name : '--'),
|
|
48711
48779
|
study && React__default.createElement("span", { className: 'light-text' },
|
|
48712
48780
|
" ",
|
|
48713
48781
|
study.recipe.metadata.tag)),
|
|
48714
48782
|
React__default.createElement("div", { className: 'item8' },
|
|
48715
48783
|
React__default.createElement("span", { className: 'status-label', style: { marginRight: '0.75rem' } }, study ? status : '--'),
|
|
48716
|
-
React__default.createElement("span", { className: 'light-text' }, study && run &&
|
|
48784
|
+
React__default.createElement("span", { className: 'light-text' }, study && run && width > 600 &&
|
|
48717
48785
|
"".concat(run.meta.progress.completed, " / ").concat(run.meta.progress.total, " steps"))),
|
|
48718
48786
|
React__default.createElement("div", { className: 'item9' },
|
|
48719
|
-
React__default.createElement(Cpu$1, { size: 18, style: { marginRight: '0.
|
|
48787
|
+
React__default.createElement(Cpu$1, { size: 18, style: { marginRight: '0.15rem' } }),
|
|
48720
48788
|
React__default.createElement("span", { className: 'light-text' }, study ? "".concat(formatDuration(dayjs_min.duration(run.meta.resources_duration.cpu, 'seconds'))) : '--')),
|
|
48721
48789
|
React__default.createElement("div", { className: 'item10' },
|
|
48722
|
-
React__default.createElement(Clock$1, { size: 18, style: { marginRight: '0.
|
|
48790
|
+
React__default.createElement(Clock$1, { size: 18, style: { marginRight: '0.15rem' } }),
|
|
48723
48791
|
React__default.createElement("span", { className: 'light-text' }, study ? "".concat(formatDuration(duration)) : '--')),
|
|
48724
48792
|
open && React__default.createElement(React__default.Fragment, null,
|
|
48725
48793
|
React__default.createElement("div", { className: 'item7' }, study ? study.spec.description : '--'))));
|
|
@@ -48873,14 +48941,14 @@ var css_248z = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --pr
|
|
|
48873
48941
|
styleInject(css_248z);
|
|
48874
48942
|
|
|
48875
48943
|
var RunContent = function (_a) {
|
|
48876
|
-
var inputData = _a.inputData, projectOwner = _a.projectOwner, projectName = _a.projectName, studyId = _a.studyId, runId = _a.runId, client = _a.client, title = _a.title, style = _a.style,
|
|
48944
|
+
var inputData = _a.inputData, projectOwner = _a.projectOwner, projectName = _a.projectName, studyId = _a.studyId, runId = _a.runId, client = _a.client, title = _a.title, style = _a.style, getFileCard = _a.getFileCard, getFolderCard = _a.getFolderCard;
|
|
48877
48945
|
var downloadArtifact = useArtifacts(projectOwner, projectName, client).downloadArtifact;
|
|
48878
48946
|
var fetchAndSet = function (url, card) {
|
|
48879
48947
|
fetch(url)
|
|
48880
48948
|
.then(function (response) { return response.blob()
|
|
48881
48949
|
.then(function (blob) {
|
|
48882
48950
|
blob.type;
|
|
48883
|
-
|
|
48951
|
+
getFileCard(__assign(__assign({}, card), { file: blob }));
|
|
48884
48952
|
}); })
|
|
48885
48953
|
.catch(function () { });
|
|
48886
48954
|
};
|
|
@@ -48931,23 +48999,26 @@ var RunContent = function (_a) {
|
|
|
48931
48999
|
// Generate Blob on click
|
|
48932
49000
|
studyId && downloadArtifact(card.path, studyId)
|
|
48933
49001
|
.then(function (url) { return fetchAndSet(url, card); })
|
|
48934
|
-
.catch(function () { return
|
|
49002
|
+
.catch(function () { return getFileCard(__assign(__assign({}, card), { file: undefined })); });
|
|
48935
49003
|
}
|
|
48936
49004
|
else {
|
|
48937
49005
|
// TODO: Local later...
|
|
48938
|
-
|
|
49006
|
+
getFileCard(__assign(__assign({}, card), { file: card.path }));
|
|
48939
49007
|
}
|
|
48940
49008
|
};
|
|
48941
49009
|
/**
|
|
48942
49010
|
* Click event handler of the folder card
|
|
48943
|
-
* @param card
|
|
49011
|
+
* @param card Folder card props
|
|
48944
49012
|
*/
|
|
48945
49013
|
var onFolderClicked = function (card) {
|
|
48946
49014
|
if (isCloud) {
|
|
48947
|
-
|
|
49015
|
+
getFolderCard(__assign({}, card));
|
|
49016
|
+
// window.location.href = `/${projectOwner}/projects/${projectName}/studies/${studyId}/runs/${runId}/workspace?path=${card.path}`
|
|
48948
49017
|
}
|
|
48949
49018
|
else {
|
|
48950
|
-
|
|
49019
|
+
// TODO: Fix it later when Local is ready
|
|
49020
|
+
getFolderCard(__assign({}, card));
|
|
49021
|
+
// alert(runId.concat('/').concat(card.path))
|
|
48951
49022
|
}
|
|
48952
49023
|
};
|
|
48953
49024
|
return React__default.createElement("div", { className: 'cards-container', style: __assign({}, style) },
|
|
@@ -48972,7 +49043,7 @@ var RunContent = function (_a) {
|
|
|
48972
49043
|
var RunDetails = function (_a) {
|
|
48973
49044
|
var projectName = _a.projectName, projectOwner = _a.projectOwner, run = _a.run, // Cloud and Local
|
|
48974
49045
|
runId = _a.runId; // TODO: delete it if RUN JSON has the field
|
|
48975
|
-
_a.authUser; var client = _a.client, style = _a.style,
|
|
49046
|
+
_a.authUser; var client = _a.client, style = _a.style, getFileCard = _a.getFileCard, getFolderCard = _a.getFolderCard;
|
|
48976
49047
|
var _b = useState([]), extraInputs = _b[0], setExtraInputs = _b[1];
|
|
48977
49048
|
var _c = useState([]), recipeInputs = _c[0], setRecipeInputs = _c[1];
|
|
48978
49049
|
var _d = useState([]), outputs = _d[0], setOutputs = _d[1];
|
|
@@ -49005,12 +49076,12 @@ var RunDetails = function (_a) {
|
|
|
49005
49076
|
}, [currRun]);
|
|
49006
49077
|
return (React__default.createElement("div", null,
|
|
49007
49078
|
outputs &&
|
|
49008
|
-
React__default.createElement(RunContent, { title: 'Outputs', inputData: outputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id || runId, client: client, style: style,
|
|
49079
|
+
React__default.createElement(RunContent, { title: 'Outputs', inputData: outputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id || runId, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard }),
|
|
49009
49080
|
recipeInputs &&
|
|
49010
|
-
React__default.createElement(RunContent, { title: 'Inputs', inputData: recipeInputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id || runId, client: client, style: style,
|
|
49081
|
+
React__default.createElement(RunContent, { title: 'Inputs', inputData: recipeInputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id || runId, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard }),
|
|
49011
49082
|
extraInputs && extraInputs.length > 0 &&
|
|
49012
|
-
React__default.createElement(RunContent, { title: 'Extra Inputs', inputData: extraInputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id || runId, client: client, style: style,
|
|
49083
|
+
React__default.createElement(RunContent, { title: 'Extra Inputs', inputData: extraInputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id || runId, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard })));
|
|
49013
49084
|
};
|
|
49014
49085
|
|
|
49015
|
-
export { APIClient, AuthUser, Avatar, Button, ComboBox, ComboFileSelector, ConditionalWrapper, ConfigureLocalRun, CreateStudy, Dropdown, FileInput, FilePreview, FormInput, GetGeometry, GetModel, InputDescription, Label, Logo, NumberInput, RadioList, RecipeInputsForm, RunCard, RunDetails, SelectAccount, SelectCloudArtifacts, SelectLocalArtifacts, SelectProject, SelectRecipe, SelectRun, SelectStudy, SendGeometry, SendModel, SendResults, SettingsButton, StudyCard, TextInput, Tooltip, _defaultConfig, checkDotNet, checkPollinationPanel, checkRuby, formatBytes, getHost, recipeLinkFromSource, sendMessageDotNet, sendMessageRuby, useAPIClient, useArtifacts, useCreateStudy, useGetGeometry, useGetHbjson, useHbjsontoVTK, useJobs, useManageSettings, useRunCommand, useRuns, useSendHbjson, useSendMessage };
|
|
49086
|
+
export { APIClient, AuthUser, Avatar, Button, ComboBox, ComboFileSelector, ConditionalWrapper, ConfigureLocalRun, CreateStudy, Dropdown, FileInput, FilePreview, FormInput, GetGeometry, GetModel, InputDescription, Label, Logo, NumberInput, RadioList, RecipeInputsForm, RunCard, RunDetails, SelectAccount, SelectCloudArtifacts, SelectLocalArtifacts, SelectProject, SelectRecipe, SelectRun, SelectStudy, SendGeometry, SendModel, SendResults, SettingsButton, StudyCard, TextInput, Tooltip, _defaultConfig, checkDotNet, checkPollinationPanel, checkRuby, formatBytes, getHost, recipeLinkFromSource, sendMessageDotNet, sendMessageRuby, useAPIClient, useArtifacts, useCreateStudy, useGetGeometry, useGetHbjson, useHbjsontoVTK, useJobs, useManageSettings, useRunCommand, useRuns, useSendHbjson, useSendMessage, useWindowDimensions };
|
|
49016
49087
|
//# sourceMappingURL=index.esm.js.map
|