@hpcc-js/eclwatch 3.2.19 → 3.2.20
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/index.js +579 -262
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -5
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable:
|
|
3
|
-
var
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
5
|
import { Editor } from "@hpcc-js/codemirror";
|
|
5
6
|
import { Workunit, BaseScope, Result, WUStateID } from "@hpcc-js/comms";
|
|
6
7
|
import { SplitPanel } from "@hpcc-js/phosphor";
|
|
@@ -11,8 +12,10 @@ import { Table, RowFormatter, domConstruct, Deferred, QueryResults, Common } fro
|
|
|
11
12
|
import { Vertex, Subgraph as Subgraph$1, Edge as Edge$1, Graph } from "@hpcc-js/graph";
|
|
12
13
|
import { Legend, ChartPanel, Carousel } from "@hpcc-js/layout";
|
|
13
14
|
import { ReactTimelineSeries } from "@hpcc-js/timeline";
|
|
14
|
-
const PKG_NAME = "@hpcc-js/eclwatch"
|
|
15
|
-
|
|
15
|
+
const PKG_NAME = "@hpcc-js/eclwatch";
|
|
16
|
+
const PKG_VERSION = "3.1.1";
|
|
17
|
+
const BUILD_VERSION = "3.2.1";
|
|
18
|
+
const _ECLArchiveViewer = class _ECLArchiveViewer extends SplitPanel {
|
|
16
19
|
constructor() {
|
|
17
20
|
super("horizontal");
|
|
18
21
|
__publicField(this, "_prevHash");
|
|
@@ -28,7 +31,7 @@ class ECLArchiveViewer extends SplitPanel {
|
|
|
28
31
|
label: json.name,
|
|
29
32
|
children: json._children.map(transformNode).filter((n) => n)
|
|
30
33
|
};
|
|
31
|
-
if (ret.children && ret.children[0] && ret.children[0].label === "html")
|
|
34
|
+
if (ret.children && ret.children[0] && ret.children[0].label === "html") {
|
|
32
35
|
return {
|
|
33
36
|
label: "root",
|
|
34
37
|
children: [
|
|
@@ -38,33 +41,41 @@ class ECLArchiveViewer extends SplitPanel {
|
|
|
38
41
|
}
|
|
39
42
|
]
|
|
40
43
|
};
|
|
44
|
+
}
|
|
41
45
|
return ret;
|
|
42
46
|
function transformNode(node) {
|
|
43
47
|
const _node = {};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
_node.label = node.name + (node["$"] && node["$"].key ? ` (${node["$"].key})` : "");
|
|
49
|
+
if (node._children && node._children.length > 0) {
|
|
50
|
+
_node.children = node._children.map((_node2) => {
|
|
51
|
+
return transformNode(_node2);
|
|
52
|
+
}).filter((n) => n);
|
|
53
|
+
} else if (typeof node.content === "string" && node.content.trim()) {
|
|
47
54
|
_node.content = node.content;
|
|
48
|
-
else
|
|
49
|
-
return
|
|
55
|
+
} else {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
50
58
|
return _node;
|
|
51
59
|
}
|
|
60
|
+
__name(transformNode, "transformNode");
|
|
52
61
|
}
|
|
53
62
|
updateDirectoryPane(contentStr) {
|
|
54
63
|
let json;
|
|
55
|
-
if (contentStr)
|
|
64
|
+
if (contentStr) {
|
|
56
65
|
try {
|
|
57
66
|
json = JSON.parse(contentStr);
|
|
58
|
-
} catch {
|
|
67
|
+
} catch (e) {
|
|
59
68
|
json = xml2json(contentStr);
|
|
60
69
|
}
|
|
70
|
+
}
|
|
61
71
|
if (json) {
|
|
62
72
|
const _data = this.transformArchiveTreeData(json);
|
|
63
73
|
this._directoryPane.data(_data).render();
|
|
64
74
|
}
|
|
65
75
|
}
|
|
66
76
|
enter(domNode, element) {
|
|
67
|
-
super.enter(domNode, element)
|
|
77
|
+
super.enter(domNode, element);
|
|
78
|
+
this.addWidget(this._directoryPane).addWidget(this._fileEditorPane);
|
|
68
79
|
}
|
|
69
80
|
update(domNode, element) {
|
|
70
81
|
super.update(domNode, element);
|
|
@@ -72,11 +83,20 @@ class ECLArchiveViewer extends SplitPanel {
|
|
|
72
83
|
baseUrl: this.baseUrl(),
|
|
73
84
|
wuid: this.wuid()
|
|
74
85
|
});
|
|
75
|
-
this._prevHash !== hash || typeof this._contentStr
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
if (this._prevHash !== hash || typeof this._contentStr === "undefined") {
|
|
87
|
+
Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid()).fetchArchive().then((resp) => {
|
|
88
|
+
this._contentStr = resp;
|
|
89
|
+
this.updateDirectoryPane(this._contentStr);
|
|
90
|
+
this._prevHash = hash;
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
this.updateDirectoryPane(this._contentStr);
|
|
94
|
+
}
|
|
95
|
+
this.relativeSizes([this.directoryWidthRatio(), 1 - this.directoryWidthRatio()]);
|
|
78
96
|
}
|
|
79
|
-
}
|
|
97
|
+
};
|
|
98
|
+
__name(_ECLArchiveViewer, "ECLArchiveViewer");
|
|
99
|
+
let ECLArchiveViewer = _ECLArchiveViewer;
|
|
80
100
|
ECLArchiveViewer.prototype._class += " eclwatch_ECLArchiveViewer";
|
|
81
101
|
ECLArchiveViewer.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
82
102
|
ECLArchiveViewer.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
@@ -93,19 +113,22 @@ ECLArchiveViewer.prototype.publishProxy("folderIconClosed", "_directoryPane");
|
|
|
93
113
|
ECLArchiveViewer.prototype.publishProxy("textFileIcon", "_directoryPane");
|
|
94
114
|
ECLArchiveViewer.prototype.publishProxy("codeFileIcon", "_directoryPane");
|
|
95
115
|
ECLArchiveViewer.prototype.publishProxy("verticalScroll", "_directoryPane");
|
|
96
|
-
class
|
|
116
|
+
const _LegendVertex = class _LegendVertex extends Vertex {
|
|
97
117
|
constructor() {
|
|
98
118
|
super();
|
|
99
119
|
}
|
|
100
120
|
enter(domNode, element) {
|
|
101
|
-
super.enter(domNode, element)
|
|
121
|
+
super.enter(domNode, element);
|
|
122
|
+
this._icon.on("click", () => {
|
|
102
123
|
this.click(this.data());
|
|
103
124
|
});
|
|
104
125
|
}
|
|
105
126
|
click(kind) {
|
|
106
127
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
128
|
+
};
|
|
129
|
+
__name(_LegendVertex, "LegendVertex");
|
|
130
|
+
let LegendVertex = _LegendVertex;
|
|
131
|
+
const _WUGraphLegend = class _WUGraphLegend extends Legend {
|
|
109
132
|
constructor() {
|
|
110
133
|
super(...arguments);
|
|
111
134
|
__publicField(this, "icon", local());
|
|
@@ -121,23 +144,31 @@ class WUGraphLegend extends Legend {
|
|
|
121
144
|
disabled(_) {
|
|
122
145
|
if (!arguments.length) {
|
|
123
146
|
const retVal = [];
|
|
124
|
-
for (const key in this._disabled2)
|
|
125
|
-
this._disabled2[key]
|
|
147
|
+
for (const key in this._disabled2) {
|
|
148
|
+
if (this._disabled2[key]) {
|
|
149
|
+
retVal.push(key);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
126
152
|
return retVal;
|
|
127
153
|
}
|
|
128
|
-
|
|
154
|
+
this._disabled2 = {};
|
|
155
|
+
_.forEach((kind) => this._disabled2[kind] = true);
|
|
156
|
+
return this;
|
|
129
157
|
}
|
|
130
158
|
toggle(kind) {
|
|
131
159
|
this._disabled2[kind] = !this._disabled2[kind];
|
|
132
160
|
}
|
|
133
161
|
update(domNode, element) {
|
|
134
162
|
super.update(domNode, element);
|
|
135
|
-
const context = this
|
|
163
|
+
const context = this;
|
|
164
|
+
const items = this._g.selectAll(".legendItem").data(this.data(), (d) => d.kind);
|
|
136
165
|
items.enter().append("g").attr("class", "legendItem").each(function(d) {
|
|
137
166
|
context.icon.set(
|
|
138
167
|
this,
|
|
139
168
|
new LegendVertex().target(this).data(d.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(d.faChar).text(`${d.label} (${d.count})`).tooltip(`${d.kind} - ${d.label}`).on("click", (kind) => {
|
|
140
|
-
context.toggle(kind)
|
|
169
|
+
context.toggle(kind);
|
|
170
|
+
context.render();
|
|
171
|
+
context.click(kind);
|
|
141
172
|
}).on("mouseover", (kind) => {
|
|
142
173
|
context.mouseover(kind);
|
|
143
174
|
}).on("mouseout", (kind) => {
|
|
@@ -147,10 +178,11 @@ class WUGraphLegend extends Legend {
|
|
|
147
178
|
}).merge(items).each(function(d, i) {
|
|
148
179
|
const bbox2 = context.icon.get(this).icon_shape_colorFill(context._disabled2[d.kind] ? "gray" : null).render().getBBox();
|
|
149
180
|
select(this).attr("transform", `translate(${+bbox2.width / 2}, ${i * 30})`);
|
|
150
|
-
})
|
|
181
|
+
});
|
|
182
|
+
items.exit().each(function(d) {
|
|
151
183
|
context.icon.get(this).target(null).render();
|
|
152
184
|
}).remove();
|
|
153
|
-
const bbox = this.getBBox(
|
|
185
|
+
const bbox = this.getBBox(true, true);
|
|
154
186
|
this._g.attr("transform", `translate(16, ${this.height() / 2 - bbox.height / 2})`);
|
|
155
187
|
}
|
|
156
188
|
// Events ---
|
|
@@ -160,7 +192,9 @@ class WUGraphLegend extends Legend {
|
|
|
160
192
|
}
|
|
161
193
|
mouseout(kind) {
|
|
162
194
|
}
|
|
163
|
-
}
|
|
195
|
+
};
|
|
196
|
+
__name(_WUGraphLegend, "WUGraphLegend");
|
|
197
|
+
let WUGraphLegend = _WUGraphLegend;
|
|
164
198
|
WUGraphLegend.prototype._class += " eclwatch_WUGraphLegend";
|
|
165
199
|
function faCharFactory(kind) {
|
|
166
200
|
switch (kind) {
|
|
@@ -239,7 +273,8 @@ function faCharFactory(kind) {
|
|
|
239
273
|
}
|
|
240
274
|
return "";
|
|
241
275
|
}
|
|
242
|
-
|
|
276
|
+
__name(faCharFactory, "faCharFactory");
|
|
277
|
+
const _WUScopeController = class _WUScopeController {
|
|
243
278
|
constructor() {
|
|
244
279
|
__publicField(this, "graphDB");
|
|
245
280
|
__publicField(this, "subgraphsMap", {});
|
|
@@ -252,26 +287,41 @@ class WUScopeController {
|
|
|
252
287
|
__publicField(this, "_disabled", {});
|
|
253
288
|
}
|
|
254
289
|
clear() {
|
|
255
|
-
this.subgraphsMap = {}
|
|
290
|
+
this.subgraphsMap = {};
|
|
291
|
+
this.rSubgraphsMap = {};
|
|
292
|
+
this.verticesMap = {};
|
|
293
|
+
this.rVerticesMap = {};
|
|
294
|
+
this.edgesMap = {};
|
|
295
|
+
this.rEdgesMap = {};
|
|
256
296
|
}
|
|
257
297
|
set(masterGraph) {
|
|
258
|
-
this.graphDB = masterGraph
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
298
|
+
this.graphDB = masterGraph;
|
|
299
|
+
this.graphGui(this.graphDB);
|
|
300
|
+
this.kindMap = {};
|
|
301
|
+
this.graphDB.walk((item) => {
|
|
302
|
+
if (item instanceof Subgraph) ;
|
|
303
|
+
else if (item instanceof Vertex$1) {
|
|
304
|
+
const kind = item._.attr("Kind").RawValue;
|
|
305
|
+
if (!this.kindMap[kind]) {
|
|
306
|
+
this.kindMap[kind] = [];
|
|
263
307
|
}
|
|
264
|
-
|
|
308
|
+
this.kindMap[kind].push(item);
|
|
309
|
+
} else ;
|
|
265
310
|
});
|
|
266
311
|
}
|
|
267
312
|
disabled(_) {
|
|
268
313
|
if (!arguments.length) {
|
|
269
314
|
const retVal = [];
|
|
270
|
-
for (const key in this._disabled)
|
|
271
|
-
this._disabled[key]
|
|
315
|
+
for (const key in this._disabled) {
|
|
316
|
+
if (this._disabled[key]) {
|
|
317
|
+
retVal.push(key);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
272
320
|
return retVal;
|
|
273
321
|
}
|
|
274
|
-
|
|
322
|
+
this._disabled = {};
|
|
323
|
+
_.forEach((kind) => this._disabled[kind] = true);
|
|
324
|
+
return this;
|
|
275
325
|
}
|
|
276
326
|
graphGui(graphDB) {
|
|
277
327
|
const graphGui = {
|
|
@@ -280,31 +330,46 @@ class WUScopeController {
|
|
|
280
330
|
edges: [],
|
|
281
331
|
hierarchy: []
|
|
282
332
|
};
|
|
283
|
-
|
|
333
|
+
graphDB.walk((item) => {
|
|
284
334
|
if (item instanceof Subgraph) {
|
|
285
335
|
const subgraph = this.appendSubgraph(item, graphGui.hierarchy, graphGui.subgraphs);
|
|
286
336
|
subgraph.showMinMax(item.vertices.length > 3 || subgraph.minState() !== "normal");
|
|
287
|
-
} else item instanceof Vertex$1
|
|
288
|
-
|
|
337
|
+
} else if (item instanceof Vertex$1) {
|
|
338
|
+
this.appendVertex(item, graphGui.hierarchy, graphGui.vertices);
|
|
339
|
+
} else if (item instanceof Edge) {
|
|
340
|
+
this.appendEdge(item, graphGui.edges);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
return graphGui;
|
|
289
344
|
}
|
|
290
345
|
format(labelTpl, obj) {
|
|
291
|
-
let retVal = ""
|
|
292
|
-
|
|
293
|
-
|
|
346
|
+
let retVal = "";
|
|
347
|
+
let lpos = labelTpl.indexOf("%");
|
|
348
|
+
let rpos = -1;
|
|
349
|
+
while (lpos >= 0) {
|
|
350
|
+
retVal += labelTpl.substring(rpos + 1, lpos);
|
|
351
|
+
rpos = labelTpl.indexOf("%", lpos + 1);
|
|
352
|
+
if (rpos < 0) {
|
|
294
353
|
console.warn("Invalid Label Template");
|
|
295
354
|
break;
|
|
296
355
|
}
|
|
297
356
|
const key = labelTpl.substring(lpos + 1, rpos);
|
|
298
|
-
retVal += key ? obj[labelTpl.substring(lpos + 1, rpos)] || ""
|
|
357
|
+
retVal += !key ? "%" : obj[labelTpl.substring(lpos + 1, rpos)] || "";
|
|
358
|
+
lpos = labelTpl.indexOf("%", rpos + 1);
|
|
299
359
|
}
|
|
300
|
-
|
|
301
|
-
|
|
360
|
+
retVal += labelTpl.substring(rpos + 1, labelTpl.length);
|
|
361
|
+
return retVal.split("\\n").join("\n");
|
|
302
362
|
}
|
|
303
363
|
createSubgraph(subgraph) {
|
|
304
364
|
let sg = this.subgraphsMap[subgraph._.Id];
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
365
|
+
if (!sg) {
|
|
366
|
+
sg = new Subgraph$1().title(subgraph._.Id).on("minClick", () => {
|
|
367
|
+
this.minClick(sg);
|
|
368
|
+
});
|
|
369
|
+
this.subgraphsMap[subgraph._.Id] = sg;
|
|
370
|
+
this.rSubgraphsMap[sg.id()] = subgraph;
|
|
371
|
+
}
|
|
372
|
+
return sg;
|
|
308
373
|
}
|
|
309
374
|
createVertex(vertex) {
|
|
310
375
|
let v = this.verticesMap[vertex._.Id];
|
|
@@ -313,31 +378,40 @@ class WUScopeController {
|
|
|
313
378
|
if (vertex._.ScopeType === "dummy") {
|
|
314
379
|
const parent = this.subgraphsMap[vertex.parent._.Id];
|
|
315
380
|
v = new Icon().shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click", () => {
|
|
316
|
-
parent.minState("normal")
|
|
381
|
+
parent.minState("normal");
|
|
382
|
+
this.minClick(parent);
|
|
317
383
|
});
|
|
318
384
|
} else {
|
|
319
|
-
v = new Vertex().icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(faCharFactory(attrs
|
|
385
|
+
v = new Vertex().icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(faCharFactory(attrs["Kind"])).text(attrs["Label"]);
|
|
320
386
|
const annotations = [];
|
|
321
|
-
vertex._.hasAttr("Definition")
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
387
|
+
if (vertex._.hasAttr("Definition")) {
|
|
388
|
+
annotations.push({
|
|
389
|
+
faChar: "",
|
|
390
|
+
tooltip: "Definition",
|
|
391
|
+
shape_colorFill: "lightgray",
|
|
392
|
+
shape_colorStroke: "lightgray",
|
|
393
|
+
image_colorFill: "black"
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
if (vertex._.hasAttr("IsInternal")) {
|
|
397
|
+
annotations.push({
|
|
398
|
+
faChar: "",
|
|
399
|
+
tooltip: "IsInternal",
|
|
400
|
+
shape_colorFill: "red",
|
|
401
|
+
shape_colorStroke: "red",
|
|
402
|
+
image_colorFill: "white"
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
v.annotationIcons(annotations);
|
|
334
406
|
}
|
|
335
|
-
this.verticesMap[vertex._.Id] = v
|
|
407
|
+
this.verticesMap[vertex._.Id] = v;
|
|
408
|
+
this.rVerticesMap[v.id()] = vertex;
|
|
336
409
|
}
|
|
337
410
|
return v;
|
|
338
411
|
}
|
|
339
412
|
isSpill(edge) {
|
|
340
|
-
const sourceKind = edge.source._.attr("Kind").RawValue
|
|
413
|
+
const sourceKind = edge.source._.attr("Kind").RawValue;
|
|
414
|
+
const targetKind = edge.target._.attr("Kind").RawValue;
|
|
341
415
|
return sourceKind === "2" || targetKind === "71";
|
|
342
416
|
}
|
|
343
417
|
spansSubgraph(edge) {
|
|
@@ -346,12 +420,30 @@ class WUScopeController {
|
|
|
346
420
|
createEdge(edge) {
|
|
347
421
|
let e = this.edgesMap[edge._.Id];
|
|
348
422
|
if (!e) {
|
|
349
|
-
const attrs = edge._.rawAttrs()
|
|
423
|
+
const attrs = edge._.rawAttrs();
|
|
424
|
+
const sourceV = this.verticesMap[edge.source._.Id];
|
|
425
|
+
const targetV = this.verticesMap[edge.target._.Id];
|
|
350
426
|
if (sourceV && targetV) {
|
|
351
|
-
const isSpill = this.isSpill(edge)
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
427
|
+
const isSpill = this.isSpill(edge);
|
|
428
|
+
const spansSubgraph = this.spansSubgraph(edge);
|
|
429
|
+
const label = this.format("%Label%\n%NumRowsProcessed%", attrs);
|
|
430
|
+
let strokeDasharray = null;
|
|
431
|
+
let weight = 100;
|
|
432
|
+
if (attrs["IsDependency"]) {
|
|
433
|
+
weight = 10;
|
|
434
|
+
strokeDasharray = "1,5";
|
|
435
|
+
} else if (attrs["_childGraph"]) {
|
|
436
|
+
strokeDasharray = "5,5";
|
|
437
|
+
} else if (isSpill) {
|
|
438
|
+
weight = 25;
|
|
439
|
+
strokeDasharray = "5,5,10,5";
|
|
440
|
+
} else if (spansSubgraph) {
|
|
441
|
+
weight = 5;
|
|
442
|
+
strokeDasharray = "5,5";
|
|
443
|
+
}
|
|
444
|
+
e = new Edge$1().sourceVertex(sourceV).targetVertex(targetV).sourceMarker("circle").targetMarker("arrow").weight(weight).strokeDasharray(strokeDasharray).text(label);
|
|
445
|
+
this.edgesMap[edge._.Id] = e;
|
|
446
|
+
this.rEdgesMap[e.id()] = edge;
|
|
355
447
|
}
|
|
356
448
|
}
|
|
357
449
|
return e;
|
|
@@ -360,42 +452,64 @@ class WUScopeController {
|
|
|
360
452
|
const sg = this.createSubgraph(subgraph);
|
|
361
453
|
subgraphs.push(sg);
|
|
362
454
|
const parent = this.subgraphsMap[subgraph.parent._.Id];
|
|
363
|
-
|
|
455
|
+
if (parent) {
|
|
456
|
+
hierarchy.push({ parent, child: sg });
|
|
457
|
+
}
|
|
458
|
+
return sg;
|
|
364
459
|
}
|
|
365
460
|
appendVertex(vertex, hierarchy, vertices) {
|
|
366
461
|
const v = this.createVertex(vertex);
|
|
367
462
|
vertices.push(v);
|
|
368
463
|
const parent = this.subgraphsMap[vertex.parent._.Id];
|
|
369
|
-
|
|
464
|
+
if (parent) {
|
|
465
|
+
hierarchy.push({ parent, child: v });
|
|
466
|
+
}
|
|
467
|
+
return v;
|
|
370
468
|
}
|
|
371
469
|
appendEdge(edge, edges) {
|
|
372
470
|
const e = this.createEdge(edge);
|
|
373
|
-
|
|
471
|
+
if (e) {
|
|
472
|
+
edges.push(e);
|
|
473
|
+
}
|
|
474
|
+
return e;
|
|
374
475
|
}
|
|
375
476
|
filterLegend(graphDB) {
|
|
376
477
|
for (let i = graphDB.vertices.length - 1; i >= 0; --i) {
|
|
377
|
-
const vertex = graphDB.vertices[i]
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
478
|
+
const vertex = graphDB.vertices[i];
|
|
479
|
+
const kind = vertex._.attr("Kind").RawValue;
|
|
480
|
+
if (this._disabled[kind]) {
|
|
481
|
+
vertex.remove(false, (source, target) => {
|
|
482
|
+
return new BaseScope({
|
|
483
|
+
ScopeName: vertex._.ScopeName + ":in",
|
|
484
|
+
Id: source.Id + "->" + target.Id,
|
|
485
|
+
ScopeType: "dummy-edge",
|
|
486
|
+
Properties: {
|
|
487
|
+
Property: [vertex._.attr("Label")]
|
|
488
|
+
},
|
|
489
|
+
Notes: {
|
|
490
|
+
Note: []
|
|
491
|
+
},
|
|
492
|
+
SinkActivity: ""
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
390
496
|
}
|
|
391
497
|
}
|
|
392
498
|
filterPartial(graphDB) {
|
|
393
|
-
for (const subgraph of graphDB.subgraphs)
|
|
394
|
-
|
|
499
|
+
for (const subgraph of graphDB.subgraphs) {
|
|
500
|
+
const sg = this.subgraphsMap[subgraph._.Id];
|
|
501
|
+
switch (sg.minState()) {
|
|
395
502
|
case "partial":
|
|
396
|
-
const childVertices = subgraph.vertices
|
|
397
|
-
|
|
398
|
-
|
|
503
|
+
const childVertices = subgraph.vertices;
|
|
504
|
+
const vShow = [];
|
|
505
|
+
const vHide = [];
|
|
506
|
+
for (const vertex of childVertices) {
|
|
507
|
+
if (vertex.inEdges.length === 0 || vertex.inEdges.some((edge) => edge.source.parent !== edge.target.parent) || vertex.outEdges.length === 0 || vertex.outEdges.some((edge) => edge.source.parent !== edge.target.parent)) {
|
|
508
|
+
vShow.push(vertex);
|
|
509
|
+
} else {
|
|
510
|
+
vHide.push(vertex);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
399
513
|
if (vHide.length > 1) {
|
|
400
514
|
const dummyDetails = {
|
|
401
515
|
ScopeName: subgraph._.ScopeName,
|
|
@@ -415,9 +529,11 @@ class WUScopeController {
|
|
|
415
529
|
Note: []
|
|
416
530
|
},
|
|
417
531
|
SinkActivity: ""
|
|
418
|
-
}
|
|
532
|
+
};
|
|
533
|
+
const dummyScope = new BaseScope(dummyDetails);
|
|
534
|
+
const dummyVertex = subgraph.createVertex(dummyScope);
|
|
419
535
|
for (const vertex of vHide) {
|
|
420
|
-
for (const edge of vertex.inEdges)
|
|
536
|
+
for (const edge of vertex.inEdges) {
|
|
421
537
|
if (vShow.indexOf(edge.source) >= 0) {
|
|
422
538
|
const dummyEdgeScope = new BaseScope({
|
|
423
539
|
ScopeName: edge.source._.ScopeName,
|
|
@@ -433,7 +549,8 @@ class WUScopeController {
|
|
|
433
549
|
});
|
|
434
550
|
subgraph.createEdge(edge.source, dummyVertex, dummyEdgeScope);
|
|
435
551
|
}
|
|
436
|
-
|
|
552
|
+
}
|
|
553
|
+
for (const edge of vertex.outEdges) {
|
|
437
554
|
if (vShow.indexOf(edge.target) >= 0) {
|
|
438
555
|
const dummyEdgeScope = new BaseScope({
|
|
439
556
|
ScopeName: edge.target._.ScopeName,
|
|
@@ -449,89 +566,117 @@ class WUScopeController {
|
|
|
449
566
|
});
|
|
450
567
|
subgraph.createEdge(dummyVertex, edge.target, dummyEdgeScope);
|
|
451
568
|
}
|
|
569
|
+
}
|
|
452
570
|
}
|
|
453
|
-
vHide.forEach((vertex) => vertex.remove(
|
|
571
|
+
vHide.forEach((vertex) => vertex.remove(true));
|
|
454
572
|
}
|
|
455
573
|
break;
|
|
456
574
|
}
|
|
575
|
+
}
|
|
457
576
|
}
|
|
458
577
|
filterEmptySubgraphs(graphDB) {
|
|
459
|
-
|
|
578
|
+
while (true) {
|
|
460
579
|
const emptySubgraphs = graphDB.subgraphs.filter((subgraph) => subgraph.subgraphs.length === 0 && subgraph.vertices.length === 0);
|
|
461
580
|
if (emptySubgraphs.length === 0) break;
|
|
462
|
-
emptySubgraphs.forEach((subgraph) => subgraph.remove(
|
|
581
|
+
emptySubgraphs.forEach((subgraph) => subgraph.remove(true));
|
|
463
582
|
}
|
|
464
583
|
}
|
|
465
584
|
removeObsoleteSubgraphs(graphDB) {
|
|
466
|
-
for (const subgraph of [...graphDB.subgraphs])
|
|
467
|
-
subgraph.vertices.length === 0
|
|
585
|
+
for (const subgraph of [...graphDB.subgraphs]) {
|
|
586
|
+
if (subgraph.vertices.length === 0) {
|
|
587
|
+
subgraph.remove(false);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
468
590
|
}
|
|
469
591
|
graphData() {
|
|
470
592
|
const graphDB = this.graphDB.clone();
|
|
471
|
-
|
|
593
|
+
this.filterLegend(graphDB);
|
|
594
|
+
this.filterPartial(graphDB);
|
|
595
|
+
this.filterEmptySubgraphs(graphDB);
|
|
596
|
+
this.removeObsoleteSubgraphs(graphDB);
|
|
597
|
+
return this.graphGui(graphDB);
|
|
472
598
|
}
|
|
473
599
|
calcLegend() {
|
|
474
600
|
const retVal = [];
|
|
475
|
-
for (const kind in this.kindMap)
|
|
601
|
+
for (const kind in this.kindMap) {
|
|
476
602
|
retVal.push({
|
|
477
603
|
kind: parseInt(kind),
|
|
478
604
|
faChar: faCharFactory(kind),
|
|
479
|
-
label: this.kindMap[kind][0]._.attr("Label").RawValue.split(
|
|
480
|
-
`)[0],
|
|
605
|
+
label: this.kindMap[kind][0]._.attr("Label").RawValue.split("\n")[0],
|
|
481
606
|
count: this.kindMap[kind].length
|
|
482
607
|
});
|
|
608
|
+
}
|
|
483
609
|
return retVal;
|
|
484
610
|
}
|
|
485
611
|
vertices(kind) {
|
|
486
612
|
const retVal = [];
|
|
487
|
-
for (const v of this.kindMap[kind])
|
|
613
|
+
for (const v of this.kindMap[kind]) {
|
|
488
614
|
retVal.push(this.verticesMap[v._.Id]);
|
|
615
|
+
}
|
|
489
616
|
return retVal;
|
|
490
617
|
}
|
|
491
618
|
formatRow(item, columns2, row) {
|
|
492
619
|
const attrs = item._.formattedAttrs();
|
|
493
620
|
for (const key in attrs) {
|
|
494
621
|
const idx = columns2.indexOf(key);
|
|
495
|
-
idx === -1
|
|
622
|
+
if (idx === -1) {
|
|
623
|
+
columns2.push(key);
|
|
624
|
+
row.push(attrs[key]);
|
|
625
|
+
} else {
|
|
626
|
+
row[idx] = attrs[key];
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
for (let i = 0; i < 100; ++i) {
|
|
630
|
+
if (row[i] === void 0) {
|
|
631
|
+
row[i] = "";
|
|
632
|
+
}
|
|
496
633
|
}
|
|
497
|
-
for (let i = 0; i < 100; ++i)
|
|
498
|
-
row[i] === void 0 && (row[i] = "");
|
|
499
634
|
return row;
|
|
500
635
|
}
|
|
501
636
|
activityData() {
|
|
502
|
-
const columns2 = ["Id", "Kind", "Label"]
|
|
637
|
+
const columns2 = ["Id", "Kind", "Label"];
|
|
638
|
+
const data = this.graphDB.vertices.map((v) => {
|
|
503
639
|
const row = [parseInt(v._.Id.split("a")[1])];
|
|
504
640
|
return this.formatRow(v, columns2, row);
|
|
505
641
|
});
|
|
506
642
|
return { columns: columns2, data };
|
|
507
643
|
}
|
|
508
644
|
edgeData() {
|
|
509
|
-
const columns2 = ["Id", "Label"]
|
|
645
|
+
const columns2 = ["Id", "Label"];
|
|
646
|
+
const data = this.graphDB.edges.map((e) => {
|
|
510
647
|
const row = [e._.Id];
|
|
511
648
|
return this.formatRow(e, columns2, row);
|
|
512
649
|
});
|
|
513
650
|
return { columns: columns2, data };
|
|
514
651
|
}
|
|
515
652
|
subgraphData() {
|
|
516
|
-
const columns2 = ["Id", "Label"]
|
|
653
|
+
const columns2 = ["Id", "Label"];
|
|
654
|
+
const data = this.graphDB.subgraphs.map((sg) => {
|
|
517
655
|
const row = [sg._.Id];
|
|
518
656
|
return this.formatRow(sg, columns2, row);
|
|
519
657
|
});
|
|
520
658
|
return { columns: columns2, data };
|
|
521
659
|
}
|
|
522
660
|
calcGraphTooltip(item) {
|
|
523
|
-
let scope
|
|
661
|
+
let scope;
|
|
662
|
+
let parentScope;
|
|
524
663
|
if (item instanceof Subgraph$1) {
|
|
525
664
|
const subgraph = this.rSubgraphsMap[item.id()];
|
|
526
|
-
scope = subgraph._
|
|
665
|
+
scope = subgraph._;
|
|
666
|
+
parentScope = subgraph.parent._;
|
|
527
667
|
} else if (item instanceof Vertex || item instanceof Icon) {
|
|
528
668
|
const vertex = this.rVerticesMap[item.id()];
|
|
529
|
-
scope = vertex._
|
|
669
|
+
scope = vertex._;
|
|
670
|
+
parentScope = vertex.parent._;
|
|
530
671
|
} else if (item instanceof Edge$1) {
|
|
531
672
|
const edge = this.rEdgesMap[item.id()];
|
|
532
|
-
scope = edge._
|
|
673
|
+
scope = edge._;
|
|
674
|
+
parentScope = edge.parent._;
|
|
533
675
|
}
|
|
534
|
-
|
|
676
|
+
if (scope) {
|
|
677
|
+
return scope.calcTooltip(parentScope);
|
|
678
|
+
}
|
|
679
|
+
return "";
|
|
535
680
|
}
|
|
536
681
|
subgraph(id) {
|
|
537
682
|
return this.subgraphsMap[id];
|
|
@@ -545,8 +690,10 @@ class WUScopeController {
|
|
|
545
690
|
// Events ---
|
|
546
691
|
minClick(sg) {
|
|
547
692
|
}
|
|
548
|
-
}
|
|
549
|
-
|
|
693
|
+
};
|
|
694
|
+
__name(_WUScopeController, "WUScopeController");
|
|
695
|
+
let WUScopeController = _WUScopeController;
|
|
696
|
+
const _WUGraph = class _WUGraph extends ChartPanel {
|
|
550
697
|
constructor() {
|
|
551
698
|
super();
|
|
552
699
|
__publicField(this, "_partialAll", new Button().faChar("fa-window-restore").tooltip("Partial All").on("click", () => {
|
|
@@ -555,28 +702,29 @@ class WUGraph extends ChartPanel {
|
|
|
555
702
|
__publicField(this, "_maxAll", new Button().faChar("fa-window-maximize").tooltip("Max All").on("click", () => {
|
|
556
703
|
this.stateClick(this._maxAll);
|
|
557
704
|
}));
|
|
558
|
-
__publicField(this, "_toggleGraph", new ToggleButton().faChar("fa-chain").tooltip("Graph").selected(
|
|
705
|
+
__publicField(this, "_toggleGraph", new ToggleButton().faChar("fa-chain").tooltip("Graph").selected(true).on("click", () => {
|
|
559
706
|
this.viewClick(this._toggleGraph);
|
|
560
707
|
}));
|
|
561
|
-
__publicField(this, "_toggleActivities", new ToggleButton().faChar("fa-table").tooltip("Activitiies").selected(
|
|
708
|
+
__publicField(this, "_toggleActivities", new ToggleButton().faChar("fa-table").tooltip("Activitiies").selected(false).on("click", () => {
|
|
562
709
|
this.viewClick(this._toggleActivities);
|
|
563
710
|
}));
|
|
564
|
-
__publicField(this, "_toggleEdges", new ToggleButton().faChar("fa-table").tooltip("Edges").selected(
|
|
711
|
+
__publicField(this, "_toggleEdges", new ToggleButton().faChar("fa-table").tooltip("Edges").selected(false).on("click", () => {
|
|
565
712
|
this.viewClick(this._toggleEdges);
|
|
566
713
|
}));
|
|
567
|
-
__publicField(this, "_toggleSubgraphs", new ToggleButton().faChar("fa-table").tooltip("Subgraphs").selected(
|
|
714
|
+
__publicField(this, "_toggleSubgraphs", new ToggleButton().faChar("fa-table").tooltip("Subgraphs").selected(false).on("click", () => {
|
|
568
715
|
this.viewClick(this._toggleSubgraphs);
|
|
569
716
|
}));
|
|
570
|
-
__publicField(this, "_graph", new Graph().layout("Hierarchy").applyScaleOnLayout(
|
|
571
|
-
__publicField(this, "_activities", new Table().pagination(
|
|
572
|
-
__publicField(this, "_edges", new Table().pagination(
|
|
573
|
-
__publicField(this, "_subgraphs", new Table().pagination(
|
|
717
|
+
__publicField(this, "_graph", new Graph().layout("Hierarchy").applyScaleOnLayout(true).showToolbar(false).allowDragging(false));
|
|
718
|
+
__publicField(this, "_activities", new Table().pagination(false));
|
|
719
|
+
__publicField(this, "_edges", new Table().pagination(false));
|
|
720
|
+
__publicField(this, "_subgraphs", new Table().pagination(false));
|
|
574
721
|
__publicField(this, "_legend", new WUGraphLegend(this).on("click", (kind) => {
|
|
575
722
|
this.render();
|
|
576
723
|
}).on("mouseover", (kind) => {
|
|
577
724
|
const verticesMap = {};
|
|
578
|
-
for (const vertex of this._gc.vertices(kind))
|
|
579
|
-
verticesMap[vertex.id()] =
|
|
725
|
+
for (const vertex of this._gc.vertices(kind)) {
|
|
726
|
+
verticesMap[vertex.id()] = true;
|
|
727
|
+
}
|
|
580
728
|
this._graph.highlightVerticies(verticesMap);
|
|
581
729
|
}).on("mouseout", (kind) => {
|
|
582
730
|
this._graph.highlightVerticies();
|
|
@@ -585,7 +733,8 @@ class WUGraph extends ChartPanel {
|
|
|
585
733
|
__publicField(this, "_gc", new WUScopeController());
|
|
586
734
|
__publicField(this, "_prevHashSum");
|
|
587
735
|
__publicField(this, "_prevScopeGraph");
|
|
588
|
-
this.topOverlay(
|
|
736
|
+
this.topOverlay(false);
|
|
737
|
+
this.widget(this._view);
|
|
589
738
|
const buttons = [
|
|
590
739
|
this._toggleGraph,
|
|
591
740
|
this._toggleActivities,
|
|
@@ -598,11 +747,16 @@ class WUGraph extends ChartPanel {
|
|
|
598
747
|
...this._graph.iconBarButtons(),
|
|
599
748
|
new Spacer()
|
|
600
749
|
];
|
|
601
|
-
this.buttons(buttons.concat(this.buttons()))
|
|
602
|
-
|
|
750
|
+
this.buttons(buttons.concat(this.buttons()));
|
|
751
|
+
this._gc.minClick = (sg) => {
|
|
752
|
+
this.loadGraph();
|
|
753
|
+
this._graph.render((w) => {
|
|
603
754
|
this._graph.selection([sg]).centerOnItem(sg);
|
|
604
755
|
});
|
|
605
|
-
}
|
|
756
|
+
};
|
|
757
|
+
this._graph.tooltipHTML((v) => {
|
|
758
|
+
return this._gc.calcGraphTooltip(v);
|
|
759
|
+
});
|
|
606
760
|
}
|
|
607
761
|
stateClick(sourceB) {
|
|
608
762
|
switch (sourceB) {
|
|
@@ -620,7 +774,11 @@ class WUGraph extends ChartPanel {
|
|
|
620
774
|
this.render();
|
|
621
775
|
}
|
|
622
776
|
viewClick(sourceTB) {
|
|
623
|
-
|
|
777
|
+
this._toggleGraph.selected(sourceTB === this._toggleGraph);
|
|
778
|
+
this._toggleActivities.selected(sourceTB === this._toggleActivities);
|
|
779
|
+
this._toggleEdges.selected(sourceTB === this._toggleEdges);
|
|
780
|
+
this._toggleSubgraphs.selected(sourceTB === this._toggleSubgraphs);
|
|
781
|
+
switch (sourceTB) {
|
|
624
782
|
case this._toggleGraph:
|
|
625
783
|
this._view.active(0);
|
|
626
784
|
break;
|
|
@@ -644,11 +802,24 @@ class WUGraph extends ChartPanel {
|
|
|
644
802
|
graphID: this.graphID(),
|
|
645
803
|
subgraphID: this.subgraphID()
|
|
646
804
|
});
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
805
|
+
if (!this._prevScopeGraph || this._prevHashSum !== hash) {
|
|
806
|
+
this.startProgress();
|
|
807
|
+
this._prevHashSum = hash;
|
|
808
|
+
this._gc.clear();
|
|
809
|
+
const wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
810
|
+
return wu.fetchGraphs().then((graphs) => {
|
|
811
|
+
for (const graph of graphs) {
|
|
812
|
+
if (graph.Name === this.graphID()) {
|
|
813
|
+
this.finishProgress();
|
|
814
|
+
return graph.fetchScopeGraph(this.subgraphID());
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}).then((scopeGraph) => {
|
|
818
|
+
this._prevScopeGraph = scopeGraph;
|
|
819
|
+
return this._prevScopeGraph;
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
return Promise.resolve(this._prevScopeGraph);
|
|
652
823
|
}
|
|
653
824
|
enter(domNode, _element) {
|
|
654
825
|
super.enter(domNode, _element);
|
|
@@ -660,7 +831,8 @@ class WUGraph extends ChartPanel {
|
|
|
660
831
|
super.exit(domNode, element);
|
|
661
832
|
}
|
|
662
833
|
loadGraph() {
|
|
663
|
-
this._gc.disabled(this._legend.disabled())
|
|
834
|
+
this._gc.disabled(this._legend.disabled());
|
|
835
|
+
this._graph.data(this._gc.graphData(), true);
|
|
664
836
|
{
|
|
665
837
|
const { columns: columns2, data } = this._gc.activityData();
|
|
666
838
|
this._activities.columns(columns2).data(data);
|
|
@@ -675,16 +847,29 @@ class WUGraph extends ChartPanel {
|
|
|
675
847
|
}
|
|
676
848
|
}
|
|
677
849
|
render(callback) {
|
|
678
|
-
|
|
679
|
-
this.
|
|
680
|
-
|
|
850
|
+
if (this.wuid() && this.graphID()) {
|
|
851
|
+
this.fetchScopeGraph().then((scopedGraph) => {
|
|
852
|
+
this._gc.set(scopedGraph);
|
|
853
|
+
this._legend.data(this._gc.calcLegend());
|
|
854
|
+
this.loadGraph();
|
|
855
|
+
super.render(callback);
|
|
856
|
+
});
|
|
857
|
+
} else {
|
|
858
|
+
super.render(callback);
|
|
859
|
+
}
|
|
860
|
+
return this;
|
|
681
861
|
}
|
|
682
862
|
selection(_) {
|
|
683
863
|
if (!arguments.length) return this._graph.selection();
|
|
684
864
|
const item = this._gc.vertex(_) || this._gc.edge(_) || this._gc.subgraph(_);
|
|
685
|
-
|
|
865
|
+
if (item) {
|
|
866
|
+
this._graph.selection([item]);
|
|
867
|
+
}
|
|
868
|
+
return this;
|
|
686
869
|
}
|
|
687
|
-
}
|
|
870
|
+
};
|
|
871
|
+
__name(_WUGraph, "WUGraph");
|
|
872
|
+
let WUGraph = _WUGraph;
|
|
688
873
|
WUGraph.prototype._class += " eclwatch_WUGraph";
|
|
689
874
|
WUGraph.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
690
875
|
WUGraph.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
@@ -693,6 +878,7 @@ WUGraph.prototype.publish("subgraphID", "", "string", "Subgraph ID");
|
|
|
693
878
|
function entitiesEncode(str) {
|
|
694
879
|
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
695
880
|
}
|
|
881
|
+
__name(entitiesEncode, "entitiesEncode");
|
|
696
882
|
function safeEncode(item) {
|
|
697
883
|
switch (Object.prototype.toString.call(item)) {
|
|
698
884
|
case "[object Undefined]":
|
|
@@ -706,7 +892,8 @@ function safeEncode(item) {
|
|
|
706
892
|
}
|
|
707
893
|
return item;
|
|
708
894
|
}
|
|
709
|
-
|
|
895
|
+
__name(safeEncode, "safeEncode");
|
|
896
|
+
const _Store = class _Store {
|
|
710
897
|
constructor(wuResult, schema, renderHtml, filter = {}, onError) {
|
|
711
898
|
__publicField(this, "wuResult");
|
|
712
899
|
__publicField(this, "schema");
|
|
@@ -715,58 +902,84 @@ class Store {
|
|
|
715
902
|
__publicField(this, "rowFormatter");
|
|
716
903
|
__publicField(this, "_filter", {});
|
|
717
904
|
__publicField(this, "onError");
|
|
718
|
-
this.wuResult = wuResult
|
|
905
|
+
this.wuResult = wuResult;
|
|
906
|
+
this.schema = schema;
|
|
907
|
+
this._columns = this.schema2Columns(this.schema.root);
|
|
908
|
+
this.rowFormatter = new RowFormatter(this._columns, renderHtml);
|
|
909
|
+
this._filter = filter;
|
|
910
|
+
this.onError = onError;
|
|
719
911
|
}
|
|
720
912
|
columns() {
|
|
721
913
|
return this._columns;
|
|
722
914
|
}
|
|
723
915
|
schema2Columns(parentNode, prefix = "") {
|
|
724
|
-
|
|
725
|
-
|
|
916
|
+
if (!parentNode) return [];
|
|
917
|
+
return parentNode.children().filter((node) => node.name.indexOf("__hidden", node.name.length - "__hidden".length) === -1).map((node, idx) => {
|
|
918
|
+
const label = node.name;
|
|
919
|
+
const keyed = node.attrs["hpcc:keyed"];
|
|
920
|
+
const column = {
|
|
726
921
|
field: prefix + label,
|
|
727
922
|
leafID: label,
|
|
728
923
|
idx,
|
|
729
924
|
label: label + (keyed ? " (i)" : ""),
|
|
730
925
|
className: "resultGridCell",
|
|
731
|
-
sortable:
|
|
926
|
+
sortable: false,
|
|
732
927
|
width: keyed ? 16 : 0,
|
|
733
928
|
isSet: node.isSet
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
929
|
+
};
|
|
930
|
+
const children = this.schema2Columns(node, prefix + label + "_");
|
|
931
|
+
if (children.length) {
|
|
932
|
+
column.width += 10 + children.reduce((prev, childNode) => {
|
|
933
|
+
return prev + childNode.width;
|
|
934
|
+
}, 0);
|
|
935
|
+
column.children = children;
|
|
936
|
+
} else {
|
|
937
|
+
column.width += node.charWidth() * 9;
|
|
938
|
+
column.formatter = (cell, row) => {
|
|
939
|
+
switch (typeof cell) {
|
|
940
|
+
case "string":
|
|
941
|
+
return {
|
|
942
|
+
html: cell.replace(/\t/g, " ").trim()
|
|
943
|
+
};
|
|
944
|
+
case "undefined":
|
|
945
|
+
return "";
|
|
946
|
+
}
|
|
947
|
+
return cell;
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
return column;
|
|
951
|
+
});
|
|
747
952
|
}
|
|
748
953
|
isChildDataset(cell) {
|
|
749
|
-
if (Object.prototype.toString.call(cell) !== "[object Object]")
|
|
750
|
-
return
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
954
|
+
if (Object.prototype.toString.call(cell) !== "[object Object]") {
|
|
955
|
+
return false;
|
|
956
|
+
}
|
|
957
|
+
let propCount = 0;
|
|
958
|
+
let firstPropType = null;
|
|
959
|
+
for (const key in cell) {
|
|
960
|
+
if (!firstPropType) {
|
|
961
|
+
firstPropType = Object.prototype.toString.call(cell[key]);
|
|
962
|
+
}
|
|
963
|
+
propCount++;
|
|
964
|
+
}
|
|
754
965
|
return propCount === 1 && firstPropType === "[object Array]";
|
|
755
966
|
}
|
|
756
967
|
rowToTable(cell, __row, node) {
|
|
757
968
|
if (this.isChildDataset(cell)) {
|
|
758
|
-
for (const key in cell)
|
|
969
|
+
for (const key in cell) {
|
|
759
970
|
this.rowToTable(cell[key], __row, node);
|
|
971
|
+
}
|
|
760
972
|
return;
|
|
761
973
|
}
|
|
762
974
|
const table = domConstruct.create("table", { border: 1, cellspacing: 0, width: "100%" }, node);
|
|
763
975
|
switch (Object.prototype.toString.call(cell)) {
|
|
764
976
|
case "[object Object]":
|
|
765
977
|
let tr = domConstruct.create("tr", null, table);
|
|
766
|
-
for (const key in cell)
|
|
978
|
+
for (const key in cell) {
|
|
767
979
|
domConstruct.create("th", { innerHTML: safeEncode(key) }, tr);
|
|
980
|
+
}
|
|
768
981
|
tr = domConstruct.create("tr", null, table);
|
|
769
|
-
for (const key in cell)
|
|
982
|
+
for (const key in cell) {
|
|
770
983
|
switch (Object.prototype.toString.call(cell[key])) {
|
|
771
984
|
case "[object Object]":
|
|
772
985
|
case "[object Array]":
|
|
@@ -776,9 +989,10 @@ class Store {
|
|
|
776
989
|
domConstruct.create("td", { innerHTML: safeEncode(cell[key]) }, tr);
|
|
777
990
|
break;
|
|
778
991
|
}
|
|
992
|
+
}
|
|
779
993
|
break;
|
|
780
994
|
case "[object Array]":
|
|
781
|
-
for (let i = 0; i < cell.length; ++i)
|
|
995
|
+
for (let i = 0; i < cell.length; ++i) {
|
|
782
996
|
switch (Object.prototype.toString.call(cell[i])) {
|
|
783
997
|
case "[object Boolean]":
|
|
784
998
|
case "[object Number]":
|
|
@@ -789,26 +1003,30 @@ class Store {
|
|
|
789
1003
|
default:
|
|
790
1004
|
if (i === 0) {
|
|
791
1005
|
const tr2 = domConstruct.create("tr", null, table);
|
|
792
|
-
for (const key in cell[i])
|
|
1006
|
+
for (const key in cell[i]) {
|
|
793
1007
|
domConstruct.create("th", { innerHTML: safeEncode(key) }, tr2);
|
|
1008
|
+
}
|
|
794
1009
|
}
|
|
795
1010
|
domConstruct.create("tr", null, table);
|
|
796
|
-
for (const key in cell[i])
|
|
797
|
-
if (cell[i][key])
|
|
1011
|
+
for (const key in cell[i]) {
|
|
1012
|
+
if (cell[i][key]) {
|
|
798
1013
|
if (Object.prototype.toString.call(cell[i][key]) === "[object Object]" || Object.prototype.toString.call(cell[i][key]) === "[object Array]") {
|
|
799
1014
|
const td = domConstruct.create("td", null, tr1);
|
|
800
1015
|
this.rowToTable(cell[i][key], cell[i], td);
|
|
801
|
-
} else if (key.indexOf("__html", key.length -
|
|
1016
|
+
} else if (key.indexOf("__html", key.length - "__html".length) !== -1) {
|
|
802
1017
|
domConstruct.create("td", { innerHTML: cell[i][key] }, tr1);
|
|
803
|
-
else if (key.indexOf("__javascript", key.length -
|
|
1018
|
+
} else if (key.indexOf("__javascript", key.length - "__javascript".length) !== -1) {
|
|
804
1019
|
domConstruct.create("td", null, tr1);
|
|
805
|
-
else {
|
|
1020
|
+
} else {
|
|
806
1021
|
const val = cell[i][key];
|
|
807
1022
|
domConstruct.create("td", { innerHTML: safeEncode(val) }, tr1);
|
|
808
1023
|
}
|
|
809
|
-
else
|
|
1024
|
+
} else {
|
|
810
1025
|
domConstruct.create("td", { innerHTML: "" }, tr1);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
811
1028
|
}
|
|
1029
|
+
}
|
|
812
1030
|
break;
|
|
813
1031
|
}
|
|
814
1032
|
}
|
|
@@ -819,23 +1037,34 @@ class Store {
|
|
|
819
1037
|
if (!this.wuResult) return Promise.resolve({ totalLength: 0, data: [] });
|
|
820
1038
|
const cacheKey = `${start}->${end}`;
|
|
821
1039
|
if (this._cache[cacheKey]) return this._cache[cacheKey];
|
|
822
|
-
const retVal = this.wuResult.fetchRows(start, end - start,
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
1040
|
+
const retVal = this.wuResult.fetchRows(start, end - start, false, this._filter).then((rows) => {
|
|
1041
|
+
return {
|
|
1042
|
+
totalLength: this.wuResult.Total,
|
|
1043
|
+
data: rows.map((row, idx) => {
|
|
1044
|
+
const formattedRow = this.rowFormatter.format(row);
|
|
1045
|
+
formattedRow.__hpcc_id = start + idx;
|
|
1046
|
+
formattedRow.__hpcc_orig = row;
|
|
1047
|
+
return formattedRow;
|
|
1048
|
+
})
|
|
1049
|
+
};
|
|
1050
|
+
}).catch((err) => {
|
|
1051
|
+
this.onError(err.Message || "An exception has occurred");
|
|
1052
|
+
return { totalLength: 0, data: [] };
|
|
1053
|
+
});
|
|
1054
|
+
this._cache[cacheKey] = retVal;
|
|
1055
|
+
return retVal;
|
|
830
1056
|
}
|
|
831
1057
|
fetchRange(options) {
|
|
832
1058
|
const retVal = new Deferred();
|
|
833
|
-
|
|
1059
|
+
this._request(options.start, options.end).then((response) => retVal.resolve(response));
|
|
1060
|
+
return new QueryResults(retVal.then((response) => response.data), {
|
|
834
1061
|
totalLength: retVal.then((response) => response.totalLength)
|
|
835
1062
|
});
|
|
836
1063
|
}
|
|
837
|
-
}
|
|
838
|
-
|
|
1064
|
+
};
|
|
1065
|
+
__name(_Store, "Store");
|
|
1066
|
+
let Store = _Store;
|
|
1067
|
+
const _WUResult = class _WUResult extends Common {
|
|
839
1068
|
constructor() {
|
|
840
1069
|
super();
|
|
841
1070
|
__publicField(this, "_result");
|
|
@@ -843,7 +1072,7 @@ class WUResult extends Common {
|
|
|
843
1072
|
__publicField(this, "_prevResultHash");
|
|
844
1073
|
__publicField(this, "_prevStoreHash");
|
|
845
1074
|
__publicField(this, "_prevQueryHash");
|
|
846
|
-
this.renderHtml(
|
|
1075
|
+
this.renderHtml(false);
|
|
847
1076
|
}
|
|
848
1077
|
hashSum(opts = {}) {
|
|
849
1078
|
return hashSum({
|
|
@@ -867,13 +1096,24 @@ class WUResult extends Common {
|
|
|
867
1096
|
userID: this.user(),
|
|
868
1097
|
password: this.password()
|
|
869
1098
|
};
|
|
870
|
-
|
|
1099
|
+
if (this.wuid() && this.resultName()) {
|
|
1100
|
+
this._result = Result.attach(opts, this.wuid(), this.resultName());
|
|
1101
|
+
} else if (this.wuid() && this.sequence() !== void 0) {
|
|
1102
|
+
this._result = Result.attach(opts, this.wuid(), this.sequence());
|
|
1103
|
+
} else if (this.logicalFile() && this.nodeGroup()) {
|
|
1104
|
+
this._result = Result.attachLogicalFile(opts, this.nodeGroup(), this.logicalFile());
|
|
1105
|
+
} else if (this.logicalFile()) {
|
|
1106
|
+
this._result = Result.attachLogicalFile(opts, "", this.logicalFile());
|
|
1107
|
+
}
|
|
871
1108
|
}
|
|
872
1109
|
return this._result;
|
|
873
1110
|
}
|
|
874
1111
|
fetch(row, count, abortController = new AbortController()) {
|
|
875
1112
|
const result = this.calcResult();
|
|
876
|
-
|
|
1113
|
+
if (result) {
|
|
1114
|
+
return result.fetchRows(row, count, false, {}, abortController.signal);
|
|
1115
|
+
}
|
|
1116
|
+
return Promise.resolve([]);
|
|
877
1117
|
}
|
|
878
1118
|
update(domNode, element) {
|
|
879
1119
|
super.update(domNode, element);
|
|
@@ -884,17 +1124,26 @@ class WUResult extends Common {
|
|
|
884
1124
|
if (this._prevStoreHash !== storeHash) {
|
|
885
1125
|
this._prevStoreHash = storeHash;
|
|
886
1126
|
const result = this.calcResult();
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
this.
|
|
891
|
-
|
|
892
|
-
|
|
1127
|
+
if (result) {
|
|
1128
|
+
result.fetchXMLSchema().then((schema) => {
|
|
1129
|
+
var _a, _b;
|
|
1130
|
+
this._localStore = new Store(result, schema, this.renderHtml(), this.filter(), (msg) => {
|
|
1131
|
+
if (this._dgrid) {
|
|
1132
|
+
this._dgrid.noDataMessage = `<span class='dojoxGridNoData'>${msg}</span>`;
|
|
1133
|
+
this._dgrid.refresh();
|
|
1134
|
+
}
|
|
1135
|
+
});
|
|
1136
|
+
(_a = this._dgrid) == null ? void 0 : _a.set("columns", this._localStore.columns());
|
|
1137
|
+
(_b = this._dgrid) == null ? void 0 : _b.set("collection", this._localStore);
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
893
1140
|
}
|
|
894
1141
|
}
|
|
895
1142
|
click(row, col, sel) {
|
|
896
1143
|
}
|
|
897
|
-
}
|
|
1144
|
+
};
|
|
1145
|
+
__name(_WUResult, "WUResult");
|
|
1146
|
+
let WUResult = _WUResult;
|
|
898
1147
|
WUResult.prototype._class += " eclwatch_WUResult";
|
|
899
1148
|
WUResult.prototype.publish("baseUrl", "", "string", "URL to WsWorkunits");
|
|
900
1149
|
WUResult.prototype.publish("user", "", "string", "User ID");
|
|
@@ -905,8 +1154,21 @@ WUResult.prototype.publish("sequence", void 0, "number", "Sequence Number");
|
|
|
905
1154
|
WUResult.prototype.publish("nodeGroup", "", "string", "NodeGroup");
|
|
906
1155
|
WUResult.prototype.publish("logicalFile", "", "string", "Logical File Name");
|
|
907
1156
|
WUResult.prototype.publish("filter", {}, "object", "Filter");
|
|
908
|
-
var STATUS = /* @__PURE__ */ ((STATUS2) =>
|
|
909
|
-
|
|
1157
|
+
var STATUS = /* @__PURE__ */ ((STATUS2) => {
|
|
1158
|
+
STATUS2["CREATE"] = "Created";
|
|
1159
|
+
STATUS2["COMPILE"] = "Compiled";
|
|
1160
|
+
STATUS2["EXECUTE"] = "Executed";
|
|
1161
|
+
STATUS2["COMPLETE"] = "Completed";
|
|
1162
|
+
return STATUS2;
|
|
1163
|
+
})(STATUS || {});
|
|
1164
|
+
var STATUS_ACTIVE = /* @__PURE__ */ ((STATUS_ACTIVE2) => {
|
|
1165
|
+
STATUS_ACTIVE2["CREATE"] = "Creating";
|
|
1166
|
+
STATUS_ACTIVE2["COMPILE"] = "Compiling";
|
|
1167
|
+
STATUS_ACTIVE2["EXECUTE"] = "Executing";
|
|
1168
|
+
STATUS_ACTIVE2["COMPLETE"] = "Completed";
|
|
1169
|
+
return STATUS_ACTIVE2;
|
|
1170
|
+
})(STATUS_ACTIVE || {});
|
|
1171
|
+
const _WUStatus = class _WUStatus extends Graph {
|
|
910
1172
|
constructor() {
|
|
911
1173
|
super();
|
|
912
1174
|
__publicField(this, "_wu");
|
|
@@ -916,16 +1178,23 @@ class WUStatus extends Graph {
|
|
|
916
1178
|
__publicField(this, "_execute");
|
|
917
1179
|
__publicField(this, "_complete");
|
|
918
1180
|
__publicField(this, "_prevHash");
|
|
919
|
-
this.zoomable(
|
|
1181
|
+
this.zoomable(false).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(false).allowDragging(false);
|
|
920
1182
|
}
|
|
921
1183
|
attachWorkunit() {
|
|
922
1184
|
const hash = hashSum({
|
|
923
1185
|
baseUrl: this.baseUrl(),
|
|
924
1186
|
wuid: this.wuid()
|
|
925
1187
|
});
|
|
926
|
-
|
|
927
|
-
this.
|
|
928
|
-
|
|
1188
|
+
if (this._prevHash !== hash) {
|
|
1189
|
+
this._prevHash = hash;
|
|
1190
|
+
this._wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
1191
|
+
if (this._wuHandle) {
|
|
1192
|
+
this._wuHandle.release();
|
|
1193
|
+
}
|
|
1194
|
+
this._wuHandle = this._wu.watch((changes) => {
|
|
1195
|
+
this.lazyRender();
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
929
1198
|
}
|
|
930
1199
|
createVertex(faChar) {
|
|
931
1200
|
return new Vertex().icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(faChar);
|
|
@@ -933,60 +1202,89 @@ class WUStatus extends Graph {
|
|
|
933
1202
|
updateVertex(vertex, color) {
|
|
934
1203
|
vertex.icon_image_colorFill(color).textbox_text_colorFill(color);
|
|
935
1204
|
}
|
|
936
|
-
updateVertexStatus(level, active =
|
|
1205
|
+
updateVertexStatus(level, active = false) {
|
|
937
1206
|
const completeColor = this._wu.isFailed() ? "darkred" : "darkgreen";
|
|
938
|
-
|
|
1207
|
+
this._create.text(
|
|
939
1208
|
"Created"
|
|
940
1209
|
/* CREATE */
|
|
941
|
-
)
|
|
1210
|
+
);
|
|
1211
|
+
this._compile.text(
|
|
942
1212
|
"Compiled"
|
|
943
1213
|
/* COMPILE */
|
|
944
|
-
)
|
|
1214
|
+
);
|
|
1215
|
+
this._execute.text(
|
|
945
1216
|
"Executed"
|
|
946
1217
|
/* EXECUTE */
|
|
947
|
-
)
|
|
1218
|
+
);
|
|
1219
|
+
this._complete.text(
|
|
948
1220
|
"Completed"
|
|
949
1221
|
/* COMPLETE */
|
|
950
|
-
)
|
|
1222
|
+
);
|
|
1223
|
+
switch (level) {
|
|
951
1224
|
case 0:
|
|
952
|
-
this.updateVertex(this._create, "darkgray")
|
|
1225
|
+
this.updateVertex(this._create, "darkgray");
|
|
1226
|
+
this.updateVertex(this._compile, "darkgray");
|
|
1227
|
+
this.updateVertex(this._execute, "darkgray");
|
|
1228
|
+
this.updateVertex(this._complete, "darkgray");
|
|
953
1229
|
break;
|
|
954
1230
|
case 1:
|
|
955
1231
|
this._create.text(
|
|
956
1232
|
"Creating"
|
|
957
1233
|
/* CREATE */
|
|
958
|
-
)
|
|
1234
|
+
);
|
|
1235
|
+
this.updateVertex(this._create, active ? "orange" : completeColor);
|
|
1236
|
+
this.updateVertex(this._compile, "darkgray");
|
|
1237
|
+
this.updateVertex(this._execute, "darkgray");
|
|
1238
|
+
this.updateVertex(this._complete, "darkgray");
|
|
959
1239
|
break;
|
|
960
1240
|
case 2:
|
|
961
1241
|
this._compile.text(
|
|
962
1242
|
"Compiling"
|
|
963
1243
|
/* COMPILE */
|
|
964
|
-
)
|
|
1244
|
+
);
|
|
1245
|
+
this.updateVertex(this._create, completeColor);
|
|
1246
|
+
this.updateVertex(this._compile, active ? "orange" : completeColor);
|
|
1247
|
+
this.updateVertex(this._execute, completeColor);
|
|
1248
|
+
this.updateVertex(this._complete, "darkgray");
|
|
965
1249
|
break;
|
|
966
1250
|
case 3:
|
|
967
1251
|
this._execute.text(
|
|
968
1252
|
"Executing"
|
|
969
1253
|
/* EXECUTE */
|
|
970
|
-
)
|
|
1254
|
+
);
|
|
1255
|
+
this.updateVertex(this._create, completeColor);
|
|
1256
|
+
this.updateVertex(this._compile, completeColor);
|
|
1257
|
+
this.updateVertex(this._execute, active ? "orange" : completeColor);
|
|
1258
|
+
this.updateVertex(this._complete, "darkgray");
|
|
971
1259
|
break;
|
|
972
1260
|
case 4:
|
|
973
|
-
this.updateVertex(this._create, completeColor)
|
|
1261
|
+
this.updateVertex(this._create, completeColor);
|
|
1262
|
+
this.updateVertex(this._compile, completeColor);
|
|
1263
|
+
this.updateVertex(this._execute, completeColor);
|
|
1264
|
+
this.updateVertex(this._complete, completeColor);
|
|
974
1265
|
break;
|
|
975
1266
|
}
|
|
976
1267
|
}
|
|
977
1268
|
createEdge(source, target) {
|
|
978
|
-
return new Edge$1().sourceVertex(source).targetVertex(target).strokeColor("black").showArc(
|
|
1269
|
+
return new Edge$1().sourceVertex(source).targetVertex(target).strokeColor("black").showArc(false);
|
|
979
1270
|
}
|
|
980
1271
|
enter(domNode, element) {
|
|
981
|
-
super.enter(domNode, element)
|
|
982
|
-
|
|
1272
|
+
super.enter(domNode, element);
|
|
1273
|
+
this._create = this.createVertex("");
|
|
1274
|
+
this._compile = this.createVertex("");
|
|
1275
|
+
this._execute = this.createVertex("");
|
|
1276
|
+
this._complete = this.createVertex("");
|
|
1277
|
+
const e1 = this.createEdge(this._create, this._compile);
|
|
1278
|
+
const e2 = this.createEdge(this._compile, this._execute);
|
|
1279
|
+
const e3 = this.createEdge(this._execute, this._complete);
|
|
983
1280
|
this.data({
|
|
984
1281
|
vertices: [this._create, this._compile, this._execute, this._complete],
|
|
985
1282
|
edges: [e1, e2, e3]
|
|
986
1283
|
});
|
|
987
1284
|
}
|
|
988
1285
|
update(domNode, element) {
|
|
989
|
-
|
|
1286
|
+
this.attachWorkunit();
|
|
1287
|
+
switch (this._wu.StateID) {
|
|
990
1288
|
case WUStateID.Blocked:
|
|
991
1289
|
case WUStateID.Wait:
|
|
992
1290
|
case WUStateID.Scheduled:
|
|
@@ -994,17 +1292,17 @@ class WUStatus extends Graph {
|
|
|
994
1292
|
this.updateVertexStatus(1);
|
|
995
1293
|
break;
|
|
996
1294
|
case WUStateID.Compiling:
|
|
997
|
-
this.updateVertexStatus(2,
|
|
1295
|
+
this.updateVertexStatus(2, true);
|
|
998
1296
|
break;
|
|
999
1297
|
case WUStateID.Submitted:
|
|
1000
|
-
this.updateVertexStatus(1,
|
|
1298
|
+
this.updateVertexStatus(1, true);
|
|
1001
1299
|
break;
|
|
1002
1300
|
case WUStateID.Compiled:
|
|
1003
1301
|
this.updateVertexStatus(2);
|
|
1004
1302
|
break;
|
|
1005
1303
|
case WUStateID.Aborting:
|
|
1006
1304
|
case WUStateID.Running:
|
|
1007
|
-
this.updateVertexStatus(3,
|
|
1305
|
+
this.updateVertexStatus(3, true);
|
|
1008
1306
|
break;
|
|
1009
1307
|
case WUStateID.Aborted:
|
|
1010
1308
|
case WUStateID.Archived:
|
|
@@ -1012,7 +1310,7 @@ class WUStatus extends Graph {
|
|
|
1012
1310
|
this.updateVertexStatus(4);
|
|
1013
1311
|
break;
|
|
1014
1312
|
case WUStateID.Failed:
|
|
1015
|
-
this.updateVertexStatus(4,
|
|
1313
|
+
this.updateVertexStatus(4, false);
|
|
1016
1314
|
break;
|
|
1017
1315
|
case WUStateID.DebugPaused:
|
|
1018
1316
|
case WUStateID.DebugRunning:
|
|
@@ -1022,25 +1320,34 @@ class WUStatus extends Graph {
|
|
|
1022
1320
|
this.updateVertexStatus(0);
|
|
1023
1321
|
break;
|
|
1024
1322
|
}
|
|
1025
|
-
super.update(domNode, element)
|
|
1323
|
+
super.update(domNode, element);
|
|
1324
|
+
this.zoomToFit();
|
|
1026
1325
|
}
|
|
1027
1326
|
exit(domNode, element) {
|
|
1028
|
-
|
|
1327
|
+
if (this._wuHandle) {
|
|
1328
|
+
this._wuHandle.release();
|
|
1329
|
+
}
|
|
1330
|
+
super.exit(domNode, element);
|
|
1029
1331
|
}
|
|
1030
|
-
}
|
|
1332
|
+
};
|
|
1333
|
+
__name(_WUStatus, "WUStatus");
|
|
1334
|
+
let WUStatus = _WUStatus;
|
|
1031
1335
|
WUStatus.prototype._class += " eclwatch_WUStatus";
|
|
1032
1336
|
WUStatus.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
1033
1337
|
WUStatus.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
1034
1338
|
const columns = ["label", "start", "end", "icon", "color", "series"];
|
|
1035
|
-
class
|
|
1339
|
+
const _WUTimeline = class _WUTimeline extends ReactTimelineSeries {
|
|
1036
1340
|
constructor() {
|
|
1037
1341
|
super();
|
|
1038
1342
|
__publicField(this, "_palette", Palette.ordinal("default"));
|
|
1039
1343
|
__publicField(this, "_prevHashSum");
|
|
1040
|
-
this.columns(columns).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormat("%H:%M").tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML((d) =>
|
|
1344
|
+
this.columns(columns).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormat("%H:%M").tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML((d) => {
|
|
1345
|
+
return d[columns.length].calcTooltip();
|
|
1346
|
+
});
|
|
1041
1347
|
}
|
|
1042
1348
|
clear() {
|
|
1043
|
-
|
|
1349
|
+
delete this._prevHashSum;
|
|
1350
|
+
return this;
|
|
1044
1351
|
}
|
|
1045
1352
|
fetchScopes() {
|
|
1046
1353
|
const hash = hashSum({
|
|
@@ -1048,31 +1355,41 @@ class WUTimeline extends ReactTimelineSeries {
|
|
|
1048
1355
|
wuid: this.wuid(),
|
|
1049
1356
|
request: this.request()
|
|
1050
1357
|
});
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1358
|
+
if (this._prevHashSum !== hash) {
|
|
1359
|
+
this._prevHashSum = hash;
|
|
1360
|
+
const wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
1361
|
+
wu.fetchDetails(this.request()).then((scopes) => {
|
|
1362
|
+
return scopes.filter((scope) => scope.Id && scope.attr("WhenStarted").RawValue).map((scope) => {
|
|
1363
|
+
const whenStarted = +scope.attr("WhenStarted").RawValue / 1e3;
|
|
1364
|
+
const timeElapsed = +scope.attr("TimeElapsed").RawValue / 1e6;
|
|
1365
|
+
return [
|
|
1366
|
+
scope.Id,
|
|
1367
|
+
new Date(whenStarted).toISOString(),
|
|
1368
|
+
timeElapsed ? new Date(whenStarted + timeElapsed).toISOString() : void 0,
|
|
1369
|
+
null,
|
|
1370
|
+
this._palette(scope.ScopeType),
|
|
1371
|
+
scope.ScopeName.split("::").join(":").split(":").slice(0, 1),
|
|
1372
|
+
scope
|
|
1373
|
+
];
|
|
1374
|
+
});
|
|
1375
|
+
}).then((scopes) => {
|
|
1376
|
+
this.data(scopes).render();
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1065
1379
|
}
|
|
1066
1380
|
enter(domNode, _element) {
|
|
1067
1381
|
super.enter(domNode, _element);
|
|
1068
1382
|
}
|
|
1069
1383
|
update(domNode, element) {
|
|
1070
|
-
this.fetchScopes()
|
|
1384
|
+
this.fetchScopes();
|
|
1385
|
+
super.update(domNode, element);
|
|
1071
1386
|
}
|
|
1072
1387
|
exit(domNode, element) {
|
|
1073
1388
|
super.exit(domNode, element);
|
|
1074
1389
|
}
|
|
1075
|
-
}
|
|
1390
|
+
};
|
|
1391
|
+
__name(_WUTimeline, "WUTimeline");
|
|
1392
|
+
let WUTimeline = _WUTimeline;
|
|
1076
1393
|
WUTimeline.prototype._class += " eclwatch_WUTimeline";
|
|
1077
1394
|
WUTimeline.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
1078
1395
|
WUTimeline.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
@@ -1086,23 +1403,23 @@ WUTimeline.prototype.publish("request", {
|
|
|
1086
1403
|
ScopeTypes: []
|
|
1087
1404
|
},
|
|
1088
1405
|
PropertiesToReturn: {
|
|
1089
|
-
AllProperties:
|
|
1090
|
-
AllStatistics:
|
|
1091
|
-
AllHints:
|
|
1406
|
+
AllProperties: false,
|
|
1407
|
+
AllStatistics: true,
|
|
1408
|
+
AllHints: false,
|
|
1092
1409
|
Properties: ["WhenStarted", "TimeElapsed"]
|
|
1093
1410
|
},
|
|
1094
1411
|
ScopeOptions: {
|
|
1095
|
-
IncludeId:
|
|
1096
|
-
IncludeScope:
|
|
1097
|
-
IncludeScopeType:
|
|
1412
|
+
IncludeId: true,
|
|
1413
|
+
IncludeScope: true,
|
|
1414
|
+
IncludeScopeType: true
|
|
1098
1415
|
},
|
|
1099
1416
|
PropertyOptions: {
|
|
1100
|
-
IncludeName:
|
|
1101
|
-
IncludeRawValue:
|
|
1102
|
-
IncludeFormatted:
|
|
1103
|
-
IncludeMeasure:
|
|
1104
|
-
IncludeCreator:
|
|
1105
|
-
IncludeCreatorType:
|
|
1417
|
+
IncludeName: true,
|
|
1418
|
+
IncludeRawValue: true,
|
|
1419
|
+
IncludeFormatted: true,
|
|
1420
|
+
IncludeMeasure: true,
|
|
1421
|
+
IncludeCreator: false,
|
|
1422
|
+
IncludeCreatorType: false
|
|
1106
1423
|
}
|
|
1107
1424
|
}, "object", "WUDetails Request");
|
|
1108
1425
|
export {
|
|
@@ -1119,4 +1436,4 @@ export {
|
|
|
1119
1436
|
WUTimeline
|
|
1120
1437
|
};
|
|
1121
1438
|
//# sourceMappingURL=index.js.map
|
|
1122
|
-
|
|
1439
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}.eclwatch_WUGraph .graph_Vertex{cursor:auto}.eclwatch_WUGraph .marker{fill:#656565;stroke:none;stroke-width:1px}.eclwatch_WUGraph .zoom{fill:none;pointer-events:all}.eclwatch_WUGraph .selectionBrush{fill:none;stroke:#a9a9a9}.d3-tip .eclwatch_WUGraph_Tooltip h3,.d3-tip .eclwatch_WUGraph_Tooltip h4{margin:0}.d3-tip .eclwatch_WUGraph_Tooltip table{border-collapse:separate;border-spacing:5px}.d3-tip .eclwatch_WUGraph_Tooltip table .key{font-weight:700}.d3-tip .eclwatch_WUGraph_Tooltip table .value{font-weight:400}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|