@elaraai/e3-ui-components 0.0.1-beta.2 → 0.0.1-beta.4
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/dist/components/InputPreview.d.ts +3 -1
- package/dist/components/InputPreview.d.ts.map +1 -1
- package/dist/components/TaskPreview.d.ts +3 -1
- package/dist/components/TaskPreview.d.ts.map +1 -1
- package/dist/hooks/useInputData.d.ts +2 -2
- package/dist/hooks/useInputData.d.ts.map +1 -1
- package/dist/hooks/useTaskLogsHook.d.ts +2 -2
- package/dist/hooks/useTaskLogsHook.d.ts.map +1 -1
- package/dist/hooks/useTaskOutput.d.ts +2 -2
- package/dist/hooks/useTaskOutput.d.ts.map +1 -1
- package/dist/hooks/workspaces.d.ts +2 -8
- package/dist/hooks/workspaces.d.ts.map +1 -1
- package/dist/index.cjs +23 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -19
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { DatasetStatusInfo } from '@elaraai/e3-api-client';
|
|
1
|
+
import { DatasetStatusInfo, RequestOptions } from '@elaraai/e3-api-client';
|
|
2
2
|
export interface InputPreviewProps {
|
|
3
3
|
apiUrl: string;
|
|
4
|
+
repo: string;
|
|
4
5
|
workspace: string;
|
|
5
6
|
path: string;
|
|
6
7
|
inputInfo: DatasetStatusInfo | null;
|
|
8
|
+
requestOptions?: RequestOptions;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Renders a preview of an input dataset value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPreview.d.ts","sourceRoot":"","sources":["../../src/components/InputPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"InputPreview.d.ts","sourceRoot":"","sources":["../../src/components/InputPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKhF,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,yDAgJvB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { TaskStatusInfo } from '@elaraai/e3-api-client';
|
|
1
|
+
import { TaskStatusInfo, RequestOptions } from '@elaraai/e3-api-client';
|
|
2
2
|
export interface TaskPreviewProps {
|
|
3
3
|
apiUrl: string;
|
|
4
|
+
repo: string;
|
|
4
5
|
workspace: string;
|
|
5
6
|
task: string;
|
|
6
7
|
taskInfo: TaskStatusInfo | null;
|
|
7
8
|
outputHash: string | null;
|
|
9
|
+
requestOptions?: RequestOptions;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Renders a preview of a task's output and logs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskPreview.d.ts","sourceRoot":"","sources":["../../src/components/TaskPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"TaskPreview.d.ts","sourceRoot":"","sources":["../../src/components/TaskPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAO7E,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,wDA+MuL,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DatasetStatusInfo } from '@elaraai/e3-api-client';
|
|
2
|
-
export declare function useInputData(apiUrl: string, workspace: string | null, inputInfo: DatasetStatusInfo | null): import('@tanstack/react-query').UseQueryResult<Uint8Array<ArrayBufferLike>, Error>;
|
|
1
|
+
import { DatasetStatusInfo, RequestOptions } from '@elaraai/e3-api-client';
|
|
2
|
+
export declare function useInputData(apiUrl: string, repo: string, workspace: string | null, inputInfo: DatasetStatusInfo | null, requestOptions?: RequestOptions): import('@tanstack/react-query').UseQueryResult<Uint8Array<ArrayBufferLike>, Error>;
|
|
3
3
|
//# sourceMappingURL=useInputData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInputData.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputData.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useInputData.d.ts","sourceRoot":"","sources":["../../src/hooks/useInputData.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGhF,wBAAgB,YAAY,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,SAAS,EAAE,iBAAiB,GAAG,IAAI,EACnC,cAAc,CAAC,EAAE,cAAc,sFAkBlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskStatusInfo } from '@elaraai/e3-api-client';
|
|
2
|
-
export declare function useTaskLogs(apiUrl: string, workspace: string | null, task: TaskStatusInfo | null, stream?: 'stdout' | 'stderr'): import('@tanstack/react-query').UseQueryResult<{
|
|
1
|
+
import { TaskStatusInfo, RequestOptions } from '@elaraai/e3-api-client';
|
|
2
|
+
export declare function useTaskLogs(apiUrl: string, repo: string, workspace: string | null, task: TaskStatusInfo | null, stream?: 'stdout' | 'stderr', requestOptions?: RequestOptions): import('@tanstack/react-query').UseQueryResult<{
|
|
3
3
|
data: string;
|
|
4
4
|
offset: bigint;
|
|
5
5
|
size: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTaskLogsHook.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskLogsHook.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useTaskLogsHook.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskLogsHook.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAwD7E,wBAAgB,WAAW,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,IAAI,EAAE,cAAc,GAAG,IAAI,EAC3B,MAAM,GAAE,QAAQ,GAAG,QAAmB,EACtC,cAAc,CAAC,EAAE,cAAc;UAjDhB,MAAM;YAAU,MAAM;UAAQ,MAAM;eAAa,MAAM;cAAY,OAAO;UA8D5F"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TaskStatusInfo } from '@elaraai/e3-api-client';
|
|
2
|
-
export declare function useTaskOutput(apiUrl: string, workspace: string | null, task: TaskStatusInfo | null, outputHash?: string | null): import('@tanstack/react-query').UseQueryResult<Uint8Array<ArrayBufferLike>, Error>;
|
|
1
|
+
import { TaskStatusInfo, RequestOptions } from '@elaraai/e3-api-client';
|
|
2
|
+
export declare function useTaskOutput(apiUrl: string, repo: string, workspace: string | null, task: TaskStatusInfo | null, outputHash?: string | null, requestOptions?: RequestOptions): import('@tanstack/react-query').UseQueryResult<Uint8Array<ArrayBufferLike>, Error>;
|
|
3
3
|
//# sourceMappingURL=useTaskOutput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTaskOutput.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskOutput.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"useTaskOutput.d.ts","sourceRoot":"","sources":["../../src/hooks/useTaskOutput.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7E,wBAAgB,aAAa,CACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,IAAI,EAAE,cAAc,GAAG,IAAI,EAC3B,UAAU,GAAE,MAAM,GAAG,IAAW,EAChC,cAAc,CAAC,EAAE,cAAc,sFAalC"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { QueryOverrides } from './types.js';
|
|
3
3
|
import { RequestOptions, WorkspaceInfo, WorkspaceStatusResult } from '@elaraai/e3-api-client';
|
|
4
|
+
import { WorkspaceState } from '@elaraai/e3-types';
|
|
4
5
|
export declare function useWorkspaceList(url: string, repo: string, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<WorkspaceInfo[], Error>;
|
|
5
6
|
export declare function useWorkspaceCreate(url: string, repo: string, requestOptions?: RequestOptions): UseMutationResult<WorkspaceInfo, Error, string>;
|
|
6
|
-
export declare function useWorkspaceGet(url: string, repo: string, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<
|
|
7
|
-
readonly packageName: string;
|
|
8
|
-
readonly packageVersion: string;
|
|
9
|
-
readonly packageHash: string;
|
|
10
|
-
readonly deployedAt: Date;
|
|
11
|
-
readonly rootHash: string;
|
|
12
|
-
readonly rootUpdatedAt: Date;
|
|
13
|
-
}, Error>;
|
|
7
|
+
export declare function useWorkspaceGet(url: string, repo: string, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<WorkspaceState, Error>;
|
|
14
8
|
export declare function useWorkspaceStatus(url: string, repo: string, name: string | null, requestOptions?: RequestOptions, queryOptions?: QueryOverrides): UseQueryResult<WorkspaceStatusResult, Error>;
|
|
15
9
|
export declare function useWorkspaceRemove(url: string, repo: string, requestOptions?: RequestOptions): UseMutationResult<void, Error, string, unknown>;
|
|
16
10
|
export declare function useWorkspaceDeploy(url: string, repo: string, requestOptions?: RequestOptions): UseMutationResult<void, Error, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/hooks/workspaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/hooks/workspaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,cAAc,GAAG,cAAc,CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,CAOlK;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,iBAAiB,CAAC,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,CAI9I;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,cAAc,GAAG,cAAc,CAAC,cAAc,EAAE,KAAK,CAAC,CAOrL;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,cAAc,GAAG,cAAc,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAO/L;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,mDAI5F;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc;UACjD,MAAM;gBAAc,MAAM;YAGrE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,cAAc,sDAOhJ"}
|
package/dist/index.cjs
CHANGED
|
@@ -234,16 +234,16 @@ function useTaskLogs$1(url, repo, workspace, task, logOptions, requestOptions, q
|
|
|
234
234
|
...queryOptions
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
function useInputData(apiUrl, workspace, inputInfo) {
|
|
237
|
+
function useInputData(apiUrl, repo, workspace, inputInfo, requestOptions) {
|
|
238
238
|
var _a;
|
|
239
239
|
const isUpToDate = (inputInfo == null ? void 0 : inputInfo.status.type) === "up-to-date";
|
|
240
240
|
const hash = ((_a = inputInfo == null ? void 0 : inputInfo.hash) == null ? void 0 : _a.type) === "some" ? inputInfo.hash.value : null;
|
|
241
241
|
return reactQuery.useQuery({
|
|
242
|
-
queryKey: ["inputData", apiUrl, workspace, inputInfo == null ? void 0 : inputInfo.path, hash],
|
|
242
|
+
queryKey: ["inputData", apiUrl, repo, workspace, inputInfo == null ? void 0 : inputInfo.path, hash],
|
|
243
243
|
queryFn: () => {
|
|
244
244
|
var _a2, _b, _c;
|
|
245
245
|
const pathParts = ((_c = (_b = (_a2 = inputInfo == null ? void 0 : inputInfo.path) == null ? void 0 : _a2.split(".")) == null ? void 0 : _b.filter(Boolean)) == null ? void 0 : _c.map((value) => east.variant("field", value))) ?? [];
|
|
246
|
-
return e3ApiClient.datasetGet(apiUrl,
|
|
246
|
+
return e3ApiClient.datasetGet(apiUrl, repo, workspace, pathParts, requestOptions ?? { token: null });
|
|
247
247
|
},
|
|
248
248
|
enabled: !!apiUrl && !!workspace && !!inputInfo && isUpToDate
|
|
249
249
|
});
|
|
@@ -664,11 +664,13 @@ function EastValueViewer({ type, value }) {
|
|
|
664
664
|
const platformImplementations$1 = [...eastUiComponents.StateImpl, ...eastUiComponents.DatasetImpl, ...eastUiComponents.OverlayImpl];
|
|
665
665
|
const InputPreview = React.memo(function InputPreview2({
|
|
666
666
|
apiUrl,
|
|
667
|
+
repo,
|
|
667
668
|
workspace,
|
|
668
669
|
path,
|
|
669
|
-
inputInfo
|
|
670
|
+
inputInfo,
|
|
671
|
+
requestOptions
|
|
670
672
|
}) {
|
|
671
|
-
const { data: output, isLoading, error } = useInputData(apiUrl, workspace, inputInfo);
|
|
673
|
+
const { data: output, isLoading, error } = useInputData(apiUrl, repo, workspace, inputInfo, requestOptions);
|
|
672
674
|
const ir = React.useMemo(() => {
|
|
673
675
|
if (!output) return null;
|
|
674
676
|
try {
|
|
@@ -5219,32 +5221,32 @@ function VirtualizedLogViewer({ content, tabs }) {
|
|
|
5219
5221
|
}
|
|
5220
5222
|
);
|
|
5221
5223
|
}
|
|
5222
|
-
function useTaskOutput(apiUrl, workspace, task, outputHash = null) {
|
|
5224
|
+
function useTaskOutput(apiUrl, repo, workspace, task, outputHash = null, requestOptions) {
|
|
5223
5225
|
const isUpToDate = (task == null ? void 0 : task.status.type) === "up-to-date";
|
|
5224
5226
|
return reactQuery.useQuery({
|
|
5225
5227
|
// Include outputHash in key - when hash changes, data changed
|
|
5226
|
-
queryKey: ["taskOutput", apiUrl, workspace, task == null ? void 0 : task.name, outputHash],
|
|
5228
|
+
queryKey: ["taskOutput", apiUrl, repo, workspace, task == null ? void 0 : task.name, outputHash],
|
|
5227
5229
|
queryFn: () => {
|
|
5228
5230
|
var _a, _b;
|
|
5229
5231
|
const pathParts = ((_b = (_a = task == null ? void 0 : task.output) == null ? void 0 : _a.split(".")) == null ? void 0 : _b.map((value) => east.variant("field", value))) ?? [];
|
|
5230
|
-
return e3ApiClient.datasetGet(apiUrl,
|
|
5232
|
+
return e3ApiClient.datasetGet(apiUrl, repo, workspace, pathParts, requestOptions ?? { token: null });
|
|
5231
5233
|
},
|
|
5232
5234
|
enabled: !!apiUrl && !!workspace && !!task && isUpToDate
|
|
5233
5235
|
});
|
|
5234
5236
|
}
|
|
5235
5237
|
const CHUNK_SIZE = 64 * 1024;
|
|
5236
5238
|
const MAX_TOTAL_SIZE = 10 * 1024 * 1024;
|
|
5237
|
-
async function fetchAllLogs(apiUrl, workspace, taskName, stream) {
|
|
5239
|
+
async function fetchAllLogs(apiUrl, repo, workspace, taskName, stream, requestOptions) {
|
|
5238
5240
|
try {
|
|
5239
5241
|
let allData = "";
|
|
5240
5242
|
let offset = 0;
|
|
5241
5243
|
let totalSize = 0n;
|
|
5242
5244
|
while (true) {
|
|
5243
|
-
const chunk = await e3ApiClient.taskLogs(apiUrl,
|
|
5245
|
+
const chunk = await e3ApiClient.taskLogs(apiUrl, repo, workspace, taskName, {
|
|
5244
5246
|
stream,
|
|
5245
5247
|
offset,
|
|
5246
5248
|
limit: CHUNK_SIZE
|
|
5247
|
-
}, { token: null });
|
|
5249
|
+
}, requestOptions ?? { token: null });
|
|
5248
5250
|
allData += chunk.data;
|
|
5249
5251
|
totalSize = chunk.totalSize;
|
|
5250
5252
|
if (chunk.complete || allData.length >= MAX_TOTAL_SIZE) {
|
|
@@ -5269,12 +5271,12 @@ async function fetchAllLogs(apiUrl, workspace, taskName, stream) {
|
|
|
5269
5271
|
};
|
|
5270
5272
|
}
|
|
5271
5273
|
}
|
|
5272
|
-
function useTaskLogs(apiUrl, workspace, task, stream = "stdout") {
|
|
5274
|
+
function useTaskLogs(apiUrl, repo, workspace, task, stream = "stdout", requestOptions) {
|
|
5273
5275
|
const isTaskRunning = (task == null ? void 0 : task.status.type) === "in-progress" || (task == null ? void 0 : task.status.type) === "stale-running";
|
|
5274
5276
|
return reactQuery.useQuery({
|
|
5275
5277
|
// Include task status in query key so we refetch when status changes
|
|
5276
|
-
queryKey: ["taskLogs", apiUrl, workspace, task == null ? void 0 : task.name, task == null ? void 0 : task.status.type, stream],
|
|
5277
|
-
queryFn: () => fetchAllLogs(apiUrl, workspace, task.name, stream),
|
|
5278
|
+
queryKey: ["taskLogs", apiUrl, repo, workspace, task == null ? void 0 : task.name, task == null ? void 0 : task.status.type, stream],
|
|
5279
|
+
queryFn: () => fetchAllLogs(apiUrl, repo, workspace, task.name, stream, requestOptions),
|
|
5278
5280
|
enabled: !!apiUrl && !!workspace && !!task,
|
|
5279
5281
|
// Only refetch every second while task is running, otherwise stop polling
|
|
5280
5282
|
refetchInterval: isTaskRunning ? 1e3 : false
|
|
@@ -5283,14 +5285,16 @@ function useTaskLogs(apiUrl, workspace, task, stream = "stdout") {
|
|
|
5283
5285
|
const platformImplementations = [...eastUiComponents.StateImpl, ...eastUiComponents.DatasetImpl, ...eastUiComponents.OverlayImpl];
|
|
5284
5286
|
const TaskPreview = React.memo(function TaskPreview2({
|
|
5285
5287
|
apiUrl,
|
|
5288
|
+
repo,
|
|
5286
5289
|
workspace,
|
|
5287
5290
|
task,
|
|
5288
5291
|
taskInfo,
|
|
5289
|
-
outputHash
|
|
5292
|
+
outputHash,
|
|
5293
|
+
requestOptions
|
|
5290
5294
|
}) {
|
|
5291
|
-
const { data: output, isLoading, error } = useTaskOutput(apiUrl, workspace, taskInfo, outputHash);
|
|
5292
|
-
const { data: stdout } = useTaskLogs(apiUrl, workspace, taskInfo, "stdout");
|
|
5293
|
-
const { data: stderr } = useTaskLogs(apiUrl, workspace, taskInfo, "stderr");
|
|
5295
|
+
const { data: output, isLoading, error } = useTaskOutput(apiUrl, repo, workspace, taskInfo, outputHash, requestOptions);
|
|
5296
|
+
const { data: stdout } = useTaskLogs(apiUrl, repo, workspace, taskInfo, "stdout", requestOptions);
|
|
5297
|
+
const { data: stderr } = useTaskLogs(apiUrl, repo, workspace, taskInfo, "stderr", requestOptions);
|
|
5294
5298
|
const ir = React.useMemo(() => {
|
|
5295
5299
|
if (!output) return null;
|
|
5296
5300
|
try {
|
|
@@ -5441,7 +5445,7 @@ const TaskPreview = React.memo(function TaskPreview2({
|
|
|
5441
5445
|
] }) });
|
|
5442
5446
|
}, (prev, next) => {
|
|
5443
5447
|
var _a, _b;
|
|
5444
|
-
return prev.task === next.task && prev.workspace === next.workspace && prev.outputHash === next.outputHash && ((_a = prev.taskInfo) == null ? void 0 : _a.status.type) === ((_b = next.taskInfo) == null ? void 0 : _b.status.type);
|
|
5448
|
+
return prev.task === next.task && prev.repo === next.repo && prev.workspace === next.workspace && prev.outputHash === next.outputHash && ((_a = prev.taskInfo) == null ? void 0 : _a.status.type) === ((_b = next.taskInfo) == null ? void 0 : _b.status.type);
|
|
5445
5449
|
});
|
|
5446
5450
|
exports.EastValueViewer = EastValueViewer;
|
|
5447
5451
|
exports.InputPreview = InputPreview;
|