pollination-react-io 1.61.0 → 1.62.1

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.
@@ -11,4 +11,5 @@ export declare const usePollinationPanel: () => {
11
11
  fetchLocalLog: (path?: any) => any;
12
12
  fileExplorer: (root: string) => PanelMessageOut;
13
13
  getPaginatedJob: (projectSlug: string, pageSize: number, curPage: number) => ProjectJobInfo[];
14
+ getJob: (projectSlug: string) => ProjectJobInfo[];
14
15
  };
@@ -38102,6 +38102,24 @@ var usePollinationPanel = function () {
38102
38102
  return undefined;
38103
38103
  }
38104
38104
  };
38105
+ /**
38106
+ * Get array of ProjectJobInfo from DB
38107
+ * @param projectSlug Project slug
38108
+ * @returns Array of ProjectJobInfo
38109
+ */
38110
+ var getJob = function (projectSlug) {
38111
+ if (!panel)
38112
+ return;
38113
+ try {
38114
+ var message = panel.GetJob(projectSlug);
38115
+ var arr = JSON.parse(message.data);
38116
+ return arr;
38117
+ }
38118
+ catch (error) {
38119
+ // Do nothing. It is written at the end
38120
+ return undefined;
38121
+ }
38122
+ };
38105
38123
  return {
38106
38124
  getFileBase64: getFileBase64,
38107
38125
  saveFileBase64: saveFileBase64,
@@ -38111,7 +38129,8 @@ var usePollinationPanel = function () {
38111
38129
  fetchLocalJob: fetchLocalJob,
38112
38130
  fetchLocalLog: fetchLocalLog,
38113
38131
  fileExplorer: fileExplorer,
38114
- getPaginatedJob: getPaginatedJob
38132
+ getPaginatedJob: getPaginatedJob,
38133
+ getJob: getJob
38115
38134
  };
38116
38135
  };
38117
38136
 
@@ -48900,10 +48919,17 @@ var RunCard = function (_a) {
48900
48919
  var _a;
48901
48920
  setHover(__assign(__assign({}, initialValues), (_a = {}, _a[defaultTab] = true, _a)));
48902
48921
  }, [defaultTab]);
48922
+ var localStudyURLname = useMemo(function () {
48923
+ if (!localStudy)
48924
+ return;
48925
+ return localStudy.name
48926
+ .replace(/[^a-zA-Z0-9]/g, '')
48927
+ .replace(/[ ()]/g, '');
48928
+ }, [localStudy]);
48903
48929
  /**
48904
48930
  * Rendering - if error
48905
48931
  */
48906
- if (error)
48932
+ if (error || !run)
48907
48933
  return loaderNode !== null && loaderNode !== void 0 ? loaderNode : React__default.createElement(Logo, null);
48908
48934
  /**
48909
48935
  * Rendering - if CAD by web
@@ -48927,6 +48953,9 @@ var RunCard = function (_a) {
48927
48953
  if (!localRun) {
48928
48954
  window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id);
48929
48955
  }
48956
+ else {
48957
+ window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/localStudies/").concat(localStudyURLname, "/?path=").concat(_run.id);
48958
+ }
48930
48959
  } },
48931
48960
  React__default.createElement("div", { className: 'item1' },
48932
48961
  React__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) {
@@ -48944,7 +48973,10 @@ var RunCard = function (_a) {
48944
48973
  if (!localRun) {
48945
48974
  if (!projectOwner)
48946
48975
  return;
48947
- window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName);
48976
+ window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/tab=studies");
48977
+ }
48978
+ else {
48979
+ window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/?tab=local+studies");
48948
48980
  }
48949
48981
  }, style: hover.project ? { all: 'unset', cursor: 'pointer', color: '#40a9ff' } : { all: 'unset', cursor: 'pointer' } }, projectName !== null && projectName !== void 0 ? projectName : '--')),
48950
48982
  React__default.createElement("div", { className: 'item2' },
@@ -48993,10 +49025,7 @@ var RunCard = function (_a) {
48993
49025
  getTab(RunTabs.debug);
48994
49026
  if (localRun) {
48995
49027
  // Get study name
48996
- var cleanName = localStudy.name
48997
- .replace(/[^a-zA-Z0-9]/g, '')
48998
- .replace(/[ ()]/g, '');
48999
- var path = "".concat(_run.id, "/").concat(cleanName, "/__logs__/logs.log");
49028
+ var path = "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/logs.log");
49000
49029
  fileExplorer(path);
49001
49030
  }
49002
49031
  else {