pollination-react-io 1.62.5 → 1.63.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/hooks/usePollinationPanel.d.ts +1 -0
- package/build/index.esm.js +46 -11
- package/build/index.esm.js.map +1 -1
- package/build/index.js +46 -11
- package/build/index.js.map +1 -1
- package/package.json +1 -1
@@ -12,4 +12,5 @@ export declare const usePollinationPanel: () => {
|
|
12
12
|
fileExplorer: (root: string) => PanelMessageOut;
|
13
13
|
getPaginatedJob: (projectSlug: string, pageSize: number, curPage: number) => ProjectJobInfo[];
|
14
14
|
getJob: (projectSlug: string) => ProjectJobInfo[];
|
15
|
+
deleteJob: (projectSlug: string, path: string) => any;
|
15
16
|
};
|
package/build/index.esm.js
CHANGED
@@ -38120,6 +38120,25 @@ var usePollinationPanel = function () {
|
|
38120
38120
|
return undefined;
|
38121
38121
|
}
|
38122
38122
|
};
|
38123
|
+
/**
|
38124
|
+
* Delete job with the same input/ouput folder from DB
|
38125
|
+
* @param projectSlug Project slug
|
38126
|
+
* @param path Location where files are
|
38127
|
+
* @returns Message with number of deleted records
|
38128
|
+
*/
|
38129
|
+
var deleteJob = function (projectSlug, path) {
|
38130
|
+
if (!panel)
|
38131
|
+
return;
|
38132
|
+
try {
|
38133
|
+
var message = panel.DeleteJob(projectSlug, path);
|
38134
|
+
var count = JSON.parse(message.data);
|
38135
|
+
return count;
|
38136
|
+
}
|
38137
|
+
catch (error) {
|
38138
|
+
// Do nothing. It is written at the end
|
38139
|
+
return undefined;
|
38140
|
+
}
|
38141
|
+
};
|
38123
38142
|
return {
|
38124
38143
|
getFileBase64: getFileBase64,
|
38125
38144
|
saveFileBase64: saveFileBase64,
|
@@ -38130,7 +38149,8 @@ var usePollinationPanel = function () {
|
|
38130
38149
|
fetchLocalLog: fetchLocalLog,
|
38131
38150
|
fileExplorer: fileExplorer,
|
38132
38151
|
getPaginatedJob: getPaginatedJob,
|
38133
|
-
getJob: getJob
|
38152
|
+
getJob: getJob,
|
38153
|
+
deleteJob: deleteJob
|
38134
38154
|
};
|
38135
38155
|
};
|
38136
38156
|
|
@@ -48813,7 +48833,7 @@ var RunCard = function (_a) {
|
|
48813
48833
|
var _b;
|
48814
48834
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
48815
48835
|
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, _o = _a.interval, interval = _o === void 0 ? 5000 : _o, _p = _a.canWrite, canWrite = _p === void 0 ? false : _p, _q = _a.localRun, localRun = _q === void 0 ? false : _q, _r = _a.loaderNode, loaderNode = _r === void 0 ? undefined : _r;
|
48816
|
-
var _s = usePollinationPanel(), fetchLocalRun = _s.fetchLocalRun, fetchLocalJob = _s.fetchLocalJob, fileExplorer = _s.fileExplorer;
|
48836
|
+
var _s = usePollinationPanel(), fetchLocalRun = _s.fetchLocalRun, fetchLocalJob = _s.fetchLocalJob, fileExplorer = _s.fileExplorer, deleteJob = _s.deleteJob;
|
48817
48837
|
var disabled = useMemo(function () {
|
48818
48838
|
if (!localRun)
|
48819
48839
|
return;
|
@@ -49115,21 +49135,30 @@ var RunCard = function (_a) {
|
|
49115
49135
|
localRun && localStudy && localStudy.description)),
|
49116
49136
|
seeAction && width && React__default.createElement(React__default.Fragment, null,
|
49117
49137
|
React__default.createElement("div", { className: 'item7' },
|
49118
|
-
React__default.createElement(Button, { style: (width > 600) ? { display: 'inline' } : { display: 'inline', float: 'left' }, disabled: !run || (run.status.status === dist$1.RunStatusEnum.Failed ||
|
49138
|
+
!localRun && React__default.createElement(Button, { style: (width > 600) ? { display: 'inline' } : { display: 'inline', float: 'left' }, disabled: !run || (run.status.status === dist$1.RunStatusEnum.Failed ||
|
49119
49139
|
run.status.status === dist$1.RunStatusEnum.Succeeded ||
|
49120
49140
|
run.status.status === dist$1.RunStatusEnum.Cancelled ||
|
49121
49141
|
run.status.status === dist$1.RunStatusEnum.Unknown), onClick: function (e) {
|
49122
49142
|
e.stopPropagation();
|
49123
49143
|
if (!run)
|
49124
49144
|
return;
|
49125
|
-
|
49126
|
-
|
49127
|
-
|
49128
|
-
.catch(function (e) { return console.log(e); });
|
49129
|
-
}
|
49145
|
+
cancelRun(projectOwner, projectName, run.id)
|
49146
|
+
.then(function (d) { return console.log(d); })
|
49147
|
+
.catch(function (e) { return console.log(e); });
|
49130
49148
|
} },
|
49131
49149
|
React__default.createElement(XOctagon$1, { style: { display: 'inline', margin: '0 5px 0 0' } }),
|
49132
|
-
" Cancel")
|
49150
|
+
" Cancel"),
|
49151
|
+
localRun && React__default.createElement(Button, { style: (width > 600) ? { display: 'inline' } : { display: 'inline', float: 'left' }, disabled: !run || !run.status.finished_at, onClick: function (e) {
|
49152
|
+
e.stopPropagation();
|
49153
|
+
if (!run)
|
49154
|
+
return;
|
49155
|
+
var count = deleteJob("".concat(projectOwner, "/").concat(projectName), _run.id);
|
49156
|
+
if (count > 0) {
|
49157
|
+
window.history.go(-1);
|
49158
|
+
}
|
49159
|
+
} },
|
49160
|
+
React__default.createElement(Trash$1, { style: { display: 'inline', margin: '0 5px 0 0' } }),
|
49161
|
+
" Delete")))));
|
49133
49162
|
};
|
49134
49163
|
|
49135
49164
|
var css_248z$5 = "";
|
@@ -49522,15 +49551,21 @@ var FileCard = function (_a) {
|
|
49522
49551
|
return path.split('/').reverse()[0];
|
49523
49552
|
}, [path]);
|
49524
49553
|
/**
|
49525
|
-
* Read local file as
|
49554
|
+
* Read local file as base64 - Panel only
|
49526
49555
|
*/
|
49527
49556
|
var base64AndFetch = function (path) {
|
49528
49557
|
if (!path)
|
49529
49558
|
return;
|
49530
49559
|
var data = fromFileToBase64(path);
|
49531
49560
|
var base64Data = data === null || data === void 0 ? void 0 : data.data;
|
49532
|
-
if (!base64Data)
|
49561
|
+
if (!base64Data) {
|
49562
|
+
// Not found...
|
49563
|
+
setIsInactive(true);
|
49564
|
+
setCurrFile(undefined);
|
49565
|
+
setCADintegration(undefined);
|
49566
|
+
setIsLoading(false);
|
49533
49567
|
return;
|
49568
|
+
}
|
49534
49569
|
// bas64 mapping
|
49535
49570
|
var t;
|
49536
49571
|
switch (extension) {
|