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