@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,185 @@
1
+
2
+ 'use strict';
3
+
4
+ import LogDataAction from 'z-abs-funclayer-engine-cs/clientServer/log/log-data-action';
5
+ import LogType from 'z-abs-funclayer-engine-cs/clientServer/log/log-type';
6
+
7
+
8
+ class Cache {
9
+ constructor() {
10
+ this.elementStartCache = new Map();
11
+ this.elementEndCache = new Map();
12
+ this.elementLogCache = [new Array(LogType.length)];
13
+ for(let i = 0; i < LogType.length; ++i) {
14
+ if(LogType.IP === i) {
15
+ this.elementLogCache[i] = [[new Array(LogDataAction.length)], [new Array(LogDataAction.length)]];
16
+ for(let j = 0; j < LogDataAction.length; ++j) {
17
+ this.elementLogCache[i][0][j] = new Map();
18
+ this.elementLogCache[i][1][j] = new Map();
19
+ }
20
+ }
21
+ else if(LogType.ERROR === i) {
22
+ this.elementLogCache[i] = [[], []];
23
+ }
24
+ else {
25
+ this.elementLogCache[i] = [];
26
+ }
27
+ }
28
+ this._get = [this.getStart.bind(this), this.getEnd.bind(this), this.getLog.bind(this)];
29
+ this._set = [this.setStart.bind(this), this.setEnd.bind(this), this.setLog.bind(this)];
30
+ }
31
+
32
+ getStart(data) {
33
+ const cache = this.elementStartCache.get(data.testCaseId);
34
+ if(!cache) {
35
+ return null;
36
+ }
37
+ else {
38
+ return cache.pop();
39
+ }
40
+ }
41
+
42
+ getEnd(data) {
43
+ const cache = this.elementEndCache.get(data.testCaseId);
44
+ if(cache) {
45
+ if(cache[data.resultId]) {
46
+ return cache[data.resultId].pop();
47
+ }
48
+ }
49
+ return null;
50
+ }
51
+
52
+ getLog(data) {
53
+ let cache = null;
54
+ if(LogType.IP === data.type) {
55
+ const protocolIndex = data.extraData.protocolIndex;
56
+ if(protocolIndex) {
57
+ const hasInners = !data.extraData.innersData?.inners ? 0 : 1;
58
+ const map = this.elementLogCache[LogType.IP][hasInners][data.dataId];
59
+ if(LogDataAction.CLOSING === data.dataId || LogDataAction.CLOSED === data.dataId || LogDataAction.STACK === data.dataId) {
60
+ const id = `${protocolIndex}-${data.extraData.type}`;
61
+ const cachedElements = map.get(id);
62
+ if(cachedElements) {
63
+ const element = cachedElements.pop();
64
+ return element;
65
+ }
66
+ }
67
+ else {
68
+ const cachedElements = map.get(protocolIndex);
69
+ if(cachedElements) {
70
+ const element = cachedElements.pop();
71
+ return element;
72
+ }
73
+ }
74
+ }
75
+ return null;
76
+ }
77
+ else if(LogType.ERROR === data.type) {
78
+ const hasInners = !data.extraData.innersData?.inners ? 0 : 1;
79
+ cache = this.elementLogCache[LogType.ERROR][hasInners];
80
+ }
81
+ else {
82
+ cache = this.elementLogCache[data.type];
83
+ }
84
+ if(cache) {
85
+ const element = cache.pop();
86
+ return element;
87
+ }
88
+ else {
89
+ return null;
90
+ }
91
+ }
92
+
93
+ setStart(data, element) {
94
+ const cache = this.elementStartCache.get(data.testCaseId);
95
+ if(cache) {
96
+ cache.push(element);
97
+ }
98
+ else {
99
+ this.elementStartCache.set(data.testCaseId, [element]);
100
+ }
101
+ }
102
+
103
+ setEnd(data, element) {
104
+ const cache = this.elementEndCache.get(data.testCaseId);
105
+ if(cache) {
106
+ if(cache[data.resultId]) {
107
+ cache[data.resultId].push(element);
108
+ }
109
+ else {
110
+ cache[data.resultId] = [element];
111
+ }
112
+ }
113
+ else {
114
+ const results = new Array(11);
115
+ this.elementEndCache.set(data.testCaseId, results);
116
+ results[data.resultId] = [element];
117
+ }
118
+ }
119
+
120
+ setLog(data, element) {
121
+ if(LogType.IP === data.type) {
122
+ const protocolIndex = data.extraData.protocolIndex;
123
+ if(protocolIndex) {
124
+ const hasInners = !data.extraData.innersData?.inners ? 0 : 1;
125
+ const map = this.elementLogCache[LogType.IP][hasInners][data.dataId];
126
+ if(LogDataAction.CLOSING === data.dataId || LogDataAction.CLOSED === data.dataId || LogDataAction.STACK === data.dataId) {
127
+ const id = `${protocolIndex}-${data.extraData.type}`;
128
+ const cachedElements = map.get(id);
129
+ if(cachedElements) {
130
+ cachedElements.push(element);
131
+ }
132
+ else {
133
+ map.set(id, [element]);
134
+ }
135
+ }
136
+ else {
137
+ const cachedElements = map.get(protocolIndex);
138
+ if(cachedElements) {
139
+ cachedElements.push(element);
140
+ }
141
+ else {
142
+ map.set(protocolIndex, [element]);
143
+ }
144
+ }
145
+ }
146
+ }
147
+ else if(LogType.ERROR === data.type) {
148
+ const hasInners = !data.extraData.innersData?.inners ? 0 : 1;
149
+ this.elementLogCache[LogType.ERROR][hasInners].push(element);
150
+ }
151
+ else {
152
+ this.elementLogCache[data.type].push(element);
153
+ }
154
+ }
155
+
156
+ set(data, element) {
157
+ return this._set[data.dataType](data, element);
158
+ }
159
+
160
+ get(data) {
161
+ return this._get[data.dataType](data);
162
+ }
163
+
164
+ clear() {
165
+ this.elementStartCache.clear();
166
+ this.elementEndCache.clear();
167
+ for(let i = 0; i < LogType.length; ++i) {
168
+ if(LogType.IP === i) {
169
+ for(let j = 0; j < LogDataAction.length; ++j) {
170
+ this.elementLogCache[i][0][j].clear();
171
+ this.elementLogCache[i][1][j].clear();
172
+ }
173
+ }
174
+ else if(LogType.ERROR === i) {
175
+ this.elementLogCache[i] = [[], []];
176
+ }
177
+ else {
178
+ this.elementLogCache[i] = [];
179
+ }
180
+ }
181
+ }
182
+ }
183
+
184
+
185
+ module.exports = Cache;
@@ -0,0 +1,26 @@
1
+
2
+ 'use strict';
3
+
4
+
5
+ class Const {
6
+ static DATA_LOG_START = 0;
7
+ static DATA_LOG_END = 1;
8
+ static DATA_LOG_LOG = 2;
9
+
10
+ static LOCAL_TYPE_IS_CLIENT = 0;
11
+ static LOCAL_TYPE_IS_SERVER = 1;
12
+ static LOCAL_TYPE_IS_UNKNOWN = 2;
13
+
14
+ static ICON_X_HALF = 7;
15
+ static ICON_X = Const.ICON_X_HALF + Const.ICON_X_HALF;
16
+ static ICON_X_WIDTH = Const.ICON_X + Const.ICON_X;
17
+ static ICON_Y_HALF = 5;
18
+ static ICON_Y = Const.ICON_Y_HALF + Const.ICON_Y_HALF;
19
+ static ICON_Y_HEIGHT = Const.ICON_Y + Const.ICON_Y;
20
+
21
+ static SEND = 0;
22
+ static RECEIVE = 1;
23
+ }
24
+
25
+
26
+ module.exports = Const;
@@ -0,0 +1,122 @@
1
+
2
+ 'use strict';
3
+
4
+ import LogType from 'z-abs-funclayer-engine-cs/clientServer/log/log-type';
5
+
6
+
7
+ class LogFilter {
8
+ constructor() {
9
+ this.type = [false, false, true, true, true, true, true, true, false, true, true];
10
+ }
11
+
12
+ init(log) {
13
+ this.type[LogType.ENGINE] = log.filterEngine;
14
+ this.type[LogType.DEBUG] = log.filterDebug;
15
+ this.type[LogType.ERROR] = log.filterError;
16
+ this.type[LogType.WARNING] = log.filterWarning;
17
+ this.type[LogType.IP] = log.filterIP;
18
+ this.type[LogType.GUI] = log.filterGUI;
19
+ this.type[LogType.VERIFY_SUCCESS] = log.filterSuccess;
20
+ this.type[LogType.VERIFY_FAILURE] = log.filterFailure;
21
+ this.type[LogType.TEST_DATA] = log.filterTestData;
22
+ this.type[LogType.BROWSER_LOG] = log.filterBrowserLog;
23
+ this.type[LogType.BROWSER_ERR] = log.filterBrowserErr;
24
+ }
25
+
26
+ update(log) {
27
+ let isUpdated = false;
28
+ if(this.type[LogType.ENGINE] !== log.filterEngine) {
29
+ this.setFilterEngine(log.filterEngine);
30
+ isUpdated = true;
31
+ }
32
+ if(this.type[LogType.DEBUG] !== log.filterDebug) {
33
+ this.setFilterDebug(log.filterDebug);
34
+ isUpdated = true;
35
+ }
36
+ if(this.type[LogType.ERROR] !== log.filterError) {
37
+ this.setFilterError(log.filterError);
38
+ isUpdated = true;
39
+ }
40
+ if(this.type[LogType.WARNING] !== log.filterWarning) {
41
+ this.setFilterWarning(log.filterWarning);
42
+ isUpdated = true;
43
+ }
44
+ if(this.type[LogType.IP] !== log.filterIP) {
45
+ this.setFilterIP(log.filterIP);
46
+ isUpdated = true;
47
+ }
48
+ if(this.type[LogType.GUI] !== log.filterGUI) {
49
+ this.setFilterGUI(log.filterGUI);
50
+ isUpdated = true;
51
+ }
52
+ if(this.type[LogType.VERIFY_SUCCESS] !== log.filterSuccess) {
53
+ this.setFilterSuccess(log.filterSuccess);
54
+ isUpdated = true;
55
+ }
56
+ if(this.type[LogType.VERIFY_FAILURE] !== log.filterFailure) {
57
+ this.setFilterFailure(log.filterFailure);
58
+ isUpdated = true;
59
+ }
60
+ if(this.type[LogType.TEST_DATA] !== log.filterTestData) {
61
+ this.setFilterTestData(log.filterTestData);
62
+ isUpdated = true;
63
+ }
64
+ if(this.type[LogType.BROWSER_LOG] !== log.filterBrowserLog) {
65
+ this.setFilterBrowserLog(log.filterBrowserLog);
66
+ isUpdated = true;
67
+ }
68
+ if(this.type[LogType.BROWSER_ERR] !== log.filterBrowserErr) {
69
+ this.setFilterBrowserErr(log.filterBrowserErr);
70
+ isUpdated = true;
71
+ }
72
+ // console.log('log-filter:', isUpdated);
73
+ return isUpdated;
74
+ }
75
+
76
+ setFilterEngine(filterEngine) {
77
+ this.type[LogType.ENGINE] = filterEngine;
78
+ }
79
+
80
+ setFilterDebug(filterDebug) {
81
+ this.type[LogType.DEBUG] = filterDebug;
82
+ }
83
+
84
+ setFilterError(filterError) {
85
+ this.type[LogType.ERROR] = filterError;
86
+ }
87
+
88
+ setFilterWarning(filterWarning) {
89
+ this.type[LogType.WARNING] = filterWarning;
90
+ }
91
+
92
+ setFilterIP(filterIP) {
93
+ this.type[LogType.IP] = filterIP;
94
+ }
95
+
96
+ setFilterGUI(filterGUI) {
97
+ this.type[LogType.GUI] = filterGUI;
98
+ }
99
+
100
+ setFilterSuccess(filterSuccess) {
101
+ this.type[LogType.VERIFY_SUCCESS] = filterSuccess;
102
+ }
103
+
104
+ setFilterFailure(filterFailure) {
105
+ this.type[LogType.VERIFY_FAILURE] = filterFailure;
106
+ }
107
+
108
+ setFilterTestData(filterTestData) {
109
+ this.type[LogType.TEST_DATA] = filterTestData;
110
+ }
111
+
112
+ setFilterBrowserLog(filterBrowserLog) {
113
+ this.type[LogType.BROWSER_LOG] = filterBrowserLog;
114
+ }
115
+
116
+ setFilterBrowserErr(filterBrowserErr) {
117
+ this.type[LogType.BROWSER_ERR] = filterBrowserErr;
118
+ }
119
+ }
120
+
121
+
122
+ module.exports = LogFilter;
@@ -0,0 +1,296 @@
1
+
2
+ 'use strict';
3
+
4
+ import Cache from '../logic/cache';
5
+ import Const from '../logic/const';
6
+ import TemplateLogStart from '../templates/template-log-start';
7
+ import TemplateLogEnd from '../templates/template-log-end';
8
+ import TemplateLogLog from '../templates/template-log-log';
9
+ import TemplateInners from 'z-abs-complayer-visualizationinner-client/client/templates/template-inners';
10
+ import InnerConst from 'z-abs-complayer-visualizationinner-client/client/logic/inner-const';
11
+ import TemplateIcon from '../templates/template-icons/template-icon';
12
+ import DataLogDynamicBuffer from 'z-abs-complayer-visualizationinner-client/client/data/data-log-dynamic-buffer';
13
+ import DataScrollListNode from 'z-abs-complayer-visualizationinner-client/client/data/data-scroll-list-node';
14
+ import ScrollList from 'z-abs-complayer-bootstrap-client/client/scroll-list/scroll-list';
15
+ import ScrollListNode from 'z-abs-complayer-bootstrap-client/client/scroll-list/scroll-list-node';
16
+ import ScrollListTemplateData from 'z-abs-complayer-bootstrap-client/client/scroll-list/scroll-list-template-data';
17
+ import PooledBuffers from 'z-abs-corelayer-client/client/communication/core-protocol/pooled-buffers';
18
+ import ReactComponentRealtimeRenderer from 'z-abs-corelayer-client/client/react-component/react-component-realtime-renderer';
19
+ import AppProtocolConst from 'z-abs-funclayer-engine-cs/clientServer/communication/app-protocol/app-protocol-const';
20
+ import ActorResultConst from 'z-abs-funclayer-engine-cs/clientServer/execution/actor-result-const';
21
+ import LogType from 'z-abs-funclayer-engine-cs/clientServer/log/log-type';
22
+ import React from 'react';
23
+
24
+
25
+ export default class Log extends ReactComponentRealtimeRenderer {
26
+ constructor(props) {
27
+ super(props, [props.store]);
28
+ this.isActive = false;
29
+ this.logId = 0;
30
+ this.name = '';
31
+ this.logClient = false;
32
+ this.logConsole = false;
33
+ this.logClientSettingLog = false;
34
+ this.logClientSettingTc = false;
35
+ this.logClientSettingTs = false;
36
+ this.logClientSettingSum = false;
37
+ this.logClientSettingErr = false;
38
+ this.logConsoleSettingLog = false;
39
+ this.logConsoleSettingTc = false;
40
+ this.logConsoleSettingTs = false;
41
+ this.logConsoleSettingSum = false;
42
+ this.logConsoleSettingErr = false;
43
+ this.refDivHeading = React.createRef();
44
+ this.refDivLog = React.createRef();
45
+ this.logStartTemplate = new TemplateLogStart();
46
+ this.logEndTemplate = new TemplateLogEnd();
47
+ this.logLogTemplate = new TemplateLogLog();
48
+ this.cache = new Cache();
49
+ this.pooledBuffers = new PooledBuffers('log');
50
+ this.templateInners = new TemplateInners('log', TemplateLogLog.createInners, this.calculateInnersSize.bind(this));
51
+ this.templates = [
52
+ new TemplateLogStart(),
53
+ new TemplateLogEnd(),
54
+ new TemplateLogLog(this.templateInners)
55
+ ];
56
+ this.scrollList = new ScrollList(props.name, new ScrollListTemplateData(this.templates, new DataScrollListNode(this.pooledBuffers)), (autoScroll) => {
57
+ if(props.onAutoScroll) {
58
+ props.onAutoScroll(autoScroll);
59
+ }
60
+ }, (data, cb, ...params) => {
61
+ this._renderActiveRealtime(data, cb, ...params);
62
+ }, (left) => {
63
+ this.refDivHeading.current.setAttribute('style', `left:${-left}px;`);
64
+ }, this.cache);
65
+ this.cbIsRealtime = () => {
66
+ return true;
67
+ };
68
+ }
69
+
70
+ didMount() {
71
+ const storeState = this.state[this.props.storeName];
72
+ this.props.filter.update(storeState.buttons.log);
73
+ if(0 !== this.props.stackStyles.size) {
74
+ this.prepairComponents(this.props, true);
75
+ }
76
+ this.scrollList.init(this.refDivLog.current, storeState.buttons.log.scroll, storeState.buttons.log.zoom);
77
+ }
78
+
79
+ willUnmount() {
80
+ //ContentCache.clear();
81
+ this.cache.clear();
82
+ this.pooledBuffers.clear();
83
+ PooledBuffers.clear();
84
+ ddgc.gc();
85
+ this.prepairComponents(this.props, false);
86
+ this.scrollList.exit();
87
+ }
88
+
89
+ realtimeUpdate(nextProps, nextState) {
90
+ const storeState = this.state[this.props.storeName];
91
+ const nextStoreState = nextState[nextProps.storeName];
92
+ if(this.props.buttonsLoaded !== nextProps.buttonsLoaded || !this.shallowCompare(this.props.stackStyles, nextProps.stackStyles)) {
93
+ this.prepairComponents(nextProps, true);
94
+ }
95
+ if(nextStoreState.buttons.log !== storeState.buttons.log) {
96
+ const filterChangedSize = nextProps.filter.update(nextStoreState.buttons.log);
97
+ this.scrollList.update(nextStoreState.buttons.log.scroll, nextStoreState.buttons.log.zoom, filterChangedSize);
98
+ }
99
+ }
100
+
101
+ active(active) {
102
+ const prevActive = this.isActive;
103
+ this.isActive = active;
104
+ this.scrollList.active(active);
105
+ if(!prevActive && active) {
106
+ this._renderActiveRealtime([false, false]);
107
+ }
108
+ }
109
+
110
+ onRenderRealtimeFrame(timestamp, clear, force) {
111
+ this.scrollList.renderRealtimeFrame(timestamp, clear, force);
112
+ }
113
+
114
+ _template(index, ...params) {
115
+ const template = this.templates[index];
116
+ if(template) {
117
+ const bufferData = template.store(...params);
118
+ const node = new ScrollListNode(bufferData);
119
+ this.scrollList.add(node, index);
120
+ this._renderActiveRealtime([false, false]);
121
+ }
122
+ }
123
+
124
+ onRealtimeMessage(msg) {
125
+ if(AppProtocolConst.LOG === msg.msgId) {
126
+ if(this.logClientSettingLog) {
127
+ this._template(Const.DATA_LOG_LOG, msg, ++this.logId);
128
+ }
129
+ if(this.logConsoleSettingLog) {
130
+ ddb.logs[msg.type](msg.date, msg.fileName, msg.lineNumber, msg.log.padEnd(80, ' '));
131
+ }
132
+ }
133
+ else if(AppProtocolConst.TEST_CASE_STARTED === msg.msgId) {
134
+ if(this.logClientSettingTc) {
135
+ this.name = msg.name;
136
+ this._template(Const.DATA_LOG_START, msg, 1, 1);
137
+ }
138
+ }
139
+ else if(AppProtocolConst.TEST_CASE_STOPPED === msg.msgId) {
140
+ if(this.logClientSettingTc) {
141
+ this._template(Const.DATA_LOG_END, msg);
142
+ }
143
+ if(this.logConsoleSettingTc) {
144
+ ddb.print(ActorResultConst.RESULTS_CONSOLE[msg.resultId], this.name);
145
+ }
146
+ }
147
+ else if(AppProtocolConst.TEST_SUITE_STOPPED === msg.msgId) {
148
+ if(this.logConsoleSettingTs) {
149
+
150
+ }
151
+ }
152
+ else if(AppProtocolConst.TEST_CASE_CLEAR === msg.msgId && 'TestCase' === this.props.clearMsgPrefix) {
153
+ if('log' === msg.tab) {
154
+ this._renderActiveRealtime([true, false], () => {
155
+ //ContentCache.clear();
156
+ this.cache.clear();
157
+ this.pooledBuffers.clear();
158
+ ddgc.gc();
159
+ });
160
+ }
161
+ }
162
+ else if(AppProtocolConst.TEST_SUITE_CLEAR === msg.msgId && 'TestSuite' === this.props.clearMsgPrefix) {
163
+ if('log' === msg.tab) {
164
+ this._renderActiveRealtime([true, false], () => {
165
+ //ContentCache.clear();
166
+ this.cache.clear();
167
+ this.pooledBuffers.clear();
168
+ ddgc.gc();
169
+ });
170
+ }
171
+ }
172
+ else if(AppProtocolConst.EXECUTION_STARTED === msg.msgId) {
173
+ this.logClient = !!(1 & msg.chosen);
174
+ this.logConsole = !!(2 & msg.chosen);
175
+ this.logClientSettingLog = this.logClient && !!(1 & msg.clientLogSettings);
176
+ this.logClientSettingTc = this.logClient && !!(2 & msg.clientLogSettings);
177
+ this.logClientSettingTs = this.logClient && !!(4 & msg.clientLogSettings);
178
+ this.logClientSettingSum = this.logClient && !!(8 & msg.clientLogSettings);
179
+ this.logClientSettingErr = this.logClient && !!(16 & msg.clientLogSettings);
180
+ this.logConsoleSettingLog = this.logConsole && !!(1 & msg.clientConsoleLogSettings);
181
+ this.logConsoleSettingTc = this.logConsole && !!(2 & msg.clientConsoleLogSettings);
182
+ this.logConsoleSettingTs = this.logConsole && !!(4 & msg.clientConsoleLogSettings);
183
+ this.logConsoleSettingSum = this.logConsole && !!(8 & msg.clientConsoleLogSettings);
184
+ this.logConsoleSettingErr = this.logConsole && !!(16 & msg.clientConsoleLogSettings);
185
+ }
186
+ }
187
+
188
+ _updateScrollList() {
189
+ const storeState = this.state[this.props.storeName];
190
+ this.scrollList.update(storeState.buttons.log.scroll, storeState.buttons.log.zoom, true);
191
+ }
192
+
193
+ _prepairComponent(func, initOrexit, object, ...params) {
194
+ func(() => {
195
+ if(initOrexit) {
196
+ if(params) {
197
+ object.init(...params);
198
+ }
199
+ else {
200
+ object.init();
201
+ }
202
+ }
203
+ else {
204
+ object.exit();
205
+ }
206
+ });
207
+ }
208
+
209
+ prepairComponents(props, initOrexit) {
210
+ if(props.buttonsLoaded) {
211
+ let pendings = {p: 0};
212
+ const func = (cb) => {
213
+ ++pendings.p;
214
+ setTimeout((cb, pendings, initOrexit, props) => {
215
+ cb();
216
+ if(0 === --pendings.p) {
217
+ if(initOrexit) {
218
+ props.onOnit();
219
+ }
220
+ }
221
+ }, 0, cb, pendings, initOrexit, props);
222
+ };
223
+ this._prepairComponent(func, initOrexit, DataLogDynamicBuffer, this.pooledBuffers);
224
+ this._prepairComponent(func, initOrexit, this.templateInners, props.stackStyles, this._updateScrollList.bind(this));
225
+ this.templates.forEach((template) => {
226
+ if(template) {
227
+ this._prepairComponent(func, initOrexit, template, props.filter, this.pooledBuffers, props.stackStyles, this.templateInners, this._updateScrollList.bind(this));
228
+ }
229
+ });
230
+ this._prepairComponent(func, initOrexit, TemplateIcon, props.stackStyles);
231
+ func(() => {
232
+ if(initOrexit) {
233
+ this.scrollList.refresh();
234
+ }
235
+ });
236
+ }
237
+ }
238
+
239
+ _renderActiveRealtime(data, cb, ...params) {
240
+ if(this.isActive || data[0] || data[1]) {
241
+ this.renderRealtimeData(data, cb, ...params);
242
+ }
243
+ }
244
+
245
+ calculateInnersSize(inners, type) {
246
+ const size = {p: LogType.IP === type ? 30 : 10};
247
+ this._calculateInnersSize(inners, size);
248
+ return size.p;
249
+ }
250
+
251
+ _calculateInnersSize(inners, size) {
252
+ inners.forEach((inner) => {
253
+ size.p += 15;
254
+ if(inner.isOpen) {
255
+ this._calculateInnersSize(inner.inners, size);
256
+ }
257
+ });
258
+ }
259
+
260
+ render() {
261
+ return (
262
+ <>
263
+ <div ref={this.refDivHeading} className="comp_layer_log_heading">
264
+ <div className="comp_layer_log_heading_column comp_layer_log_heading_column_nbr">
265
+ #
266
+ </div>
267
+ <div className="comp_layer_log_heading_column comp_layer_log_heading_column_type">
268
+ type
269
+ </div>
270
+ <div className="comp_layer_log_heading_column comp_layer_log_heading_column_date">
271
+ date
272
+ </div>
273
+ <div className="comp_layer_log_heading_column comp_layer_log_heading_column_actor">
274
+ actor
275
+ </div>
276
+ <div className="comp_layer_log_heading_column comp_layer_log_heading_column_file_name">
277
+ file name
278
+ </div>
279
+ <div className="comp_layer_log_heading_column comp_layer_log_heading_column_log">
280
+ log
281
+ </div>
282
+ </div>
283
+ <svg width="0" height="0" xmlns={InnerConst.SVG_NS}>
284
+ <defs>
285
+ <radialGradient id="ipLogGradient" cx="50%" cy="50%" r="50%">
286
+ <stop offset="70%" stopColor="white"/>
287
+ <stop offset="100%" stopColor="#DDDDFF"/>
288
+ </radialGradient>
289
+ </defs>
290
+ </svg>
291
+ <div ref={this.refDivLog} className="comp_layer_log_rows">
292
+ </div>
293
+ </>
294
+ );
295
+ }
296
+ }
@@ -0,0 +1,35 @@
1
+
2
+ 'use strict';
3
+
4
+ import Const from '../../../logic/const';
5
+ import InnerConst from 'z-abs-complayer-visualizationinner-client/client/logic/inner-const';
6
+
7
+
8
+ class TemplateArrowHead {
9
+ static template = new Array(2);
10
+
11
+ static {
12
+ const ARROW_LEFT = Const.ICON_X + 8;
13
+ const ARROW_RIGHT = Const.ICON_X + 11;
14
+ const ARROW_TOP = Const.ICON_Y - 1.5;
15
+ const ARROW_MIDDLE = Const.ICON_Y;
16
+ const BOTTOM = Const.ICON_Y + 1.5;
17
+ const ARROW_LEFT_R = Const.ICON_X + 2;
18
+ const ARROW_RIGHT_R = Const.ICON_X + 5;
19
+
20
+ const arrowSend = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
21
+ arrowSend.setAttribute('points', `${ARROW_LEFT},${BOTTOM} ${ARROW_LEFT},${ARROW_TOP} ${ARROW_RIGHT},${ARROW_MIDDLE}`);
22
+ TemplateArrowHead.template[Const.SEND] = arrowSend;
23
+
24
+ const arrowReceive = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
25
+ arrowReceive.setAttribute('points', `${ARROW_RIGHT_R},${BOTTOM} ${ARROW_RIGHT_R},${ARROW_TOP} ${ARROW_LEFT_R},${ARROW_MIDDLE}`);
26
+ TemplateArrowHead.template[Const.RECEIVE] = arrowReceive;
27
+ }
28
+
29
+ static create(direction) {
30
+ return TemplateArrowHead.template[direction].cloneNode(true);
31
+ }
32
+ }
33
+
34
+
35
+ module.exports = TemplateArrowHead;
@@ -0,0 +1,34 @@
1
+
2
+ 'use strict';
3
+
4
+ import Const from '../../../logic/const';
5
+ import InnerConst from 'z-abs-complayer-visualizationinner-client/client/logic/inner-const';
6
+
7
+
8
+ class TemplateArrowLine {
9
+ static template = new Array(2);
10
+
11
+ static {
12
+ const templateSend = document.createElementNS(InnerConst.SVG_NS, 'line');
13
+ templateSend.setAttribute('y1', Const.ICON_Y);
14
+ templateSend.setAttribute('y2', Const.ICON_Y);
15
+ templateSend.setAttribute('x1', Const.ICON_X + 2);
16
+ templateSend.setAttribute('x2', Const.ICON_X + 8);
17
+ templateSend.setAttribute('stroke-width', 2);
18
+ TemplateArrowLine.template[Const.SEND] = templateSend;
19
+ const templateReceive = document.createElementNS(InnerConst.SVG_NS, 'line');
20
+ templateReceive.setAttribute('y1', Const.ICON_Y);
21
+ templateReceive.setAttribute('y2', Const.ICON_Y);
22
+ templateReceive.setAttribute('x1', Const.ICON_X + 5);
23
+ templateReceive.setAttribute('x2', Const.ICON_X + 11);
24
+ templateReceive.setAttribute('stroke-width', 2);
25
+ TemplateArrowLine.template[Const.RECEIVE] = templateReceive;
26
+ }
27
+
28
+ static create(direction) {
29
+ return TemplateArrowLine.template[direction].cloneNode(true);
30
+ }
31
+ }
32
+
33
+
34
+ module.exports = TemplateArrowLine;