@aj-shadow/z-abs-complayer-visualizationlog-client 0.0.0-aj-beta.221

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.
Files changed (75) hide show
  1. package/.gitattributes +26 -0
  2. package/LICENSE.txt +96 -0
  3. package/README.md +5 -0
  4. package/npm-shrinkwrap.json +13 -0
  5. package/package.json +10 -0
  6. package/project/client/_build/Bundle-CompLayer-VisualizationLog-client.bld +36 -0
  7. package/project/client/_build/Client-CompLayer-VisualizationLog-client-jsx.bld +10 -0
  8. package/project/client/_build/Client-CompLayer-VisualizationLog-client.bld +10 -0
  9. package/project/client/_build/Client-css-CompLayer-VisualizationLog-bundle.bld +9 -0
  10. package/project/client/_build/z-abs-complayer-visualizationlog-client.prj +36 -0
  11. package/project/client/css/log-column.css +124 -0
  12. package/project/client/css/log-heading.css +54 -0
  13. package/project/client/css/log-inner.css +56 -0
  14. package/project/client/css/log-row.css +19 -0
  15. package/project/client/css/log-scroll.css +0 -0
  16. package/project/client/css/log-start-end.css +38 -0
  17. package/project/client/css/log-type-browser-err.css +21 -0
  18. package/project/client/css/log-type-browser-log.css +21 -0
  19. package/project/client/css/log-type-debug.css +21 -0
  20. package/project/client/css/log-type-engine.css +21 -0
  21. package/project/client/css/log-type-error.css +21 -0
  22. package/project/client/css/log-type-gui.css +21 -0
  23. package/project/client/css/log-type-ip.css +21 -0
  24. package/project/client/css/log-type-test-data.css +21 -0
  25. package/project/client/css/log-type-verify-failure.css +21 -0
  26. package/project/client/css/log-type-verify-succes.css +21 -0
  27. package/project/client/css/log-type-warning.css +21 -0
  28. package/project/client/css/log.css +118 -0
  29. package/project/client/data/data-log-end-result.js +32 -0
  30. package/project/client/data/data-log-end.js +52 -0
  31. package/project/client/data/data-log-log-result.js +76 -0
  32. package/project/client/data/data-log-log.js +157 -0
  33. package/project/client/data/data-log-start-result.js +36 -0
  34. package/project/client/data/data-log-start.js +56 -0
  35. package/project/client/logic/cache.js +185 -0
  36. package/project/client/logic/const.js +26 -0
  37. package/project/client/logic/log-filter.js +122 -0
  38. package/project/client/react-component/log.jsx +296 -0
  39. package/project/client/templates/template-icons/svgs/template-arrow-head.js +35 -0
  40. package/project/client/templates/template-icons/svgs/template-arrow-line.js +34 -0
  41. package/project/client/templates/template-icons/svgs/template-background.js +28 -0
  42. package/project/client/templates/template-icons/svgs/template-circle-big.js +27 -0
  43. package/project/client/templates/template-icons/svgs/template-circle-small.js +27 -0
  44. package/project/client/templates/template-icons/svgs/template-envelope.js +46 -0
  45. package/project/client/templates/template-icons/svgs/template-hex-big.js +38 -0
  46. package/project/client/templates/template-icons/svgs/template-hex-small.js +38 -0
  47. package/project/client/templates/template-icons/svgs/template-square-big.js +28 -0
  48. package/project/client/templates/template-icons/svgs/template-square-small.js +28 -0
  49. package/project/client/templates/template-icons/svgs/template-triangle-big.js +31 -0
  50. package/project/client/templates/template-icons/svgs/template-triangle-small.js +31 -0
  51. package/project/client/templates/template-icons/svgs/template-x-big.js +39 -0
  52. package/project/client/templates/template-icons/svgs/template-x-small.js +39 -0
  53. package/project/client/templates/template-icons/template-icon-accepted.js +32 -0
  54. package/project/client/templates/template-icons/template-icon-accepting.js +32 -0
  55. package/project/client/templates/template-icons/template-icon-attached.js +68 -0
  56. package/project/client/templates/template-icons/template-icon-closed.js +44 -0
  57. package/project/client/templates/template-icons/template-icon-closing.js +44 -0
  58. package/project/client/templates/template-icons/template-icon-connected.js +32 -0
  59. package/project/client/templates/template-icons/template-icon-connecting.js +32 -0
  60. package/project/client/templates/template-icons/template-icon-detached.js +61 -0
  61. package/project/client/templates/template-icons/template-icon-not-connected.js +37 -0
  62. package/project/client/templates/template-icons/template-icon-not-started.js +67 -0
  63. package/project/client/templates/template-icons/template-icon-receive.js +37 -0
  64. package/project/client/templates/template-icons/template-icon-send.js +37 -0
  65. package/project/client/templates/template-icons/template-icon-stack.js +110 -0
  66. package/project/client/templates/template-icons/template-icon-started.js +32 -0
  67. package/project/client/templates/template-icons/template-icon-starting.js +32 -0
  68. package/project/client/templates/template-icons/template-icon-stopped.js +34 -0
  69. package/project/client/templates/template-icons/template-icon-stopping.js +34 -0
  70. package/project/client/templates/template-icons/template-icon-unknown.js +26 -0
  71. package/project/client/templates/template-icons/template-icon.js +76 -0
  72. package/project/client/templates/template-log-end.js +68 -0
  73. package/project/client/templates/template-log-log.js +652 -0
  74. package/project/client/templates/template-log-start.js +67 -0
  75. package/project/z-abs-complayer-visualizationlog-client.tree +78 -0
@@ -0,0 +1,652 @@
1
+
2
+ 'use strict';
3
+
4
+ import Const from '../logic/const';
5
+ import DataLogLog from '../data/data-log-log';
6
+ import TemplateIcon from './template-icons/template-icon';
7
+ import DataLogDynamicBuffer from 'z-abs-complayer-visualizationinner-client/client/data/data-log-dynamic-buffer';
8
+ import LogDataAction from 'z-abs-funclayer-engine-cs/clientServer/log/log-data-action';
9
+ import LogPartType from 'z-abs-funclayer-engine-cs/clientServer/log/log-part-type';
10
+ import LogType from 'z-abs-funclayer-engine-cs/clientServer/log/log-type';
11
+ import InnerConst from 'z-abs-complayer-visualizationinner-client/client/logic/inner-const';
12
+ import TemplateInners from 'z-abs-complayer-visualizationinner-client/client/templates/template-inners';
13
+ import TransportTypeConst from 'z-abs-funclayer-engine-cs/clientServer/stack/transport-type-const';
14
+
15
+
16
+ class TemplateLogLog {
17
+ static innersTemplate = null;
18
+
19
+ constructor(templateInners) {
20
+ this.templateInners = templateInners;
21
+ this.defaultHeight = 20;
22
+ this.rowTemplate = null;
23
+ this.filter = null;
24
+ this.templateInners = null;
25
+ this.updateScrollList = null;
26
+
27
+ this.templateTestCaseRows = null;
28
+ this.templateTestCaseColumns = null;
29
+ this.templateInnerImageRowOpen = null;
30
+ this.templateInnerImageRowClosed = null;
31
+ this.clickInner = this._clickInner.bind(this);
32
+ }
33
+
34
+ exit() {
35
+ DataLogLog.exit();
36
+ this.rowTemplate = null;
37
+ this.filter = null;
38
+ this.templateInners = null;
39
+ this.updateScrollList = null;
40
+
41
+ this.templateTestCaseRows = null;
42
+ this.templateTestCaseColumns = null;
43
+ this.templateInnerImageRowOpen = null;
44
+ this.templateInnerImageRowClosed = null;
45
+ TemplateLogLog.innersTemplate = null;
46
+ }
47
+
48
+ init(filter, pooledBuffers, stackStyles, templateInners, updateScrollList) {
49
+ this.filter = filter;
50
+ DataLogLog.init(pooledBuffers, stackStyles);
51
+ this.templateInners = templateInners;
52
+ this.updateScrollList = updateScrollList;
53
+
54
+ TemplateLogLog.innersTemplate = new Map();
55
+ TemplateLogLog.innersTemplate.set(LogType.IP, TemplateLogLog._createOuterTemplate(stackStyles, LogType.IP));
56
+ TemplateLogLog.innersTemplate.set(LogType.ERROR, TemplateLogLog._createOuterTemplate(stackStyles, LogType.ERROR));
57
+ this.templateTestCaseRows = [new Array(LogType.names.length), new Array(LogType.names.length), new Array(LogType.names.length)];
58
+ this.templateTestCaseColumns = [new Array(LogType.names.length), new Array(LogType.names.length), new Array(LogType.names.length)];
59
+ this.templateInnerImageRowOpen = this._createInnerImage(true);
60
+ this.templateInnerImageRowClosed = this._createInnerImage(false);
61
+ for(let i = 0; i < LogType.names.length; ++i) {
62
+ this.templateTestCaseColumns[InnerConst.INNER_NONE][i] = this._createTemplateColumns(i, InnerConst.INNER_NONE);
63
+ this.templateTestCaseColumns[InnerConst.INNER_CLOSED][i] = this._createTemplateColumns(i, InnerConst.INNER_CLOSED);
64
+ this.templateTestCaseColumns[InnerConst.INNER_OPEN][i] = this._createTemplateColumns(i, InnerConst.INNER_OPEN);
65
+ this.templateTestCaseRows[InnerConst.INNER_NONE][i] = this._createTemplateRow(i, InnerConst.INNER_NONE);
66
+ this.templateTestCaseRows[InnerConst.INNER_CLOSED][i] = this._createTemplateRow(i, InnerConst.INNER_CLOSED);
67
+ this.templateTestCaseRows[InnerConst.INNER_OPEN][i] = this._createTemplateRow(i, InnerConst.INNER_OPEN);
68
+ }
69
+ }
70
+
71
+ _createInnerImage(open, className) {
72
+ const svg = document.createElementNS(InnerConst.SVG_NS, 'svg');
73
+ svg.classList.add('log_arrow');
74
+ if(undefined !== className) {
75
+ svg.classList.add(className);
76
+ }
77
+ svg.setAttribute('width', 14);
78
+ svg.setAttribute('height', 14);
79
+ const group = svg.appendChild(document.createElementNS(InnerConst.SVG_NS, 'g'));
80
+ const arrow = group.appendChild(document.createElementNS(InnerConst.SVG_NS, 'polygon'));
81
+ arrow.setAttribute('points', '2,2 2,10 10,6');
82
+ arrow.setAttribute('stroke', 'Grey');
83
+ arrow.setAttribute('stroke-width', 1);
84
+ arrow.setAttribute('fill', 'white');
85
+ if(open) {
86
+ group.setAttribute('transform', 'rotate(45 3 7)');
87
+ }
88
+ return svg;
89
+ }
90
+
91
+ _createTemplateColumns(logTypeId, innerStatus) {
92
+ const fragment = document.createDocumentFragment();
93
+ const logIdTd = fragment.appendChild(document.createElement('div'));
94
+ logIdTd.classList.add('comp_layer_log_column');
95
+ logIdTd.classList.add('comp_layer_log_column_nbr');
96
+ logIdTd.appendChild(document.createTextNode(''));
97
+ const logTypeTd = fragment.appendChild(document.createElement('div'));
98
+ logTypeTd.classList.add('comp_layer_log_column');
99
+ logTypeTd.classList.add('comp_layer_log_column_type');
100
+ const p = logTypeTd.appendChild(document.createElement('p'));
101
+ p.classList.add('comp_layer_log_column_type_ip');
102
+ p.appendChild(document.createTextNode(LogType.names[logTypeId]));
103
+ const iconNode = logTypeTd.appendChild(document.createElementNS(InnerConst.SVG_NS, 'svg'));
104
+ iconNode.classList.add('comp_layer_log_column_type_ip');
105
+ iconNode.setAttribute('width', `${Const.ICON_X_WIDTH}`);
106
+ iconNode.setAttribute('height', `${Const.ICON_Y_HEIGHT}`);
107
+ iconNode.setAttribute('viewBox', `0 0 ${Const.ICON_X_WIDTH} ${Const.ICON_Y_HEIGHT}`);
108
+
109
+ if(LogType.hasInner[logTypeId]) {
110
+ if(InnerConst.INNER_CLOSED === innerStatus) {
111
+ logTypeTd.setAttribute("data-inner", 'closed');
112
+ logTypeTd.appendChild(this.templateInnerImageRowClosed.cloneNode(true));
113
+ }
114
+ else if(InnerConst.INNER_OPEN === innerStatus) {
115
+ logTypeTd.setAttribute('data-inner', 'open');
116
+ logTypeTd.appendChild(this.templateInnerImageRowOpen.cloneNode(true));
117
+ }
118
+ }
119
+ const dateTd = fragment.appendChild(document.createElement('div'));
120
+ dateTd.classList.add('comp_layer_log_column');
121
+ dateTd.classList.add('comp_layer_log_column_date');
122
+ dateTd.appendChild(document.createTextNode(''));
123
+
124
+ const actorTd = fragment.appendChild(document.createElement('div'));
125
+ actorTd.classList.add('comp_layer_log_column');
126
+ actorTd.classList.add('comp_layer_log_column_actor');
127
+ const actorA = actorTd.appendChild(document.createElement('a'));
128
+ actorA.setAttribute('target', '_blank');
129
+ actorA.setAttribute('rel', 'noopener noreferrer');
130
+ actorA.classList.add('comp_layer_log_column_actor');
131
+ actorA.appendChild(document.createElement('span'));
132
+
133
+ const fileNameTd = fragment.appendChild(document.createElement('div'));
134
+ fileNameTd.classList.add('comp_layer_log_column');
135
+ fileNameTd.classList.add('comp_layer_log_column_file_name');
136
+ const fileNameA = fileNameTd.appendChild(document.createElement('a'));
137
+ fileNameA.classList.add('comp_layer_log_column_file_name');
138
+ fileNameA.setAttribute('target', '_blank');
139
+ fileNameA.setAttribute('rel', 'noopener noreferrer');
140
+ fileNameA.appendChild(document.createElement('span'));
141
+
142
+ const logTd = fragment.appendChild(document.createElement('div'));
143
+ logTd.classList.add('comp_layer_log_column');
144
+ logTd.classList.add('comp_layer_log_column_log');
145
+ logTd.appendChild(document.createTextNode(''));
146
+ return fragment;
147
+ }
148
+
149
+ _createTemplateRow(logTypeId, innerStatus) {
150
+ const row = document.createElement('div');
151
+ row.classList.add(`comp_layer_${LogType.csses[logTypeId]}`);
152
+ row.classList.add('comp_layer_log_row');
153
+ const columns = this.templateTestCaseColumns[innerStatus][logTypeId].cloneNode(true);
154
+ row.appendChild(columns);
155
+ return row;
156
+ }
157
+
158
+ static _createInnerTemplate(stackStyles) {
159
+ const divInnerTemplate = new Array(stackStyles.size);
160
+ const divInner = document.createElement('div');
161
+ divInner.classList.add('log_protocol_msg_inner');
162
+ stackStyles.forEach((protocol, protocolKey) => {
163
+ const protocolDivInner = divInner.cloneNode(true);
164
+ divInnerTemplate[protocol.index] = protocolDivInner;
165
+ });
166
+ return divInnerTemplate;
167
+ }
168
+
169
+ static _createOuterTemplate(stackStyles, logType) {
170
+ if(LogType.IP === logType) {
171
+ const divInnerTemplate = TemplateLogLog._createInnerTemplate(stackStyles);
172
+ const divOuterTemplate = new Array(stackStyles.size);
173
+ const divOuter = document.createElement('div');
174
+ divOuter.classList.add('log_protocol_outer');
175
+ const divInner = divOuter.appendChild(document.createElement('div'));
176
+ divInner.classList.add('log_protocol_header');
177
+ const pHeaderStack = divInner.appendChild(document.createElement('p'));
178
+ pHeaderStack.classList.add('log_protocol_header_stack');
179
+ const pHeaderTransport = divInner.appendChild(document.createElement('p'));
180
+ pHeaderTransport.classList.add('log_protocol_header_transport');
181
+ stackStyles.forEach((protocol, protocolKey) => {
182
+ const protocolDivOuter = divOuter.cloneNode(true);
183
+ protocolDivOuter.firstChild.classList.add(`log_protocol_${protocolKey}_inner`);
184
+ protocolDivOuter.firstChild.classList.add(`log_protocol_${protocolKey}_header`);
185
+ protocolDivOuter.firstChild.firstChild.appendChild(document.createTextNode(protocolKey));
186
+ divOuterTemplate[protocol.index] = protocolDivOuter;
187
+ protocolDivOuter.appendChild(divInnerTemplate[protocol.index].cloneNode(true));
188
+ });
189
+ return divOuterTemplate;
190
+ }
191
+ else if(LogType.ERROR === logType) {
192
+ const divOuter = document.createElement('div');
193
+ divOuter.classList.add('log_protocol_outer');
194
+ const divInner = divOuter.appendChild(document.createElement('div'));
195
+ divInner.classList.add('log_protocol_msg_inner');
196
+ return divOuter;
197
+ }
198
+ }
199
+
200
+ calculateHeight(bufferData) {
201
+ const heightData = DataLogLog.restoreHeightData(bufferData);
202
+ if(this.filter.type[heightData.type]) {
203
+ if(heightData.innersData && heightData.innersData.isOpen) {
204
+ return this.defaultHeight + heightData.innersData.size;
205
+ }
206
+ else {
207
+ return this.defaultHeight;
208
+ }
209
+ }
210
+ else {
211
+ return 0;
212
+ }
213
+ }
214
+
215
+ store(msg, logId) {
216
+ return DataLogLog.store(msg, logId);
217
+ }
218
+
219
+ restore(bufferData) {
220
+ return DataLogLog.restore(bufferData);
221
+ }
222
+
223
+ createElement(data) {
224
+ const extraData = data?.extraData;
225
+ const innerStatus = !extraData?.innersData ? InnerConst.INNER_NONE : (extraData.innersData.isOpen ? InnerConst.INNER_OPEN : InnerConst.INNER_CLOSED);
226
+ const node = this.templateTestCaseRows[innerStatus][data.type].cloneNode(true);
227
+ if(LogType.IP === data.type) {
228
+ node.childNodes[1].childNodes[1].appendChild(TemplateIcon.create(data));
229
+ }
230
+ return node;
231
+ }
232
+
233
+ setElementData(data, node) {
234
+ node.firstChild.lastChild.nodeValue = data.logId;
235
+ if(LogType.IP === data.type || LogType.ERROR === data.type) {
236
+ const extraData = data?.extraData;
237
+ const innerStatus = !extraData?.innersData ? InnerConst.INNER_NONE : (extraData.innersData.isOpen ? InnerConst.INNER_OPEN : InnerConst.INNER_CLOSED);
238
+ if(InnerConst.INNER_NONE !== innerStatus) {
239
+ node.childNodes[1].childNodes[2].addEventListener('click', this.clickInner, true);
240
+ node.childNodes[1].setAttribute('data-key', extraData.innersData.dataKey);
241
+ }
242
+ }
243
+ node.childNodes[2].lastChild.nodeValue = data.date;
244
+
245
+ const actorElement = node.childNodes[3].firstChild;
246
+ actorElement.lastChild.textContent = data.actor;
247
+ actorElement.setAttribute('href', data.actorPath);
248
+ actorElement.dataset.hover = data.actorPath;
249
+
250
+ const fileElement = node.childNodes[4].firstChild;
251
+ const fName = data.fileName.lastIndexOf('/');
252
+ if(-1 !== fName) {
253
+ fileElement.lastChild.textContent = data.fileName.substring(fName + 1);
254
+ }
255
+ else {
256
+ fileElement.lastChild.textContent = data.fileName;
257
+ }
258
+ fileElement.dataset.hover = data.fileName;
259
+ fileElement.setAttribute('href', data.codePath);
260
+
261
+ node.childNodes[5].lastChild.nodeValue = data.log;
262
+ if(data.extraData.innersData?.isOpen) {
263
+ node.appendChild(this.templateInners.createElement(data, false));
264
+ }
265
+ }
266
+
267
+ removeElement(data, node) {
268
+ const extraData = data?.extraData;
269
+ const innerStatus = !extraData?.innersData ? InnerConst.INNER_NONE : (extraData.innersData.isOpen ? InnerConst.INNER_OPEN : InnerConst.INNER_CLOSED);
270
+ if(LogType.IP === data.type || LogType.ERROR === data.type) {
271
+ if(InnerConst.INNER_NONE !== innerStatus) {
272
+ const arrowNode = node.childNodes[1].childNodes[2];
273
+ arrowNode.removeEventListener('click', this.clickInner, true);
274
+ if(InnerConst.INNER_OPEN === innerStatus) {
275
+ extraData.innersData.inners = null;
276
+ }
277
+ }
278
+ }
279
+ }
280
+
281
+ static createInners(data) {
282
+ const template = TemplateLogLog.innersTemplate.get(data.type);
283
+ let outerNode = null;
284
+ if(LogType.IP === data.type) {
285
+ outerNode = template[data.extraData.protocolIndex].cloneNode(true);
286
+ outerNode.firstChild.lastChild.textContent = TransportTypeConst.TRANSPORT_TYPE_NAMES[data.extraData.transportType];
287
+ }
288
+ else if(LogType.ERROR === data.type) {
289
+ outerNode = template.cloneNode(true);
290
+ }
291
+ const innerNode = outerNode.lastChild;
292
+ return {
293
+ outerNode,
294
+ innerNode
295
+ };
296
+ }
297
+
298
+ _clickInner(event) {
299
+ event.preventDefault();
300
+ const divNode = event.currentTarget.parentNode;
301
+ const dataKey = divNode.getAttribute('data-key');
302
+ const extraData = DataLogDynamicBuffer.restoreFromKey(dataKey);
303
+ if(divNode.dataset.inner === 'closed') {
304
+ let id = 0;
305
+ if(!extraData.inners) {
306
+ extraData.inners = JSON.parse(extraData.innersRaw, (key, value) => {
307
+ if('inners' === key && 0 !== value.length) {
308
+ value.forEach((inner) => {
309
+ if(undefined === inner.id) {
310
+ inner.id = ++id;
311
+ inner.isOpen = false;
312
+ }
313
+ });
314
+ }
315
+ return value;
316
+ });
317
+ extraData.inners.forEach((inner) => {
318
+ if(undefined === inner.id) {
319
+ inner.id = ++id;
320
+ inner.isOpen = false;
321
+ }
322
+ });
323
+ }
324
+ const innersRaw = JSON.stringify(extraData.inners);
325
+ extraData.size = this.templateInners.calculateInnersSize(extraData.inners, extraData.type);
326
+ DataLogDynamicBuffer.storeFromKey(dataKey, innersRaw, extraData.inners, true, extraData.size, extraData.type);
327
+ }
328
+ else {
329
+ extraData.size = 0;
330
+ DataLogDynamicBuffer.storeFromKey(dataKey, extraData.innersRaw, null, false, extraData.size, extraData.type);
331
+ }
332
+ this.updateScrollList();
333
+ }
334
+
335
+ /*clone(logId, logRow, checked, open, cbResize) {
336
+ const scrollListNodes = [];
337
+ let fragment;
338
+ let node;
339
+ const inners = logRow.inners;
340
+ const openId = open ? 0 : 1;
341
+ if(inners) {
342
+ fragment = this.templateTestCaseRows[openId][TemplateLogLog.INNER][logRow.type].cloneNode(true);
343
+ node = fragment.firstChild;
344
+ const outerNode = new ScrollListNode(node, this, checked ? 20 : 0);
345
+ scrollListNodes.push(outerNode);
346
+ outerNode.addEventListener(`log-filter-type-event-${LogType.pureNames[logRow.type]}`, function(event) {
347
+ this.height = event.detail.checked ? 20 : 0;
348
+ });
349
+ const innerNode = new ScrollListNode(fragment.childNodes[1], this, 0);
350
+ scrollListNodes.push(innerNode);
351
+ let created = false;
352
+ const innerParentNode = fragment.childNodes[1].firstChild;
353
+ const target = node.childNodes[1];
354
+ const arrowTarget = node.childNodes[1].childNodes[1].firstChild;
355
+ const innerTarget = node.nextSibling;
356
+ node.childNodes[1].childNodes[1].addEventListener('click', (evt) => {
357
+ ddb.info('click 1');
358
+ innerNode.height = 35;
359
+ cbResize(outerNode.index);
360
+ if(!created) {
361
+ created = true;
362
+ if(!Array.isArray(inners)) {
363
+ this._createInner(inners, innerParentNode, true);
364
+ }
365
+ else {
366
+ inners.forEach((inner) => {
367
+ this._createInner(inner, innerParentNode, true);
368
+ });
369
+ }
370
+ }
371
+ this._toggleEvent(evt, target, arrowTarget, innerTarget);
372
+ }, false);
373
+ if(open) {
374
+ created = true;
375
+ if(!Array.isArray(inners)) {
376
+ this._createInner(inners, innerParentNode, open);
377
+ }
378
+ else {
379
+ inners.forEach((inner) => {
380
+ this._createInner(inner, innerParentNode, open);
381
+ });
382
+ }
383
+ }
384
+ }
385
+ else {
386
+ node = this.templateTestCaseRows[openId][TemplateLogLog.OUTER][logRow.type].cloneNode(true);
387
+ const outerNode = new ScrollListNode(node, this, checked ? 20 : 0);
388
+ scrollListNodes.push(outerNode);
389
+ outerNode.addEventListener(`log-filter-type-event-${LogType.pureNames[logRow.type]}`, function(event) {
390
+ this.height = event.detail.checked ? 20 : 0;
391
+ });
392
+ }
393
+ node.firstChild.lastChild.nodeValue = logId;
394
+ if(LogType.IP === logRow.type) {
395
+ node.childNodes[1].firstChild.textContent += LogDataAction.LOG_SIGN[logRow.data ? logRow.data.id : 0];
396
+ }
397
+ node.childNodes[2].lastChild.nodeValue = `${new Date(logRow.date.date).toUTCString()} : ${logRow.date.milliSeconds}`;
398
+ node.childNodes[3].firstChild.lastChild.nodeValue = logRow.actor;
399
+ node.childNodes[3].firstChild.setAttribute('href', `/actor-editor/${logRow.actorPath}`);
400
+ node.childNodes[4].lastChild.nodeValue = logRow.log;
401
+ node.childNodes[5].firstChild.lastChild.nodeValue = `${logRow.fileName}:${logRow.lineNumber}`;
402
+ if('server' === logRow.sourceType) {
403
+ node.childNodes[5].firstChild.setAttribute('href', `/code-editor/project/${logRow.fileName}?line=${logRow.lineNumber}&type=${logRow.type}`);
404
+ }
405
+ else if('actor' === logRow.sourceType) {
406
+ node.childNodes[5].firstChild.setAttribute('href', `/actor-editor/${logRow.fileName}?line=${logRow.lineNumber}&type=${logRow.type}`);
407
+ }
408
+ else if('stack' === logRow.sourceType) {
409
+ node.childNodes[5].firstChild.setAttribute('href', `/stack-editor/${logRow.fileName}?line=${logRow.lineNumber}&type=${logRow.type}`);
410
+ }
411
+ return scrollListNodes;
412
+ }*/
413
+
414
+ /*open(nodeData) {
415
+ nodeData.open = true;
416
+ this._resize(nodeData);
417
+ nodeData.cbResize(nodeData.index);
418
+ }
419
+
420
+ close(nodeData) {
421
+ nodeData.open = false;
422
+ this.resize(nodeData);
423
+ nodeData.cbResize(nodeData.index);
424
+ }
425
+
426
+ _resize(nodeData) {
427
+ nodeData.height = nodeData.height + 20;
428
+ }*/
429
+
430
+
431
+
432
+ /*_createTemplateRowWithInner(logTypeId, openId) {
433
+ const row = document.createElement('div');
434
+ row.classList.add(`comp_layer_${LogType.csses[logTypeId]}`);
435
+ row.classList.add('comp_layer_log_row');
436
+ const columns = this.templateTestCaseColumns[openId][logTypeId].cloneNode(true);
437
+ row.appendChild(columns);
438
+ // row.appendChild(this.templateTestCaseInnerRows[openId][logTypeId].cloneNode(true));
439
+ return row;
440
+ //const fragment = document.createDocumentFragment();
441
+ //fragment.appendChild(row);
442
+ //fragment.appendChild();
443
+ //return fragment;
444
+ }*/
445
+
446
+ /*_innerClickHandler() {
447
+
448
+ }*/
449
+
450
+ /*_createInner(inner, parent, filterOpen) {
451
+ const inners = inner.inners;
452
+ if(0 !== inners.length) {
453
+ if(inner.open) {
454
+ parent.appendChild(this.templateInnerWithInnerObjectOpen.cloneNode(true));
455
+ }
456
+ else {
457
+ parent.appendChild(this.templateInnerWithInnerObjectClosed.cloneNode(true));
458
+ }
459
+ const div = parent.lastChild.childNodes[1].appendChild(this.templateDynamicInnerWithInner.cloneNode(true));
460
+ inner.logParts.forEach((innerPart) => {
461
+ if(LogPartType.TEXT === innerPart.type) {
462
+ div.appendChild(this.templateDynamicInnerText.cloneNode(true));
463
+ div.lastChild.firstChild.nodeValue = innerPart.text;
464
+ }
465
+ else if(LogPartType.REF === innerPart.type) {
466
+ div.appendChild(this.templateDynamicInnerRef.cloneNode(true));
467
+ div.lastChild.setAttribute('href', innerPart.ref);
468
+ div.lastChild.firstChild.nodeValue = innerPart.text;
469
+ }
470
+ });
471
+ let created = false;
472
+ const innerParentNode = parent.lastChild.lastChild;
473
+ const target = parent.lastChild;
474
+ const arrowTarget = target.firstChild.firstChild;
475
+ const innerTarget = target.lastChild;
476
+ parent.lastChild.firstChild.addEventListener('click', (evt) => {
477
+ ddb.info('click 2');
478
+ if(!created) {
479
+ created = true;
480
+ inners.forEach((inner) => {
481
+ this._createInner(inner, innerParentNode, filterOpen);
482
+ });
483
+ }
484
+ this._toggleEvent(evt, target, arrowTarget, innerTarget);
485
+ }, false);
486
+ if(filterOpen) {
487
+ created = true;
488
+ inners.forEach((inner) => {
489
+ this._createInner(inner, parent.lastChild.lastChild, filterOpen);
490
+ });
491
+ }
492
+ }
493
+ else {
494
+ const div = parent.appendChild(this.templateDynamicInner.cloneNode(true));
495
+ inner.logParts.forEach((innerPart) => {
496
+ if(LogPartTypeLogPartType.TEXT === innerPart.type) {
497
+ div.appendChild(this.templateDynamicInnerText.cloneNode(true));
498
+ div.lastChild.lastChild.nodeValue = innerPart.text;
499
+ }
500
+ else if(LogPartType.REF === innerPart.type) {
501
+ div.appendChild(this.templateDynamicInnerRef.cloneNode(true));
502
+ div.lastChild.setAttribute('href', innerPart.ref);
503
+ div.lastChild.lastChild.nodeValue = innerPart.text;
504
+ }
505
+ else if(LogPartType.ERROR === innerPart.type) {
506
+ const innerData = innerPart.text;
507
+ const errorDiv = div.appendChild(this.templateError.cloneNode(true));
508
+ errorDiv.firstChild.nodeValue = innerData.error;
509
+ innerData.rows.forEach((row) => {
510
+ if(row.ref) {
511
+ errorDiv.appendChild(this.templateErrorRowRef.cloneNode(true));
512
+ errorDiv.lastChild.firstChild.nodeValue = ` at ${row.func} - `;
513
+ errorDiv.lastChild.lastChild.lastChild.nodeValue = `${row.fileName}:${row.lineNumber}`;
514
+
515
+ if('server' === row.sourceType) {
516
+ errorDiv.lastChild.lastChild.setAttribute('href', `/code-editor/project/${row.fileName}?line=${row.lineNumber}&type=${LogType.ERROR}`);
517
+ }
518
+ else if('actor' === row.sourceType) {
519
+ errorDiv.lastChild.lastChild.setAttribute('href', `/actor-editor/${row.fileName}?line=${row.lineNumber}&type=${LogType.ERROR}`);
520
+ }
521
+ else if('stack' === row.sourceType) {
522
+ errorDiv.lastChild.lastChild.setAttribute('href', `/stack-editor/${row.fileName}?line=${row.lineNumber}&type=${LogType.ERROR}`);
523
+ }
524
+ }
525
+ else {
526
+ errorDiv.appendChild(this.templateErrorRowRef.cloneNode(true));
527
+ errorDiv.lastChild.firstChild.nodeValue = ` at ${row.func} - ${row.fileName}`;
528
+ }
529
+ });
530
+ }
531
+ else if(LogPartType.BUFFER === innerPart.type) {
532
+ //ddb.error('LogPartType.BUFFER: Not Implemented for log.', innerPart);
533
+ }
534
+ });
535
+ }
536
+ }*/
537
+
538
+ //_toggleEvent(evt, target, arrowTarget, innerTarget, cb) {
539
+ /*_toggleEvent(evt, target, arrowTarget, innerTarget) {
540
+ if('closed' === target.getAttribute('data-inner')) {
541
+ target.setAttribute('data-inner', 'open');
542
+ arrowTarget.setAttribute('transform', 'rotate(45 6 6)');
543
+ innerTarget.classList.remove('inner_closed');
544
+ // cb && cb(true);
545
+ }
546
+ else {
547
+ target.setAttribute('data-inner', 'closed');
548
+ arrowTarget.removeAttribute('transform');
549
+ innerTarget.classList.add('inner_closed');
550
+ // cb && cb(false);
551
+ }
552
+ }
553
+
554
+ _createTemplateRowInner(logTypeId, open) {
555
+ const row = document.createElement('div');
556
+ row.classList.add(LogType.csses[logTypeId]);
557
+ row.classList.add('comp_layer_log_inner');
558
+ if(!open) {
559
+ row.classList.add('inner_closed');
560
+ }
561
+ return row;
562
+ }
563
+
564
+
565
+
566
+ _createTemplateInner(withInner, open, text) {
567
+ const div = document.createElement('div');
568
+ div.classList.add('comp_layer_log_inner');
569
+ if(withInner) {
570
+ if(open) {
571
+ div.setAttribute('data-inner', 'open');
572
+ div.appendChild(this.templateInnerImageOpen.cloneNode(true));
573
+ div.firstChild.firstChild.setAttribute('transform', 'rotate(45 6 6)');
574
+ }
575
+ else {
576
+ div.setAttribute('data-inner', 'closed');
577
+ div.appendChild(this.templateInnerImageClosed.cloneNode(true));
578
+ }
579
+ }
580
+ if(text) {
581
+ const pre = div.appendChild(document.createElement('pre'));
582
+ pre.classList.add('comp_layer_log_inner');
583
+ pre.appendChild(document.createTextNode(''));
584
+ }
585
+ else {
586
+ const divInner = div.appendChild(document.createElement('div'));
587
+ divInner.classList.add('comp_layer_log_inner');
588
+ }
589
+ if(withInner) {
590
+ const inner = div.appendChild(document.createElement('div'));
591
+ inner.classList.add('comp_layer_log_inner');
592
+ if(!open) {
593
+ inner.classList.add('inner_closed');
594
+ }
595
+ }
596
+ return div;
597
+ }
598
+
599
+ _createTemplateDynamicInner(withInner) {
600
+ const div = document.createElement('div');
601
+ if(withInner) {
602
+ div.classList.add('inner_dynamic_with_inner');
603
+ }
604
+ else {
605
+ div.classList.add('inner_dynamic');
606
+ }
607
+ return div;
608
+ }
609
+
610
+ _createTemplateDynamicInnerText() {
611
+ const pre = document.createElement('pre');
612
+ pre.classList.add('comp_layer_log_inner');
613
+ pre.appendChild(document.createTextNode(''));
614
+ return pre;
615
+ }
616
+
617
+ _createTemplateDynamicInnerRef() {
618
+ const a = document.createElement('a');
619
+ a.classList.add('comp_layer_log_inner');
620
+ a.setAttribute('href', '[[ref]]');
621
+ a.setAttribute('target', '_blank');
622
+ a.appendChild(document.createTextNode(''));
623
+ return a;
624
+ }*/
625
+
626
+ /*_createTemplateError() {
627
+ const div = document.createElement('div');
628
+ div.appendChild(document.createTextNode(''));
629
+ return div;
630
+ }*/
631
+
632
+ /*_createTemplateErrorRowRef() {
633
+ const pre = document.createElement('pre');
634
+ pre.appendChild(document.createTextNode(''));
635
+ pre.classList.add('comp_layer_log_inner');
636
+ const a = pre.appendChild(document.createElement('a'));
637
+ a.classList.add('comp_layer_log_inner');
638
+ a.setAttribute('href', '[[ref]]');
639
+ a.appendChild(document.createTextNode(''));
640
+ return pre;
641
+ }*/
642
+
643
+ /*_createTemplateErrorRowText() {
644
+ const pre = document.createElement('pre');
645
+ pre.appendChild(document.createTextNode(''));
646
+ pre.classList.add('comp_layer_log_inner');
647
+ return pre;
648
+ }*/
649
+ }
650
+
651
+
652
+ module.exports = TemplateLogLog;