pollination-react-io 1.54.0 → 1.56.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/Cards/RunCard.types.d.ts +1 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/usePollinationPanel.d.ts +3 -2
- package/build/index.esm.js +129 -52
- package/build/index.esm.js.map +1 -1
- package/build/index.js +129 -51
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
@@ -38031,24 +38031,41 @@ var usePollinationPanel = function () {
|
|
38031
38031
|
return;
|
38032
38032
|
return panel.FromFileToBase64(filePath);
|
38033
38033
|
}, [panel]);
|
38034
|
-
var fetchLocalRun = React.useCallback(function (
|
38034
|
+
var fetchLocalRun = React.useCallback(function (path) {
|
38035
|
+
if (path === void 0) { path = ''; }
|
38036
|
+
if (!panel)
|
38037
|
+
return;
|
38038
|
+
var message = panel.FetchLocalRun(path);
|
38039
|
+
try {
|
38040
|
+
var run = JSON.parse(message.data);
|
38041
|
+
return run;
|
38042
|
+
}
|
38043
|
+
catch (error) {
|
38044
|
+
console.error(error);
|
38045
|
+
}
|
38046
|
+
}, [panel]);
|
38047
|
+
var fetchLocalJob = React.useCallback(function (path) {
|
38035
38048
|
var _a;
|
38036
|
-
if (
|
38037
|
-
if (projectName === void 0) { projectName = 'project-name'; }
|
38038
|
-
if (runPath === void 0) { runPath = ''; }
|
38049
|
+
if (path === void 0) { path = ''; }
|
38039
38050
|
if (!panel)
|
38040
38051
|
return;
|
38041
|
-
var message = panel.
|
38042
|
-
|
38043
|
-
|
38044
|
-
|
38052
|
+
var message = panel.FetchLocalJob(path);
|
38053
|
+
try {
|
38054
|
+
var localJob = JSON.parse(message.data);
|
38055
|
+
var job = (_a = localJob === null || localJob === void 0 ? void 0 : localJob.LocalJob) === null || _a === void 0 ? void 0 : _a.Job;
|
38056
|
+
return job;
|
38057
|
+
}
|
38058
|
+
catch (error) {
|
38059
|
+
console.error(error);
|
38060
|
+
}
|
38045
38061
|
}, [panel]);
|
38046
38062
|
return {
|
38047
38063
|
getFileBase64: getFileBase64,
|
38048
38064
|
saveFileBase64: saveFileBase64,
|
38049
38065
|
fromFileToBase64: fromFileToBase64,
|
38050
38066
|
getFilesFromDir: getFilesFromDir,
|
38051
|
-
fetchLocalRun: fetchLocalRun
|
38067
|
+
fetchLocalRun: fetchLocalRun,
|
38068
|
+
fetchLocalJob: fetchLocalJob
|
38052
38069
|
};
|
38053
38070
|
};
|
38054
38071
|
|
@@ -44743,6 +44760,7 @@ var CreateStudy = function (_a) {
|
|
44743
44760
|
}, 3000);
|
44744
44761
|
}
|
44745
44762
|
};
|
44763
|
+
var toUnixPath = function (path) { return path.replace(/[\\/]+/g, '/').replace(/^([a-zA-Z]+:|\.\/)/, ''); };
|
44746
44764
|
var _onSuccessLocal = function (projectJobInfo) {
|
44747
44765
|
if (!basePath) {
|
44748
44766
|
throw new Error('CreateStudy: client.configuration.basepath not defined.');
|
@@ -44754,6 +44772,12 @@ var CreateStudy = function (_a) {
|
|
44754
44772
|
}
|
44755
44773
|
else {
|
44756
44774
|
_t.success("Study is running! Do not close the console.\nYou will find output here ".concat(projectJobInfo.studyId, "."), { duration: 4000, position: 'bottom-left', style: { minWidth: '300px', fontSize: '12px' } });
|
44775
|
+
// Formatted name of the job
|
44776
|
+
var jobName_1 = toUnixPath(projectJobInfo.studyId).split('/').reverse()[0];
|
44777
|
+
// Path is the full path of the local machine where the run input/output are
|
44778
|
+
setTimeout(function () {
|
44779
|
+
window.location.href = "http://localhost:3000/".concat(projectJobInfo.accountName, "/projects/").concat(projectJobInfo.projectName, "/localStudies/").concat(jobName_1, "/?path=").concat(projectJobInfo.studyId);
|
44780
|
+
}, 3000);
|
44757
44781
|
}
|
44758
44782
|
};
|
44759
44783
|
var handleCreateStudy = React.useCallback(function (name, jobArgs, description, localConfig) {
|
@@ -46915,7 +46939,7 @@ var JobTabs;
|
|
46915
46939
|
JobTabs["workspace"] = "workspace";
|
46916
46940
|
})(JobTabs || (JobTabs = {}));
|
46917
46941
|
|
46918
|
-
var css_248z$6 = ":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 runworkspacedebug 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 runworkspacedebug runworkspacedebug\" \"studyrun studyrun studyrun studyrun studyrun studyrun\" \"date date date date date date\" \"author author author recipe recipe recipe\" \"status status status status status status\" \"time time time cpu 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 32px 32px 32px 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}\n.blink-effect {\n animation: blinker 5s linear infinite;\n}\n\n@keyframes blinker {\n 50% {\n border: 0.1rem solid white;\n }\n}";
|
46942
|
+
var css_248z$6 = ":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 cursor: pointer;\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 runworkspacedebug 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 runworkspacedebug runworkspacedebug\" \"studyrun studyrun studyrun studyrun studyrun studyrun\" \"date date date date date date\" \"author author author recipe recipe recipe\" \"status status status status status status\" \"time time time cpu 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 32px 32px 32px 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}\n.blink-effect {\n animation: blinker 5s linear infinite;\n}\n\n@keyframes blinker {\n 50% {\n border: 0.1rem solid white;\n }\n}";
|
46919
46943
|
styleInject(css_248z$6);
|
46920
46944
|
|
46921
46945
|
var IconContext = /*#__PURE__*/React.createContext({});
|
@@ -48722,25 +48746,26 @@ var formatDuration = function (duration) {
|
|
48722
48746
|
};
|
48723
48747
|
var RunCard = function (_a) {
|
48724
48748
|
var _b;
|
48725
|
-
var _c, _d, _e, _f;
|
48726
|
-
var projectName = _a.projectName, projectOwner = _a.projectOwner, _run = _a.run, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, getTab = _a.getTab, defaultTab = _a.defaultTab, getValue = _a.getValue,
|
48749
|
+
var _c, _d, _e, _f, _g, _h, _j, _k;
|
48750
|
+
var projectName = _a.projectName, projectOwner = _a.projectOwner, _run = _a.run, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, getTab = _a.getTab, defaultTab = _a.defaultTab, getValue = _a.getValue, _l = _a.interval, interval = _l === void 0 ? 5000 : _l, _m = _a.canWrite, canWrite = _m === void 0 ? false : _m, _o = _a.localRun, localRun = _o === void 0 ? false : _o;
|
48751
|
+
var _p = usePollinationPanel(), fetchLocalRun = _p.fetchLocalRun, fetchLocalJob = _p.fetchLocalJob;
|
48727
48752
|
/*
|
48728
48753
|
* Fetch run
|
48729
48754
|
*/
|
48730
48755
|
var fetchJob = useJobs(client).fetchJob;
|
48731
|
-
var
|
48732
|
-
var
|
48733
|
-
var
|
48734
|
-
var
|
48735
|
-
var
|
48736
|
-
var
|
48756
|
+
var _q = useRuns(client), fetchRun = _q.fetchRun, statusMap = _q.statusMap, getDuration = _q.getDuration, cancelRun = _q.cancelRun;
|
48757
|
+
var _r = useWindowDimensions(), width = _r.width; _r.height;
|
48758
|
+
var _s = React.useState(false), seeDescription = _s[0], setSeeDescription = _s[1];
|
48759
|
+
var _t = React.useState(false), seeAction = _t[0], setSeeAction = _t[1];
|
48760
|
+
var _u = React.useState(false), stopRefresh = _u[0], setStopRefresh = _u[1];
|
48761
|
+
var _v = React.useState(false), isReady = _v[0], setIsReady = _v[1];
|
48737
48762
|
/*
|
48738
48763
|
* From run and stop when it is done
|
48739
48764
|
*/
|
48740
|
-
var
|
48765
|
+
var _w = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id]) : undefined, localRun ? fetchLocalRun : fetchRun, {
|
48741
48766
|
revalidateOnFocus: false,
|
48742
48767
|
refreshInterval: stopRefresh ? undefined : interval,
|
48743
|
-
fallbackData: _run,
|
48768
|
+
fallbackData: localRun ? undefined : _run,
|
48744
48769
|
errorRetryCount: 3,
|
48745
48770
|
onSuccess: function (run, key, config) {
|
48746
48771
|
sendRun(run);
|
@@ -48748,7 +48773,7 @@ var RunCard = function (_a) {
|
|
48748
48773
|
setStopRefresh(true);
|
48749
48774
|
setIsReady(true);
|
48750
48775
|
},
|
48751
|
-
}), run =
|
48776
|
+
}), run = _w.data, error = _w.error; _w.isValidating;
|
48752
48777
|
var sendRun = React.useCallback(function (run) { return getValue(run); }, [run]);
|
48753
48778
|
/**
|
48754
48779
|
* Fetch job just one time
|
@@ -48756,11 +48781,17 @@ var RunCard = function (_a) {
|
|
48756
48781
|
React.useEffect(function () {
|
48757
48782
|
if (!_run)
|
48758
48783
|
return;
|
48759
|
-
|
48760
|
-
|
48761
|
-
|
48762
|
-
}
|
48763
|
-
|
48784
|
+
if (localRun) {
|
48785
|
+
var jobInfo = fetchLocalJob(_run.id);
|
48786
|
+
setLocalStudy(jobInfo);
|
48787
|
+
}
|
48788
|
+
else {
|
48789
|
+
fetchJob(projectOwner, projectName, run.status.job_id)
|
48790
|
+
.then(function (d) {
|
48791
|
+
setStudy(d);
|
48792
|
+
})
|
48793
|
+
.catch(function () { setStudy(undefined); });
|
48794
|
+
}
|
48764
48795
|
}, [_run]);
|
48765
48796
|
/**
|
48766
48797
|
* Refresh status
|
@@ -48770,8 +48801,9 @@ var RunCard = function (_a) {
|
|
48770
48801
|
return undefined;
|
48771
48802
|
return run.status.status;
|
48772
48803
|
}, [run]);
|
48773
|
-
var
|
48774
|
-
var
|
48804
|
+
var _x = React.useState(), study = _x[0], setStudy = _x[1];
|
48805
|
+
var _y = React.useState(), localStudy = _y[0], setLocalStudy = _y[1];
|
48806
|
+
var _z = React.useState(getDuration(run)), duration = _z[0], setDuration = _z[1];
|
48775
48807
|
React.useEffect(function () {
|
48776
48808
|
if (!run)
|
48777
48809
|
return undefined;
|
@@ -48802,7 +48834,7 @@ var RunCard = function (_a) {
|
|
48802
48834
|
info: false,
|
48803
48835
|
settings: false,
|
48804
48836
|
};
|
48805
|
-
var
|
48837
|
+
var _0 = React.useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _0[0], setHover = _0[1];
|
48806
48838
|
var toggleHover = React.useCallback(function (id, value) {
|
48807
48839
|
if (value === void 0) { value = false; }
|
48808
48840
|
setHover(function (prevHover) {
|
@@ -48817,21 +48849,39 @@ var RunCard = function (_a) {
|
|
48817
48849
|
var _a;
|
48818
48850
|
setHover(__assign(__assign({}, initialValues), (_a = {}, _a[defaultTab] = true, _a)));
|
48819
48851
|
}, [defaultTab]);
|
48852
|
+
if (error)
|
48853
|
+
return React__default["default"].createElement("div", { style: { textAlign: 'center' } }, "ERROR");
|
48820
48854
|
return (React__default["default"].createElement("div", { className: enableClick ? "grid-container ".concat(isReady && !run.status.finished_at && 'blink-effect')
|
48821
48855
|
: "grid-container disable-click ".concat(isReady && !run.status.finished_at && 'blink-effect'), tabIndex: 0, role: 'button', style: __assign({ borderColor: (_d = (_c = statusMap[status]) === null || _c === void 0 ? void 0 : _c.color) !== null && _d !== void 0 ? _d : '#d0d7de' }, style), onClick: function () {
|
48822
|
-
if (
|
48856
|
+
if (!enableClick)
|
48857
|
+
return;
|
48858
|
+
if (!localRun) {
|
48823
48859
|
window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id);
|
48824
48860
|
}
|
48825
48861
|
} },
|
48826
48862
|
React__default["default"].createElement("div", { className: 'item1' },
|
48827
|
-
React__default["default"].createElement("
|
48828
|
-
|
48863
|
+
React__default["default"].createElement("button", { className: 'link', style: { all: 'unset', cursor: 'pointer', marginRight: '0.75rem' }, title: 'Go to account page', onMouseOver: function (e) { return toggleHover('account', true); }, onMouseLeave: function (e) { return toggleHover('account', false); }, onClick: function (e) {
|
48864
|
+
e.stopPropagation();
|
48865
|
+
if (!localRun) {
|
48866
|
+
if (!run)
|
48867
|
+
return;
|
48868
|
+
window.location.href = "/".concat(run.owner.name);
|
48869
|
+
}
|
48870
|
+
} },
|
48871
|
+
React__default["default"].createElement(Avatar, { src: run ? (_e = run.owner) === null || _e === void 0 ? void 0 : _e.picture_url : '', size: 32, color: hover.account ? '#40a9ff' : undefined })),
|
48829
48872
|
React__default["default"].createElement("span", { style: { marginRight: '0.75rem' } }, "/"),
|
48830
|
-
React__default["default"].createElement("
|
48873
|
+
React__default["default"].createElement("button", { className: 'link', title: 'Go to project page', onMouseOver: function (e) { return toggleHover('project', true); }, onMouseLeave: function (e) { return toggleHover('project', false); }, onClick: function (e) {
|
48874
|
+
e.stopPropagation();
|
48875
|
+
if (!localRun) {
|
48876
|
+
if (!projectOwner)
|
48877
|
+
return;
|
48878
|
+
window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName);
|
48879
|
+
}
|
48880
|
+
}, style: hover.project ? { all: 'unset', cursor: 'pointer', color: '#40a9ff' } : { all: 'unset', cursor: 'pointer' } }, projectName !== null && projectName !== void 0 ? projectName : '--')),
|
48831
48881
|
React__default["default"].createElement("div", { className: 'item2' },
|
48832
48882
|
React__default["default"].createElement("div", null,
|
48833
|
-
(!isReady || !study) && React__default["default"].createElement(LoadingOutlined$1, { style: { margin: '0 10px 0 0' } }),
|
48834
|
-
|
48883
|
+
!localRun && (!isReady || !study) && React__default["default"].createElement(LoadingOutlined$1, { style: { margin: '0 10px 0 0' } }),
|
48884
|
+
run &&
|
48835
48885
|
React__default["default"].createElement(React__default["default"].Fragment, null,
|
48836
48886
|
React__default["default"].createElement("span", { title: 'Go to run page' },
|
48837
48887
|
React__default["default"].createElement(InfoCircleOutlined$1, { onClick: function (e) {
|
@@ -48892,40 +48942,65 @@ var RunCard = function (_a) {
|
|
48892
48942
|
} }))))),
|
48893
48943
|
React__default["default"].createElement("div", { className: 'item3' },
|
48894
48944
|
React__default["default"].createElement("div", null,
|
48895
|
-
React__default["default"].createElement("
|
48896
|
-
|
48945
|
+
React__default["default"].createElement("button", { className: 'link', title: 'Go to study page', onMouseOver: function (e) { return toggleHover('study', true); }, onMouseLeave: function (e) { return toggleHover('study', false); }, onClick: function (e) {
|
48946
|
+
e.stopPropagation();
|
48947
|
+
if (!localRun) {
|
48948
|
+
if (!projectName || !study)
|
48949
|
+
return;
|
48950
|
+
window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id);
|
48951
|
+
}
|
48952
|
+
}, style: { all: 'unset', cursor: 'pointer', color: "".concat(hover.study
|
48953
|
+
? '#40a9ff' : '#000') } },
|
48954
|
+
!localRun && study ? (_f = study.spec.name) !== null && _f !== void 0 ? _f : "Study: ".concat(study.id) : '',
|
48955
|
+
localRun && localStudy && localStudy.name),
|
48897
48956
|
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 0 0 8px', cursor: 'pointer' }, onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
48898
48957
|
e.stopPropagation();
|
48899
48958
|
setSeeDescription(function (prev) { return !prev; });
|
48900
48959
|
setSeeAction(false);
|
48901
48960
|
} },
|
48902
48961
|
React__default["default"].createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })))),
|
48903
|
-
React__default["default"].createElement("div", { className: 'item4', title:
|
48962
|
+
React__default["default"].createElement("div", { className: 'item4', title: run && dayjs_min(run.status.started_at).format('[on] MMM DD YYYY [at] hh:mm') }, run ? dayjs_min(run.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
48904
48963
|
React__default["default"].createElement("div", { className: 'item5' },
|
48905
48964
|
React__default["default"].createElement("span", { style: { marginRight: '0.75rem' } },
|
48906
|
-
React__default["default"].createElement(Avatar, { color: hover.author ? '#40a9ff' : undefined, src:
|
48907
|
-
React__default["default"].createElement("a", { className: 'link',
|
48965
|
+
React__default["default"].createElement(Avatar, { color: hover.author ? '#40a9ff' : undefined, src: run ? (_g = run.author) === null || _g === void 0 ? void 0 : _g.picture_url : '', size: 24 })),
|
48966
|
+
React__default["default"].createElement("a", { className: 'link', onClick: function (e) {
|
48967
|
+
e.stopPropagation();
|
48968
|
+
if (!localRun) {
|
48969
|
+
if (!run)
|
48970
|
+
return;
|
48971
|
+
window.location.href = "/".concat(run.author.name);
|
48972
|
+
}
|
48973
|
+
}, title: 'Go to author page', target: '_blank', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover('author', true); }, onMouseLeave: function (e) { return toggleHover('author', false); }, style: hover.author ? { color: '#40a9ff' } : {} }, run ? ((_j = (_h = run.author) === null || _h === void 0 ? void 0 : _h.display_name) !== null && _j !== void 0 ? _j : (_k = run.author) === null || _k === void 0 ? void 0 : _k.name) : '--')),
|
48908
48974
|
React__default["default"].createElement("div", { className: 'item6' },
|
48909
48975
|
React__default["default"].createElement("span", { style: { marginRight: '0.75rem' } },
|
48910
|
-
React__default["default"].createElement(Avatar, { color: hover.recipe ? '#40a9ff' : undefined, src:
|
48911
|
-
React__default["default"].createElement("a", { className: 'link',
|
48912
|
-
|
48976
|
+
React__default["default"].createElement(Avatar, { color: hover.recipe ? '#40a9ff' : undefined, src: run ? run.recipe.metadata.icon : '', size: 24 })),
|
48977
|
+
React__default["default"].createElement("a", { className: 'link', onClick: function (e) {
|
48978
|
+
e.stopPropagation();
|
48979
|
+
if (!localRun) {
|
48980
|
+
if (!run)
|
48981
|
+
return;
|
48982
|
+
window.location.href = recipeLinkFromSource(run.recipe.source);
|
48983
|
+
}
|
48984
|
+
}, title: 'Go to recipe page', target: '_blank', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover('recipe', true); }, onMouseLeave: function (e) { return toggleHover('recipe', false); }, style: hover.recipe ? { color: '#40a9ff' } : {} }, run ? run.recipe.metadata.name : '--'),
|
48985
|
+
run && React__default["default"].createElement("span", { className: 'light-text' },
|
48913
48986
|
" ",
|
48914
|
-
|
48987
|
+
run.recipe.metadata.tag)),
|
48915
48988
|
React__default["default"].createElement("div", { className: 'item8' },
|
48916
|
-
React__default["default"].createElement("span", { className: 'status-label', style: { marginRight: '0.75rem' } },
|
48989
|
+
React__default["default"].createElement("span", { className: 'status-label', style: { marginRight: '0.75rem' } }, run ? status : '--'),
|
48917
48990
|
React__default["default"].createElement("span", { className: 'light-text' },
|
48918
48991
|
!isReady && React__default["default"].createElement(LoadingOutlined$1, null),
|
48919
48992
|
study && run && width > 600 &&
|
48920
48993
|
"".concat(run.meta.progress.completed, " / ").concat(run.meta.progress.total, " steps"))),
|
48921
48994
|
React__default["default"].createElement("div", { className: 'item9', title: 'CPU usage' },
|
48922
48995
|
React__default["default"].createElement(Cpu$1, { size: 18, style: { marginRight: '0.15rem' } }),
|
48923
|
-
React__default["default"].createElement("span", { className: 'light-text' },
|
48996
|
+
React__default["default"].createElement("span", { className: 'light-text' }, run ? "".concat(formatDuration(dayjs_min.duration(run.meta.resources_duration.cpu, 'seconds'))) : '--')),
|
48924
48997
|
React__default["default"].createElement("div", { className: 'item10', title: 'Duration of the simulation' },
|
48925
48998
|
React__default["default"].createElement(Clock$1, { size: 18, style: { marginRight: '0.15rem' } }),
|
48926
|
-
React__default["default"].createElement("span", { className: 'light-text' },
|
48999
|
+
React__default["default"].createElement("span", { className: 'light-text' }, run ? "".concat(formatDuration(duration)) : '--')),
|
48927
49000
|
seeDescription && React__default["default"].createElement(React__default["default"].Fragment, null,
|
48928
|
-
React__default["default"].createElement("div", { className: 'item7' },
|
49001
|
+
React__default["default"].createElement("div", { className: 'item7' },
|
49002
|
+
!localRun && study && study.spec.description,
|
49003
|
+
localRun && localStudy && localStudy.description)),
|
48929
49004
|
seeAction && width && React__default["default"].createElement(React__default["default"].Fragment, null,
|
48930
49005
|
React__default["default"].createElement("div", { className: 'item7' },
|
48931
49006
|
React__default["default"].createElement(Button, { style: (width > 600) ? { display: 'inline' } : { display: 'inline', float: 'left' }, disabled: !run || (run.status.status === dist$1.RunStatusEnum.Failed ||
|
@@ -48935,9 +49010,11 @@ var RunCard = function (_a) {
|
|
48935
49010
|
e.stopPropagation();
|
48936
49011
|
if (!run)
|
48937
49012
|
return;
|
48938
|
-
|
48939
|
-
|
48940
|
-
|
49013
|
+
if (!localRun) {
|
49014
|
+
cancelRun(projectOwner, projectName, run.id)
|
49015
|
+
.then(function (d) { return console.log(d); })
|
49016
|
+
.catch(function (e) { return console.log(e); });
|
49017
|
+
}
|
48941
49018
|
} },
|
48942
49019
|
React__default["default"].createElement(XOctagon$1, { style: { display: 'inline', margin: '0 5px 0 0' } }),
|
48943
49020
|
" Cancel")))));
|
@@ -50432,6 +50509,7 @@ exports.useGetHbjson = useGetHbjson;
|
|
50432
50509
|
exports.useHbjsontoVTK = useHbjsontoVTK;
|
50433
50510
|
exports.useJobs = useJobs;
|
50434
50511
|
exports.useManageSettings = useManageSettings;
|
50512
|
+
exports.usePollinationPanel = usePollinationPanel;
|
50435
50513
|
exports.useRunCommand = useRunCommand;
|
50436
50514
|
exports.useRuns = useRuns;
|
50437
50515
|
exports.useSendHbjson = useSendHbjson;
|