diff --git a/esp/src/eclwatch/GetDFUWorkunitsWidget.js b/esp/src/eclwatch/GetDFUWorkunitsWidget.js
index dc320468733..ea5285824ce 100644
--- a/esp/src/eclwatch/GetDFUWorkunitsWidget.js
+++ b/esp/src/eclwatch/GetDFUWorkunitsWidget.js
@@ -369,8 +369,6 @@ define([
initWorkunitsGrid: function () {
var context = this;
var filter = this.filter.toObject();
- filter.includeTimings = true;
- filter.includeTransferRate = true;
var store = this.params.searchResults ? this.params.searchResults : new ESPDFUWorkunit.CreateWUQueryStore();
this.workunitsGrid = new declare([ESPUtil.Grid(true, true, false, false, "GetDFUWorkunitsWidget")])({
store: store,
@@ -477,8 +475,6 @@ define([
refreshGrid: function (clearSelection) {
var filter = this.filter.toObject();
- filter.includeTimings = true;
- filter.includeTransferRate = true;
this.workunitsGrid.set("query", filter);
if (clearSelection) {
this.workunitsGrid.clearSelection();
diff --git a/esp/src/eclwatch/templates/DFUQueryWidget.html b/esp/src/eclwatch/templates/DFUQueryWidget.html
index b45187e2be7..0eb44da4b31 100644
--- a/esp/src/eclwatch/templates/DFUQueryWidget.html
+++ b/esp/src/eclwatch/templates/DFUQueryWidget.html
@@ -69,7 +69,7 @@
-
+
diff --git a/esp/src/src-react/components/DFUWorkunits.tsx b/esp/src/src-react/components/DFUWorkunits.tsx
index 39170270844..a8379f14aae 100644
--- a/esp/src/src-react/components/DFUWorkunits.tsx
+++ b/esp/src/src-react/components/DFUWorkunits.tsx
@@ -39,8 +39,6 @@ function formatQuery(_filter): { [id: string]: any } {
if (filter.Type === true) {
filter.Type = "archived workunits";
}
- filter.includeTimings = true;
- filter.includeTransferRate = true;
return filter;
}
@@ -83,7 +81,7 @@ export const DFUWorkunits: React.FunctionComponent = ({
// Grid ---
const gridStore = React.useMemo(() => {
- return store || ESPDFUWorkunit.CreateWUQueryStore({});
+ return store || ESPDFUWorkunit.CreateWUQueryStore();
}, [store]);
const query = React.useMemo(() => {
diff --git a/esp/src/src/ESPDFUWorkunit.ts b/esp/src/src/ESPDFUWorkunit.ts
index f9d3fc7165c..3de6c1ba48a 100644
--- a/esp/src/src/ESPDFUWorkunit.ts
+++ b/esp/src/src/ESPDFUWorkunit.ts
@@ -8,6 +8,11 @@ import * as FileSpray from "./FileSpray";
import nlsHPCC from "./nlsHPCC";
import * as Utility from "./Utility";
+import { FileSprayService, FileSpray as FileSprayNS } from "@hpcc-js/comms";
+
+import { Paged } from "./store/Paged";
+import { BaseStore } from "./store/Store";
+
const i18n = nlsHPCC;
class Store extends ESPRequest.Store {
@@ -297,14 +302,37 @@ export function isInstanceOfWorkunit(obj) {
export function Get(wuid, data?) {
const store = new Store();
const retVal = store.get(wuid);
- if (data) {
+ if (data && !retVal.__hpcc_id) {
retVal.updateData(data);
}
return retVal;
}
-export function CreateWUQueryStore(options) {
+export function CreateWUQueryStoreLegacy(options) {
let store = new Store(options);
store = new Observable(store);
return store;
}
+
+const service = new FileSprayService({ baseUrl: "" });
+
+export type WUQueryStore = BaseStore;
+
+export function CreateWUQueryStore(): BaseStore {
+ const store = new Paged({
+ start: "PageStartFrom",
+ count: "PageSize",
+ sortBy: "Sortby",
+ descending: "Descending"
+ }, "ID", request => {
+ request.includeTimings = true;
+ request.includeTransferRate = true;
+ return service.GetDFUWorkunits(request).then(response => {
+ return {
+ data: response.results.DFUWorkunit.map(wu => Get(wu.ID, wu)),
+ total: response.NumWUs
+ };
+ });
+ });
+ return new Observable(store);
+}
diff --git a/esp/src/src/ESPLogicalFile.ts b/esp/src/src/ESPLogicalFile.ts
index 62f7a8a8e54..24d7e78720d 100644
--- a/esp/src/src/ESPLogicalFile.ts
+++ b/esp/src/src/ESPLogicalFile.ts
@@ -472,7 +472,7 @@ export function Get(Cluster, Name, data?) {
}
const store = new Store();
const retVal = store.get(createID(Cluster, Name));
- if (data) {
+ if (data && !retVal.__hpcc_id) {
lang.mixin(data, {
__hpcc_id: createID(data.NodeGroup, data.Name),
__hpcc_isDir: false,
diff --git a/esp/src/src/FileSpray.ts b/esp/src/src/FileSpray.ts
index 1dc36490c37..8263f04345f 100644
--- a/esp/src/src/FileSpray.ts
+++ b/esp/src/src/FileSpray.ts
@@ -327,6 +327,8 @@ export function CreateLandingZonesFilterStore(options) {
}
export function GetDFUWorkunits(params) {
+ params.request.includeTimings = true;
+ params.request.includeTransferRate = true;
return ESPRequest.send("FileSpray", "GetDFUWorkunits", params);
}