@hpcc-js/eclwatch 2.77.7 → 2.77.8
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/LICENSE +43 -43
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +10 -10
- package/src/ECLArchiveViewer.ts +160 -160
- package/src/WUGraph.css +40 -40
- package/src/WUGraph.ts +265 -265
- package/src/WUGraphLegend.css +7 -7
- package/src/WUGraphLegend.ts +126 -126
- package/src/WUResult.ts +111 -111
- package/src/WUResultStore.ts +202 -202
- package/src/WUScopeController.ts +548 -548
- package/src/WUStatus.ts +206 -206
- package/src/WUTimeline.ts +122 -122
- package/src/__package__.ts +3 -3
- package/src/index.ts +7 -7
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/src/WUStatus.ts
CHANGED
|
@@ -1,206 +1,206 @@
|
|
|
1
|
-
import { Workunit, WUStateID } from "@hpcc-js/comms";
|
|
2
|
-
import { Edge, Graph, Vertex } from "@hpcc-js/graph";
|
|
3
|
-
import { hashSum, IObserverHandle } from "@hpcc-js/util";
|
|
4
|
-
|
|
5
|
-
export enum STATUS {
|
|
6
|
-
CREATE = "Created",
|
|
7
|
-
COMPILE = "Compiled",
|
|
8
|
-
EXECUTE = "Executed",
|
|
9
|
-
COMPLETE = "Completed"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export enum STATUS_ACTIVE {
|
|
13
|
-
CREATE = "Creating",
|
|
14
|
-
COMPILE = "Compiling",
|
|
15
|
-
EXECUTE = "Executing",
|
|
16
|
-
COMPLETE = "Completed"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class WUStatus extends Graph {
|
|
20
|
-
|
|
21
|
-
protected _wu: Workunit;
|
|
22
|
-
protected _wuHandle: IObserverHandle;
|
|
23
|
-
|
|
24
|
-
protected _create: Vertex;
|
|
25
|
-
protected _compile: Vertex;
|
|
26
|
-
protected _execute: Vertex;
|
|
27
|
-
protected _complete: Vertex;
|
|
28
|
-
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
|
-
this
|
|
32
|
-
.zoomable(false)
|
|
33
|
-
.zoomToFitLimit(1)
|
|
34
|
-
.layout("Hierarchy")
|
|
35
|
-
.hierarchyRankDirection("LR")
|
|
36
|
-
.showToolbar(false)
|
|
37
|
-
.allowDragging(false)
|
|
38
|
-
;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private _prevHash;
|
|
42
|
-
attachWorkunit() {
|
|
43
|
-
const hash = hashSum({
|
|
44
|
-
baseUrl: this.baseUrl(),
|
|
45
|
-
wuid: this.wuid()
|
|
46
|
-
});
|
|
47
|
-
if (this._prevHash !== hash) {
|
|
48
|
-
this._prevHash = hash;
|
|
49
|
-
this._wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
50
|
-
if (this._wuHandle) {
|
|
51
|
-
this._wuHandle.release();
|
|
52
|
-
}
|
|
53
|
-
this._wuHandle = this._wu.watch(changes => {
|
|
54
|
-
this.lazyRender();
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
createVertex(faChar: string) {
|
|
60
|
-
return new Vertex()
|
|
61
|
-
.icon_diameter(32)
|
|
62
|
-
.icon_shape_colorFill("none")
|
|
63
|
-
.icon_shape_colorStroke("none")
|
|
64
|
-
.icon_image_colorFill("darkgray")
|
|
65
|
-
.iconAnchor("middle")
|
|
66
|
-
.textbox_shape_colorFill("none")
|
|
67
|
-
.textbox_shape_colorStroke("none")
|
|
68
|
-
.textbox_text_colorFill("darkgray")
|
|
69
|
-
.faChar(faChar)
|
|
70
|
-
;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
updateVertex(vertex: Vertex, color: string) {
|
|
74
|
-
vertex
|
|
75
|
-
.icon_image_colorFill(color)
|
|
76
|
-
.textbox_text_colorFill(color)
|
|
77
|
-
;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
updateVertexStatus(level: 0 | 1 | 2 | 3 | 4, active: boolean = false) {
|
|
81
|
-
const completeColor = this._wu.isFailed() ? "darkred" : "darkgreen";
|
|
82
|
-
this._create.text(STATUS.CREATE);
|
|
83
|
-
this._compile.text(STATUS.COMPILE);
|
|
84
|
-
this._execute.text(STATUS.EXECUTE);
|
|
85
|
-
this._complete.text(STATUS.COMPLETE);
|
|
86
|
-
switch (level) {
|
|
87
|
-
case 0:
|
|
88
|
-
this.updateVertex(this._create, "darkgray");
|
|
89
|
-
this.updateVertex(this._compile, "darkgray");
|
|
90
|
-
this.updateVertex(this._execute, "darkgray");
|
|
91
|
-
this.updateVertex(this._complete, "darkgray");
|
|
92
|
-
break;
|
|
93
|
-
case 1:
|
|
94
|
-
this._create.text(STATUS_ACTIVE.CREATE);
|
|
95
|
-
this.updateVertex(this._create, active ? "orange" : completeColor);
|
|
96
|
-
this.updateVertex(this._compile, "darkgray");
|
|
97
|
-
this.updateVertex(this._execute, "darkgray");
|
|
98
|
-
this.updateVertex(this._complete, "darkgray");
|
|
99
|
-
break;
|
|
100
|
-
case 2:
|
|
101
|
-
this._compile.text(STATUS_ACTIVE.COMPILE);
|
|
102
|
-
this.updateVertex(this._create, completeColor);
|
|
103
|
-
this.updateVertex(this._compile, active ? "orange" : completeColor);
|
|
104
|
-
this.updateVertex(this._execute, completeColor);
|
|
105
|
-
this.updateVertex(this._complete, "darkgray");
|
|
106
|
-
break;
|
|
107
|
-
case 3:
|
|
108
|
-
this._execute.text(STATUS_ACTIVE.EXECUTE);
|
|
109
|
-
this.updateVertex(this._create, completeColor);
|
|
110
|
-
this.updateVertex(this._compile, completeColor);
|
|
111
|
-
this.updateVertex(this._execute, active ? "orange" : completeColor);
|
|
112
|
-
this.updateVertex(this._complete, "darkgray");
|
|
113
|
-
break;
|
|
114
|
-
case 4:
|
|
115
|
-
this.updateVertex(this._create, completeColor);
|
|
116
|
-
this.updateVertex(this._compile, completeColor);
|
|
117
|
-
this.updateVertex(this._execute, completeColor);
|
|
118
|
-
this.updateVertex(this._complete, completeColor);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
createEdge(source, target) {
|
|
124
|
-
return new Edge()
|
|
125
|
-
.sourceVertex(source)
|
|
126
|
-
.targetVertex(target)
|
|
127
|
-
.strokeColor("black")
|
|
128
|
-
.showArc(false)
|
|
129
|
-
;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
enter(domNode, element) {
|
|
133
|
-
super.enter(domNode, element);
|
|
134
|
-
this._create = this.createVertex("\uf11d");
|
|
135
|
-
this._compile = this.createVertex("\uf085");
|
|
136
|
-
this._execute = this.createVertex("\uf275");
|
|
137
|
-
this._complete = this.createVertex("\uf11e");
|
|
138
|
-
const e1 = this.createEdge(this._create, this._compile);
|
|
139
|
-
const e2 = this.createEdge(this._compile, this._execute);
|
|
140
|
-
const e3 = this.createEdge(this._execute, this._complete);
|
|
141
|
-
this.data({
|
|
142
|
-
vertices: [this._create, this._compile, this._execute, this._complete],
|
|
143
|
-
edges: [e1, e2, e3]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
update(domNode, element) {
|
|
148
|
-
this.attachWorkunit();
|
|
149
|
-
switch (this._wu.StateID) {
|
|
150
|
-
case WUStateID.Blocked:
|
|
151
|
-
case WUStateID.Wait:
|
|
152
|
-
case WUStateID.Scheduled:
|
|
153
|
-
case WUStateID.UploadingFiled:
|
|
154
|
-
this.updateVertexStatus(1);
|
|
155
|
-
break;
|
|
156
|
-
case WUStateID.Compiling:
|
|
157
|
-
this.updateVertexStatus(2, true);
|
|
158
|
-
break;
|
|
159
|
-
case WUStateID.Submitted:
|
|
160
|
-
this.updateVertexStatus(1, true);
|
|
161
|
-
break;
|
|
162
|
-
case WUStateID.Compiled:
|
|
163
|
-
this.updateVertexStatus(2);
|
|
164
|
-
break;
|
|
165
|
-
case WUStateID.Aborting:
|
|
166
|
-
case WUStateID.Running:
|
|
167
|
-
this.updateVertexStatus(3, true);
|
|
168
|
-
break;
|
|
169
|
-
case WUStateID.Aborted:
|
|
170
|
-
case WUStateID.Archived:
|
|
171
|
-
case WUStateID.Completed:
|
|
172
|
-
this.updateVertexStatus(4);
|
|
173
|
-
break;
|
|
174
|
-
case WUStateID.Failed:
|
|
175
|
-
this.updateVertexStatus(4, false);
|
|
176
|
-
break;
|
|
177
|
-
case WUStateID.DebugPaused:
|
|
178
|
-
case WUStateID.DebugRunning:
|
|
179
|
-
case WUStateID.Paused:
|
|
180
|
-
case WUStateID.Unknown:
|
|
181
|
-
default:
|
|
182
|
-
this.updateVertexStatus(0);
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
super.update(domNode, element);
|
|
186
|
-
this.zoomToFit();
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
exit(domNode, element) {
|
|
190
|
-
if (this._wuHandle) {
|
|
191
|
-
this._wuHandle.release();
|
|
192
|
-
}
|
|
193
|
-
super.exit(domNode, element);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
WUStatus.prototype._class += " eclwatch_WUStatus";
|
|
197
|
-
|
|
198
|
-
export interface WUStatus {
|
|
199
|
-
baseUrl(): string;
|
|
200
|
-
baseUrl(_: string): this;
|
|
201
|
-
wuid(): string;
|
|
202
|
-
wuid(_: string): this;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
WUStatus.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
206
|
-
WUStatus.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
1
|
+
import { Workunit, WUStateID } from "@hpcc-js/comms";
|
|
2
|
+
import { Edge, Graph, Vertex } from "@hpcc-js/graph";
|
|
3
|
+
import { hashSum, IObserverHandle } from "@hpcc-js/util";
|
|
4
|
+
|
|
5
|
+
export enum STATUS {
|
|
6
|
+
CREATE = "Created",
|
|
7
|
+
COMPILE = "Compiled",
|
|
8
|
+
EXECUTE = "Executed",
|
|
9
|
+
COMPLETE = "Completed"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum STATUS_ACTIVE {
|
|
13
|
+
CREATE = "Creating",
|
|
14
|
+
COMPILE = "Compiling",
|
|
15
|
+
EXECUTE = "Executing",
|
|
16
|
+
COMPLETE = "Completed"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class WUStatus extends Graph {
|
|
20
|
+
|
|
21
|
+
protected _wu: Workunit;
|
|
22
|
+
protected _wuHandle: IObserverHandle;
|
|
23
|
+
|
|
24
|
+
protected _create: Vertex;
|
|
25
|
+
protected _compile: Vertex;
|
|
26
|
+
protected _execute: Vertex;
|
|
27
|
+
protected _complete: Vertex;
|
|
28
|
+
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this
|
|
32
|
+
.zoomable(false)
|
|
33
|
+
.zoomToFitLimit(1)
|
|
34
|
+
.layout("Hierarchy")
|
|
35
|
+
.hierarchyRankDirection("LR")
|
|
36
|
+
.showToolbar(false)
|
|
37
|
+
.allowDragging(false)
|
|
38
|
+
;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private _prevHash;
|
|
42
|
+
attachWorkunit() {
|
|
43
|
+
const hash = hashSum({
|
|
44
|
+
baseUrl: this.baseUrl(),
|
|
45
|
+
wuid: this.wuid()
|
|
46
|
+
});
|
|
47
|
+
if (this._prevHash !== hash) {
|
|
48
|
+
this._prevHash = hash;
|
|
49
|
+
this._wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
50
|
+
if (this._wuHandle) {
|
|
51
|
+
this._wuHandle.release();
|
|
52
|
+
}
|
|
53
|
+
this._wuHandle = this._wu.watch(changes => {
|
|
54
|
+
this.lazyRender();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
createVertex(faChar: string) {
|
|
60
|
+
return new Vertex()
|
|
61
|
+
.icon_diameter(32)
|
|
62
|
+
.icon_shape_colorFill("none")
|
|
63
|
+
.icon_shape_colorStroke("none")
|
|
64
|
+
.icon_image_colorFill("darkgray")
|
|
65
|
+
.iconAnchor("middle")
|
|
66
|
+
.textbox_shape_colorFill("none")
|
|
67
|
+
.textbox_shape_colorStroke("none")
|
|
68
|
+
.textbox_text_colorFill("darkgray")
|
|
69
|
+
.faChar(faChar)
|
|
70
|
+
;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
updateVertex(vertex: Vertex, color: string) {
|
|
74
|
+
vertex
|
|
75
|
+
.icon_image_colorFill(color)
|
|
76
|
+
.textbox_text_colorFill(color)
|
|
77
|
+
;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
updateVertexStatus(level: 0 | 1 | 2 | 3 | 4, active: boolean = false) {
|
|
81
|
+
const completeColor = this._wu.isFailed() ? "darkred" : "darkgreen";
|
|
82
|
+
this._create.text(STATUS.CREATE);
|
|
83
|
+
this._compile.text(STATUS.COMPILE);
|
|
84
|
+
this._execute.text(STATUS.EXECUTE);
|
|
85
|
+
this._complete.text(STATUS.COMPLETE);
|
|
86
|
+
switch (level) {
|
|
87
|
+
case 0:
|
|
88
|
+
this.updateVertex(this._create, "darkgray");
|
|
89
|
+
this.updateVertex(this._compile, "darkgray");
|
|
90
|
+
this.updateVertex(this._execute, "darkgray");
|
|
91
|
+
this.updateVertex(this._complete, "darkgray");
|
|
92
|
+
break;
|
|
93
|
+
case 1:
|
|
94
|
+
this._create.text(STATUS_ACTIVE.CREATE);
|
|
95
|
+
this.updateVertex(this._create, active ? "orange" : completeColor);
|
|
96
|
+
this.updateVertex(this._compile, "darkgray");
|
|
97
|
+
this.updateVertex(this._execute, "darkgray");
|
|
98
|
+
this.updateVertex(this._complete, "darkgray");
|
|
99
|
+
break;
|
|
100
|
+
case 2:
|
|
101
|
+
this._compile.text(STATUS_ACTIVE.COMPILE);
|
|
102
|
+
this.updateVertex(this._create, completeColor);
|
|
103
|
+
this.updateVertex(this._compile, active ? "orange" : completeColor);
|
|
104
|
+
this.updateVertex(this._execute, completeColor);
|
|
105
|
+
this.updateVertex(this._complete, "darkgray");
|
|
106
|
+
break;
|
|
107
|
+
case 3:
|
|
108
|
+
this._execute.text(STATUS_ACTIVE.EXECUTE);
|
|
109
|
+
this.updateVertex(this._create, completeColor);
|
|
110
|
+
this.updateVertex(this._compile, completeColor);
|
|
111
|
+
this.updateVertex(this._execute, active ? "orange" : completeColor);
|
|
112
|
+
this.updateVertex(this._complete, "darkgray");
|
|
113
|
+
break;
|
|
114
|
+
case 4:
|
|
115
|
+
this.updateVertex(this._create, completeColor);
|
|
116
|
+
this.updateVertex(this._compile, completeColor);
|
|
117
|
+
this.updateVertex(this._execute, completeColor);
|
|
118
|
+
this.updateVertex(this._complete, completeColor);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
createEdge(source, target) {
|
|
124
|
+
return new Edge()
|
|
125
|
+
.sourceVertex(source)
|
|
126
|
+
.targetVertex(target)
|
|
127
|
+
.strokeColor("black")
|
|
128
|
+
.showArc(false)
|
|
129
|
+
;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
enter(domNode, element) {
|
|
133
|
+
super.enter(domNode, element);
|
|
134
|
+
this._create = this.createVertex("\uf11d");
|
|
135
|
+
this._compile = this.createVertex("\uf085");
|
|
136
|
+
this._execute = this.createVertex("\uf275");
|
|
137
|
+
this._complete = this.createVertex("\uf11e");
|
|
138
|
+
const e1 = this.createEdge(this._create, this._compile);
|
|
139
|
+
const e2 = this.createEdge(this._compile, this._execute);
|
|
140
|
+
const e3 = this.createEdge(this._execute, this._complete);
|
|
141
|
+
this.data({
|
|
142
|
+
vertices: [this._create, this._compile, this._execute, this._complete],
|
|
143
|
+
edges: [e1, e2, e3]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
update(domNode, element) {
|
|
148
|
+
this.attachWorkunit();
|
|
149
|
+
switch (this._wu.StateID) {
|
|
150
|
+
case WUStateID.Blocked:
|
|
151
|
+
case WUStateID.Wait:
|
|
152
|
+
case WUStateID.Scheduled:
|
|
153
|
+
case WUStateID.UploadingFiled:
|
|
154
|
+
this.updateVertexStatus(1);
|
|
155
|
+
break;
|
|
156
|
+
case WUStateID.Compiling:
|
|
157
|
+
this.updateVertexStatus(2, true);
|
|
158
|
+
break;
|
|
159
|
+
case WUStateID.Submitted:
|
|
160
|
+
this.updateVertexStatus(1, true);
|
|
161
|
+
break;
|
|
162
|
+
case WUStateID.Compiled:
|
|
163
|
+
this.updateVertexStatus(2);
|
|
164
|
+
break;
|
|
165
|
+
case WUStateID.Aborting:
|
|
166
|
+
case WUStateID.Running:
|
|
167
|
+
this.updateVertexStatus(3, true);
|
|
168
|
+
break;
|
|
169
|
+
case WUStateID.Aborted:
|
|
170
|
+
case WUStateID.Archived:
|
|
171
|
+
case WUStateID.Completed:
|
|
172
|
+
this.updateVertexStatus(4);
|
|
173
|
+
break;
|
|
174
|
+
case WUStateID.Failed:
|
|
175
|
+
this.updateVertexStatus(4, false);
|
|
176
|
+
break;
|
|
177
|
+
case WUStateID.DebugPaused:
|
|
178
|
+
case WUStateID.DebugRunning:
|
|
179
|
+
case WUStateID.Paused:
|
|
180
|
+
case WUStateID.Unknown:
|
|
181
|
+
default:
|
|
182
|
+
this.updateVertexStatus(0);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
super.update(domNode, element);
|
|
186
|
+
this.zoomToFit();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
exit(domNode, element) {
|
|
190
|
+
if (this._wuHandle) {
|
|
191
|
+
this._wuHandle.release();
|
|
192
|
+
}
|
|
193
|
+
super.exit(domNode, element);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
WUStatus.prototype._class += " eclwatch_WUStatus";
|
|
197
|
+
|
|
198
|
+
export interface WUStatus {
|
|
199
|
+
baseUrl(): string;
|
|
200
|
+
baseUrl(_: string): this;
|
|
201
|
+
wuid(): string;
|
|
202
|
+
wuid(_: string): this;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
WUStatus.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
206
|
+
WUStatus.prototype.publish("wuid", "", "string", "Workunit ID");
|
package/src/WUTimeline.ts
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import { Palette } from "@hpcc-js/common";
|
|
2
|
-
import { Scope, Workunit, WsWorkunits } from "@hpcc-js/comms";
|
|
3
|
-
import { ReactTimelineSeries } from "@hpcc-js/timeline";
|
|
4
|
-
import { hashSum, RecursivePartial } from "@hpcc-js/util";
|
|
5
|
-
|
|
6
|
-
import "../src/WUGraph.css";
|
|
7
|
-
|
|
8
|
-
const columns = ["label", "start", "end", "icon", "color", "series"];
|
|
9
|
-
|
|
10
|
-
export class WUTimeline extends ReactTimelineSeries {
|
|
11
|
-
|
|
12
|
-
protected _palette = Palette.ordinal("default");
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
this
|
|
17
|
-
.columns(columns)
|
|
18
|
-
.titleColumn("label")
|
|
19
|
-
.iconColumn("icon")
|
|
20
|
-
.colorColumn("color")
|
|
21
|
-
.seriesColumn("series")
|
|
22
|
-
.timePattern("%Y-%m-%dT%H:%M:%S.%LZ")
|
|
23
|
-
.tickFormat("%H:%M")
|
|
24
|
-
.tooltipTimeFormat("%H:%M:%S.%L")
|
|
25
|
-
.tooltipHTML(d => {
|
|
26
|
-
return d[columns.length].calcTooltip();
|
|
27
|
-
})
|
|
28
|
-
;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
private _prevHashSum;
|
|
32
|
-
clear(): this {
|
|
33
|
-
delete this._prevHashSum;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
fetchScopes() {
|
|
37
|
-
const hash = hashSum({
|
|
38
|
-
baseUrl: this.baseUrl(),
|
|
39
|
-
wuid: this.wuid(),
|
|
40
|
-
request: this.request()
|
|
41
|
-
});
|
|
42
|
-
if (this._prevHashSum !== hash) {
|
|
43
|
-
this._prevHashSum = hash;
|
|
44
|
-
const wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
45
|
-
wu.fetchDetails(this.request()).then(scopes => {
|
|
46
|
-
return scopes.filter(scope => scope.Id && scope.attr("WhenStarted").RawValue).map((scope: Scope) => {
|
|
47
|
-
const whenStarted = +scope.attr("WhenStarted").RawValue / 1000;
|
|
48
|
-
const timeElapsed = +scope.attr("TimeElapsed").RawValue / 1000000;
|
|
49
|
-
return [
|
|
50
|
-
scope.Id,
|
|
51
|
-
new Date(whenStarted).toISOString(),
|
|
52
|
-
timeElapsed ? new Date(whenStarted + timeElapsed).toISOString() : undefined,
|
|
53
|
-
null,
|
|
54
|
-
this._palette(scope.ScopeType),
|
|
55
|
-
scope.ScopeName.split("::").join(":").split(":").slice(0, 1),
|
|
56
|
-
scope
|
|
57
|
-
];
|
|
58
|
-
});
|
|
59
|
-
}).then(scopes => {
|
|
60
|
-
this
|
|
61
|
-
.data(scopes)
|
|
62
|
-
.render()
|
|
63
|
-
;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
enter(domNode, _element) {
|
|
69
|
-
super.enter(domNode, _element);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
update(domNode, element) {
|
|
73
|
-
this.fetchScopes();
|
|
74
|
-
super.update(domNode, element);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
exit(domNode, element) {
|
|
78
|
-
super.exit(domNode, element);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
WUTimeline.prototype._class += " eclwatch_WUTimeline";
|
|
82
|
-
|
|
83
|
-
export interface WUTimeline {
|
|
84
|
-
baseUrl(): string;
|
|
85
|
-
baseUrl(_: string): this;
|
|
86
|
-
wuid(): string;
|
|
87
|
-
wuid(_: string): this;
|
|
88
|
-
request(): Partial<WsWorkunits.WUDetails>;
|
|
89
|
-
request(_: RecursivePartial<WsWorkunits.WUDetails>): this;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
WUTimeline.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
93
|
-
WUTimeline.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
94
|
-
WUTimeline.prototype.publish("request", {
|
|
95
|
-
ScopeFilter: {
|
|
96
|
-
MaxDepth: 3,
|
|
97
|
-
ScopeTypes: ["graph", "subgraph"]
|
|
98
|
-
},
|
|
99
|
-
NestedFilter: {
|
|
100
|
-
Depth: 0,
|
|
101
|
-
ScopeTypes: []
|
|
102
|
-
},
|
|
103
|
-
PropertiesToReturn: {
|
|
104
|
-
AllProperties: false,
|
|
105
|
-
AllStatistics: true,
|
|
106
|
-
AllHints: false,
|
|
107
|
-
Properties: ["WhenStarted", "TimeElapsed"]
|
|
108
|
-
},
|
|
109
|
-
ScopeOptions: {
|
|
110
|
-
IncludeId: true,
|
|
111
|
-
IncludeScope: true,
|
|
112
|
-
IncludeScopeType: true
|
|
113
|
-
},
|
|
114
|
-
PropertyOptions: {
|
|
115
|
-
IncludeName: true,
|
|
116
|
-
IncludeRawValue: true,
|
|
117
|
-
IncludeFormatted: true,
|
|
118
|
-
IncludeMeasure: true,
|
|
119
|
-
IncludeCreator: false,
|
|
120
|
-
IncludeCreatorType: false
|
|
121
|
-
}
|
|
122
|
-
}, "object", "WUDetails Request");
|
|
1
|
+
import { Palette } from "@hpcc-js/common";
|
|
2
|
+
import { Scope, Workunit, WsWorkunits } from "@hpcc-js/comms";
|
|
3
|
+
import { ReactTimelineSeries } from "@hpcc-js/timeline";
|
|
4
|
+
import { hashSum, RecursivePartial } from "@hpcc-js/util";
|
|
5
|
+
|
|
6
|
+
import "../src/WUGraph.css";
|
|
7
|
+
|
|
8
|
+
const columns = ["label", "start", "end", "icon", "color", "series"];
|
|
9
|
+
|
|
10
|
+
export class WUTimeline extends ReactTimelineSeries {
|
|
11
|
+
|
|
12
|
+
protected _palette = Palette.ordinal("default");
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this
|
|
17
|
+
.columns(columns)
|
|
18
|
+
.titleColumn("label")
|
|
19
|
+
.iconColumn("icon")
|
|
20
|
+
.colorColumn("color")
|
|
21
|
+
.seriesColumn("series")
|
|
22
|
+
.timePattern("%Y-%m-%dT%H:%M:%S.%LZ")
|
|
23
|
+
.tickFormat("%H:%M")
|
|
24
|
+
.tooltipTimeFormat("%H:%M:%S.%L")
|
|
25
|
+
.tooltipHTML(d => {
|
|
26
|
+
return d[columns.length].calcTooltip();
|
|
27
|
+
})
|
|
28
|
+
;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private _prevHashSum;
|
|
32
|
+
clear(): this {
|
|
33
|
+
delete this._prevHashSum;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
fetchScopes() {
|
|
37
|
+
const hash = hashSum({
|
|
38
|
+
baseUrl: this.baseUrl(),
|
|
39
|
+
wuid: this.wuid(),
|
|
40
|
+
request: this.request()
|
|
41
|
+
});
|
|
42
|
+
if (this._prevHashSum !== hash) {
|
|
43
|
+
this._prevHashSum = hash;
|
|
44
|
+
const wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
|
|
45
|
+
wu.fetchDetails(this.request()).then(scopes => {
|
|
46
|
+
return scopes.filter(scope => scope.Id && scope.attr("WhenStarted").RawValue).map((scope: Scope) => {
|
|
47
|
+
const whenStarted = +scope.attr("WhenStarted").RawValue / 1000;
|
|
48
|
+
const timeElapsed = +scope.attr("TimeElapsed").RawValue / 1000000;
|
|
49
|
+
return [
|
|
50
|
+
scope.Id,
|
|
51
|
+
new Date(whenStarted).toISOString(),
|
|
52
|
+
timeElapsed ? new Date(whenStarted + timeElapsed).toISOString() : undefined,
|
|
53
|
+
null,
|
|
54
|
+
this._palette(scope.ScopeType),
|
|
55
|
+
scope.ScopeName.split("::").join(":").split(":").slice(0, 1),
|
|
56
|
+
scope
|
|
57
|
+
];
|
|
58
|
+
});
|
|
59
|
+
}).then(scopes => {
|
|
60
|
+
this
|
|
61
|
+
.data(scopes)
|
|
62
|
+
.render()
|
|
63
|
+
;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
enter(domNode, _element) {
|
|
69
|
+
super.enter(domNode, _element);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
update(domNode, element) {
|
|
73
|
+
this.fetchScopes();
|
|
74
|
+
super.update(domNode, element);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exit(domNode, element) {
|
|
78
|
+
super.exit(domNode, element);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
WUTimeline.prototype._class += " eclwatch_WUTimeline";
|
|
82
|
+
|
|
83
|
+
export interface WUTimeline {
|
|
84
|
+
baseUrl(): string;
|
|
85
|
+
baseUrl(_: string): this;
|
|
86
|
+
wuid(): string;
|
|
87
|
+
wuid(_: string): this;
|
|
88
|
+
request(): Partial<WsWorkunits.WUDetails>;
|
|
89
|
+
request(_: RecursivePartial<WsWorkunits.WUDetails>): this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
WUTimeline.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
|
|
93
|
+
WUTimeline.prototype.publish("wuid", "", "string", "Workunit ID");
|
|
94
|
+
WUTimeline.prototype.publish("request", {
|
|
95
|
+
ScopeFilter: {
|
|
96
|
+
MaxDepth: 3,
|
|
97
|
+
ScopeTypes: ["graph", "subgraph"]
|
|
98
|
+
},
|
|
99
|
+
NestedFilter: {
|
|
100
|
+
Depth: 0,
|
|
101
|
+
ScopeTypes: []
|
|
102
|
+
},
|
|
103
|
+
PropertiesToReturn: {
|
|
104
|
+
AllProperties: false,
|
|
105
|
+
AllStatistics: true,
|
|
106
|
+
AllHints: false,
|
|
107
|
+
Properties: ["WhenStarted", "TimeElapsed"]
|
|
108
|
+
},
|
|
109
|
+
ScopeOptions: {
|
|
110
|
+
IncludeId: true,
|
|
111
|
+
IncludeScope: true,
|
|
112
|
+
IncludeScopeType: true
|
|
113
|
+
},
|
|
114
|
+
PropertyOptions: {
|
|
115
|
+
IncludeName: true,
|
|
116
|
+
IncludeRawValue: true,
|
|
117
|
+
IncludeFormatted: true,
|
|
118
|
+
IncludeMeasure: true,
|
|
119
|
+
IncludeCreator: false,
|
|
120
|
+
IncludeCreatorType: false
|
|
121
|
+
}
|
|
122
|
+
}, "object", "WUDetails Request");
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const PKG_NAME = "@hpcc-js/eclwatch";
|
|
2
|
-
export const PKG_VERSION = "2.77.
|
|
3
|
-
export const BUILD_VERSION = "2.108.
|
|
1
|
+
export const PKG_NAME = "@hpcc-js/eclwatch";
|
|
2
|
+
export const PKG_VERSION = "2.77.8";
|
|
3
|
+
export const BUILD_VERSION = "2.108.8";
|