pollination-react-io 1.67.1 → 1.67.2

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.
@@ -20,6 +20,7 @@ export interface ProjectJobInfo {
20
20
  jobName?: string;
21
21
  jobDescription?: string;
22
22
  platform?: string;
23
+ subfolder?: string;
23
24
  }
24
25
  export interface LocalConfig {
25
26
  localCPUCount: number;
@@ -6,12 +6,12 @@ export declare const usePollinationPanel: () => {
6
6
  saveFileBase64: (key: string, file: File | Blob, subFolder: string, fileName: string) => Promise<PanelMessageOut>;
7
7
  fromFileToBase64: (filePath: string) => PanelMessageOut;
8
8
  getFilesFromDir: (root: any) => PanelMessageOut;
9
- fetchLocalRun: (path?: any) => Run;
10
- fetchLocalJob: (path?: any) => Job;
11
- fetchLocalLog: (path?: any) => any;
9
+ fetchLocalRun: (path?: any, subfolder?: any) => Run;
10
+ fetchLocalJob: (path?: any, subfolder?: any) => Job;
11
+ fetchLocalLog: (path?: any, subfolder?: any) => any;
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
+ deleteJob: (projectSlug: string, path: string, subfolder: string) => any;
16
16
  getPlatforms: (projectSlug: string) => {};
17
17
  };
@@ -38072,12 +38072,13 @@ var usePollinationPanel = function () {
38072
38072
  /**
38073
38073
  * Fetch local run
38074
38074
  */
38075
- var fetchLocalRun = useCallback(function (path) {
38075
+ var fetchLocalRun = useCallback(function (path, subfolder) {
38076
38076
  if (path === void 0) { path = ''; }
38077
+ if (subfolder === void 0) { subfolder = undefined; }
38077
38078
  if (!panel)
38078
38079
  return;
38079
38080
  try {
38080
- var message = panel.FetchSimulationFile(path, SimulationFileType[SimulationFileType.status]);
38081
+ var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.status]);
38081
38082
  var run = JSON.parse(message.data);
38082
38083
  return run;
38083
38084
  }
@@ -38088,13 +38089,14 @@ var usePollinationPanel = function () {
38088
38089
  /**
38089
38090
  * Fetch local job
38090
38091
  */
38091
- var fetchLocalJob = useCallback(function (path) {
38092
+ var fetchLocalJob = useCallback(function (path, subfolder) {
38092
38093
  var _a;
38093
38094
  if (path === void 0) { path = ''; }
38095
+ if (subfolder === void 0) { subfolder = undefined; }
38094
38096
  if (!panel)
38095
38097
  return;
38096
38098
  try {
38097
- var message = panel.FetchSimulationFile(path, SimulationFileType[SimulationFileType.job]);
38099
+ var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.job]);
38098
38100
  var localJob = JSON.parse(message.data);
38099
38101
  var job = (_a = localJob === null || localJob === void 0 ? void 0 : localJob.LocalJob) === null || _a === void 0 ? void 0 : _a.Job;
38100
38102
  return job;
@@ -38107,12 +38109,13 @@ var usePollinationPanel = function () {
38107
38109
  /**
38108
38110
  * Fetch local log
38109
38111
  */
38110
- var fetchLocalLog = useCallback(function (path) {
38112
+ var fetchLocalLog = useCallback(function (path, subfolder) {
38111
38113
  if (path === void 0) { path = ''; }
38114
+ if (subfolder === void 0) { subfolder = undefined; }
38112
38115
  if (!panel)
38113
38116
  return;
38114
38117
  try {
38115
- var message = panel.FetchSimulationFile(path, SimulationFileType[SimulationFileType.logs]);
38118
+ var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.logs]);
38116
38119
  return message.data;
38117
38120
  }
38118
38121
  catch (error) {
@@ -38182,13 +38185,14 @@ var usePollinationPanel = function () {
38182
38185
  * Delete job with the same input/ouput folder from DB
38183
38186
  * @param projectSlug Project slug
38184
38187
  * @param path Location where files are
38188
+ * @param subfolder Subfolder
38185
38189
  * @returns Message with number of deleted records
38186
38190
  */
38187
- var deleteJob = function (projectSlug, path) {
38191
+ var deleteJob = function (projectSlug, path, subfolder) {
38188
38192
  if (!panel)
38189
38193
  return;
38190
38194
  try {
38191
- var message = panel.DeleteJob(projectSlug, path);
38195
+ var message = panel.DeleteJob(projectSlug, path, subfolder);
38192
38196
  var count = JSON.parse(message.data);
38193
38197
  return count;
38194
38198
  }
@@ -49019,14 +49023,14 @@ var RunCard = function (_a) {
49019
49023
  /*
49020
49024
  * From run and stop when it is done
49021
49025
  */
49022
- var _4 = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id]) : undefined, localRun ? fetchLocalRun : fetchRun, {
49026
+ var _4 = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id, _run['subfolder']]) : undefined, localRun ? fetchLocalRun : fetchRun, {
49023
49027
  revalidateOnFocus: false,
49024
49028
  refreshInterval: stopRefresh ? undefined : interval,
49025
49029
  fallbackData: localRun ? undefined : _run,
49026
49030
  errorRetryCount: 3,
49027
49031
  onSuccess: function (run, key, config) {
49028
49032
  if (localRun) {
49029
- var jobInfo = fetchLocalJob(_run.id);
49033
+ var jobInfo = fetchLocalJob(_run.id, _run['subfolder']);
49030
49034
  setLocalStudy(jobInfo);
49031
49035
  } // It is written at the end of the simulation
49032
49036
  sendRun(run);
@@ -49141,7 +49145,7 @@ var RunCard = function (_a) {
49141
49145
  window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id);
49142
49146
  }
49143
49147
  else {
49144
- window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/localStudies/").concat(localStudyURLname, "/?path=").concat(_run.id);
49148
+ window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/localStudies/").concat(localStudyURLname, "/?path=").concat(_run.id, "&subfolder=").concat(_run['subfolder']);
49145
49149
  }
49146
49150
  } },
49147
49151
  React__default.createElement("div", { className: 'item1' },
@@ -49212,7 +49216,9 @@ var RunCard = function (_a) {
49212
49216
  getTab(RunTabs.debug);
49213
49217
  if (localRun) {
49214
49218
  // Get study name
49215
- var path = "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/logs.log");
49219
+ var path = !_run['subfolder']
49220
+ ? "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/logs.log")
49221
+ : "".concat(_run.id, "/").concat(_run['subfolder'], "/").concat(localStudyURLname, "/__logs__/logs.log");
49216
49222
  fileExplorer(path);
49217
49223
  }
49218
49224
  else {
@@ -49319,9 +49325,9 @@ var RunCard = function (_a) {
49319
49325
  e.stopPropagation();
49320
49326
  if (!run)
49321
49327
  return;
49322
- var count = deleteJob("".concat(projectOwner, "/").concat(projectName), _run.id);
49328
+ var count = deleteJob("".concat(projectOwner, "/").concat(projectName), _run.id, _run['subfolder']);
49323
49329
  if (count > 0) {
49324
- if (window.location.href.includes("?path=".concat(_run.id))) {
49330
+ if (window.location.href.includes("?path=")) {
49325
49331
  window.history.back();
49326
49332
  }
49327
49333
  else {