@aj-shadow/z-abs-complayer-markup-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 (208) 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-Markup-client.bld +40 -0
  7. package/project/client/_build/Client-CompLayer-Markup-client-jsx.bld +10 -0
  8. package/project/client/_build/Client-CompLayer-Markup-client.bld +10 -0
  9. package/project/client/_build/Client-css-CompLayer-Markup-bundle.bld +9 -0
  10. package/project/client/_build/z-abs-complayer-markup-client.prj +36 -0
  11. package/project/client/actions/action-style.js +17 -0
  12. package/project/client/actions/data-action-style.js +13 -0
  13. package/project/client/css/markup_addressing.css +30 -0
  14. package/project/client/css/markup_flowchart.css +53 -0
  15. package/project/client/css/markup_general.css +4 -0
  16. package/project/client/css/markup_image.css +10 -0
  17. package/project/client/css/markup_license.css +107 -0
  18. package/project/client/css/markup_login.css +201 -0
  19. package/project/client/css/markup_node_diagram.css +51 -0
  20. package/project/client/css/markup_sequence_diagram.css +6 -0
  21. package/project/client/css/markup_state.css +5 -0
  22. package/project/client/css/markup_table.css +57 -0
  23. package/project/client/css/markup_tc.css +32 -0
  24. package/project/client/css/markup_ts.css +36 -0
  25. package/project/client/data/addresses/data-addresses-client-address-global.js +20 -0
  26. package/project/client/data/addresses/data-addresses-client-address-local.js +20 -0
  27. package/project/client/data/addresses/data-addresses-client-interface-global.js +17 -0
  28. package/project/client/data/addresses/data-addresses-client-interface-local.js +17 -0
  29. package/project/client/data/addresses/data-addresses-dns-global.js +18 -0
  30. package/project/client/data/addresses/data-addresses-dns-local.js +19 -0
  31. package/project/client/data/addresses/data-addresses-dst-global.js +20 -0
  32. package/project/client/data/addresses/data-addresses-dst-local.js +20 -0
  33. package/project/client/data/addresses/data-addresses-network-interface-global.js +17 -0
  34. package/project/client/data/addresses/data-addresses-network-interface-local.js +17 -0
  35. package/project/client/data/addresses/data-addresses-ports-global.js +18 -0
  36. package/project/client/data/addresses/data-addresses-ports-local.js +18 -0
  37. package/project/client/data/addresses/data-addresses-server-address-global.js +20 -0
  38. package/project/client/data/addresses/data-addresses-server-address-local.js +20 -0
  39. package/project/client/data/addresses/data-addresses-server-interface-global.js +17 -0
  40. package/project/client/data/addresses/data-addresses-server-interface-local.js +17 -0
  41. package/project/client/data/addresses/data-addresses-src-global.js +21 -0
  42. package/project/client/data/addresses/data-addresses-src-local.js +21 -0
  43. package/project/client/data/addresses/data-addresses-srv-global.js +20 -0
  44. package/project/client/data/addresses/data-addresses-srv-local.js +20 -0
  45. package/project/client/data/addresses/data-addresses-sut-address-global.js +20 -0
  46. package/project/client/data/addresses/data-addresses-sut-address-local.js +20 -0
  47. package/project/client/data/addresses/data-addresses-sut-interface-global.js +19 -0
  48. package/project/client/data/addresses/data-addresses-sut-interface-local.js +19 -0
  49. package/project/client/data/data-chart/data-chart-axis.js +13 -0
  50. package/project/client/data/data-chart/data-chart-grid.js +14 -0
  51. package/project/client/data/data-chart/data-chart-line/data-chart-line-config.js +17 -0
  52. package/project/client/data/data-chart/data-chart-line/data-chart-line.js +41 -0
  53. package/project/client/data/data-config.js +14 -0
  54. package/project/client/data/data-constructor.js +18 -0
  55. package/project/client/data/data-content/data-content-audio-global.js +18 -0
  56. package/project/client/data/data-content/data-content-audio-local.js +18 -0
  57. package/project/client/data/data-content/data-content-documents-global.js +18 -0
  58. package/project/client/data/data-content/data-content-documents-local.js +18 -0
  59. package/project/client/data/data-content/data-content-image-global.js +21 -0
  60. package/project/client/data/data-content/data-content-image-local.js +21 -0
  61. package/project/client/data/data-content/data-content-other-global.js +20 -0
  62. package/project/client/data/data-content/data-content-other-local.js +20 -0
  63. package/project/client/data/data-content/data-content-text-global.js +20 -0
  64. package/project/client/data/data-content/data-content-text-local.js +20 -0
  65. package/project/client/data/data-content/data-content-video-global.js +20 -0
  66. package/project/client/data/data-content/data-content-video-local.js +20 -0
  67. package/project/client/data/data-data.js +28 -0
  68. package/project/client/data/data-dependencies/data-dependencies.js +17 -0
  69. package/project/client/data/data-documentation/data-documentation-navigation.js +15 -0
  70. package/project/client/data/data-documentation/data-documentation.js +20 -0
  71. package/project/client/data/data-flowchart/data-flowchart-block.js +33 -0
  72. package/project/client/data/data-flowchart/data-flowchart-connection.js +17 -0
  73. package/project/client/data/data-flowchart/data-flowchart.js +30 -0
  74. package/project/client/data/data-html/data-html-anchor.js +12 -0
  75. package/project/client/data/data-html/data-html-br.js +11 -0
  76. package/project/client/data/data-html/data-html-button.js +15 -0
  77. package/project/client/data/data-html/data-html-log-start.js +12 -0
  78. package/project/client/data/data-html/data-html-log-stop.js +13 -0
  79. package/project/client/data/data-html/data-html-log.js +16 -0
  80. package/project/client/data/data-html/data-html-toolbar.js +19 -0
  81. package/project/client/data/data-image/data-image.js +20 -0
  82. package/project/client/data/data-lab/data-lab-interface-client.js +19 -0
  83. package/project/client/data/data-lab/data-lab-interface-server.js +19 -0
  84. package/project/client/data/data-lab/data-lab-interface-sut.js +20 -0
  85. package/project/client/data/data-lab/data-lab-network.js +31 -0
  86. package/project/client/data/data-lab/data-lab.js +21 -0
  87. package/project/client/data/data-licenses/data-licenses.js +16 -0
  88. package/project/client/data/data-node-diagram/data-node-diagram-config.js +21 -0
  89. package/project/client/data/data-node-diagram/data-node-diagram-connection.js +18 -0
  90. package/project/client/data/data-node-diagram/data-node-diagram-group.js +16 -0
  91. package/project/client/data/data-node-diagram/data-node-diagram-node.js +22 -0
  92. package/project/client/data/data-node-diagram/data-node-diagram.js +47 -0
  93. package/project/client/data/data-repos/data-repos-content-local.js +15 -0
  94. package/project/client/data/data-repos/data-repos-data-local.js +15 -0
  95. package/project/client/data/data-sequence-diagram/data-sequence-diagram-config.js +22 -0
  96. package/project/client/data/data-sequence-diagram/data-sequence-diagram-message.js +17 -0
  97. package/project/client/data/data-sequence-diagram/data-sequence-diagram-node.js +11 -0
  98. package/project/client/data/data-sequence-diagram/data-sequence-diagram.js +32 -0
  99. package/project/client/data/data-state-machine/data-state-machine-config.js +17 -0
  100. package/project/client/data/data-state-machine/data-state-machine-state.js +29 -0
  101. package/project/client/data/data-state-machine/data-state-machine-transition.js +18 -0
  102. package/project/client/data/data-state-machine/data-state-machine.js +37 -0
  103. package/project/client/data/data-system-under-test/data-system-under-test-instances.js +15 -0
  104. package/project/client/data/data-system-under-test/data-system-under-test-nodes.js +18 -0
  105. package/project/client/data/data-table/data-table-config.js +21 -0
  106. package/project/client/data/data-table-key-value.js +56 -0
  107. package/project/client/data/data-test-case/data-actor.js +282 -0
  108. package/project/client/data/data-test-case/data-test-case-settings.js +49 -0
  109. package/project/client/data/data-test-case/data-test-case.js +19 -0
  110. package/project/client/data/data-test-case/data-test-data-iteration.js +54 -0
  111. package/project/client/data/data-test-case/data-test-data-test-case.js +16 -0
  112. package/project/client/data/data-test-case/data-verification-test-case.js +24 -0
  113. package/project/client/data/data-test-data/data-test-data-environment-global.js +18 -0
  114. package/project/client/data/data-test-data/data-test-data-environment-local.js +18 -0
  115. package/project/client/data/data-test-data/data-test-data-environment-static.js +16 -0
  116. package/project/client/data/data-test-data/data-test-data-general-global.js +18 -0
  117. package/project/client/data/data-test-data/data-test-data-general-local.js +18 -0
  118. package/project/client/data/data-test-data/data-test-data-output-global.js +18 -0
  119. package/project/client/data/data-test-data/data-test-data-output-local.js +18 -0
  120. package/project/client/data/data-test-data/data-test-data-system-global.js +18 -0
  121. package/project/client/data/data-test-data/data-test-data-system-local.js +18 -0
  122. package/project/client/data/data-test-suite/data-test-suite-abstraction.js +72 -0
  123. package/project/client/data/data-test-suite/data-test-suite.js +15 -0
  124. package/project/client/data/data-tree/data-tree-node.js +17 -0
  125. package/project/client/data/data-tree/data-tree.js +13 -0
  126. package/project/client/markup/markup-addresses/markup-addresses-client-address.js +31 -0
  127. package/project/client/markup/markup-addresses/markup-addresses-client-interface.js +31 -0
  128. package/project/client/markup/markup-addresses/markup-addresses-dns.js +32 -0
  129. package/project/client/markup/markup-addresses/markup-addresses-dst.js +31 -0
  130. package/project/client/markup/markup-addresses/markup-addresses-network-interface.js +31 -0
  131. package/project/client/markup/markup-addresses/markup-addresses-ports.js +31 -0
  132. package/project/client/markup/markup-addresses/markup-addresses-server-address.js +31 -0
  133. package/project/client/markup/markup-addresses/markup-addresses-server-interface.js +31 -0
  134. package/project/client/markup/markup-addresses/markup-addresses-src.js +31 -0
  135. package/project/client/markup/markup-addresses/markup-addresses-srv.js +31 -0
  136. package/project/client/markup/markup-addresses/markup-addresses-sut-address.js +31 -0
  137. package/project/client/markup/markup-addresses/markup-addresses-sut-interface.js +31 -0
  138. package/project/client/markup/markup-chart/markup-chart-line.js +92 -0
  139. package/project/client/markup/markup-content/markup-content-audio.js +31 -0
  140. package/project/client/markup/markup-content/markup-content-documents.js +31 -0
  141. package/project/client/markup/markup-content/markup-content-image.js +31 -0
  142. package/project/client/markup/markup-content/markup-content-other.js +31 -0
  143. package/project/client/markup/markup-content/markup-content-text.js +31 -0
  144. package/project/client/markup/markup-content/markup-content-video.js +31 -0
  145. package/project/client/markup/markup-dependencies/markup-dependencies.js +30 -0
  146. package/project/client/markup/markup-documentation/markup-documentation-anchor.js +37 -0
  147. package/project/client/markup/markup-documentation/markup-documentation-api-status.js +67 -0
  148. package/project/client/markup/markup-documentation/markup-documentation-code.js +20 -0
  149. package/project/client/markup/markup-documentation/markup-documentation-div.js +34 -0
  150. package/project/client/markup/markup-documentation/markup-documentation-documentation-status.js +67 -0
  151. package/project/client/markup/markup-documentation/markup-documentation-embed.js +23 -0
  152. package/project/client/markup/markup-documentation/markup-documentation-html.js +139 -0
  153. package/project/client/markup/markup-documentation/markup-documentation-ie.js +21 -0
  154. package/project/client/markup/markup-documentation/markup-documentation-image.js +46 -0
  155. package/project/client/markup/markup-documentation/markup-documentation-lab.js +19 -0
  156. package/project/client/markup/markup-documentation/markup-documentation-local-note.js +33 -0
  157. package/project/client/markup/markup-documentation/markup-documentation-navigation.js +109 -0
  158. package/project/client/markup/markup-documentation/markup-documentation-page.js +262 -0
  159. package/project/client/markup/markup-documentation/markup-documentation-ref.js +28 -0
  160. package/project/client/markup/markup-documentation/markup-documentation-result.js +21 -0
  161. package/project/client/markup/markup-documentation/markup-documentation-state-machine.js +194 -0
  162. package/project/client/markup/markup-documentation/markup-documentation.js +74 -0
  163. package/project/client/markup/markup-flowchart.js +264 -0
  164. package/project/client/markup/markup-lab.js +116 -0
  165. package/project/client/markup/markup-licenses/markup-licenses.js +29 -0
  166. package/project/client/markup/markup-node-diagram.js +435 -0
  167. package/project/client/markup/markup-parse-helper.js +26 -0
  168. package/project/client/markup/markup-pattern-config.js +53 -0
  169. package/project/client/markup/markup-pattern-data.js +50 -0
  170. package/project/client/markup/markup-pattern-function.js +47 -0
  171. package/project/client/markup/markup-repos/markup-repos.js +31 -0
  172. package/project/client/markup/markup-sequence-diagram.js +466 -0
  173. package/project/client/markup/markup-system-under-test/markup-system-under-test-instances.js +29 -0
  174. package/project/client/markup/markup-system-under-test/markup-system-under-test-nodes.js +30 -0
  175. package/project/client/markup/markup-table-key-value-parse.js +25 -0
  176. package/project/client/markup/markup-table-key-value-stringify.js +91 -0
  177. package/project/client/markup/markup-table-key-value.js +18 -0
  178. package/project/client/markup/markup-table-name-value.js +101 -0
  179. package/project/client/markup/markup-table.js +85 -0
  180. package/project/client/markup/markup-tables-parser.js +122 -0
  181. package/project/client/markup/markup-test-case/markup-test-case.js +67 -0
  182. package/project/client/markup/markup-test-data/markup-test-data-environment.js +31 -0
  183. package/project/client/markup/markup-test-data/markup-test-data-general.js +31 -0
  184. package/project/client/markup/markup-test-data/markup-test-data-output.js +31 -0
  185. package/project/client/markup/markup-test-data/markup-test-data-system.js +31 -0
  186. package/project/client/markup/markup-test-suite/markup-test-suite.js +40 -0
  187. package/project/client/react-components/helper/line-data.js +16 -0
  188. package/project/client/react-components/helper/line-object.js +22 -0
  189. package/project/client/react-components/helper/scroll-data.js +74 -0
  190. package/project/client/react-components/markup/component-chart/component-image-chart-line.jsx +203 -0
  191. package/project/client/react-components/markup/component-code.jsx +50 -0
  192. package/project/client/react-components/markup/component-document.jsx +105 -0
  193. package/project/client/react-components/markup/component-documentation-anchor.jsx +47 -0
  194. package/project/client/react-components/markup/component-embed.jsx +48 -0
  195. package/project/client/react-components/markup/component-image-flowchart.jsx +389 -0
  196. package/project/client/react-components/markup/component-image-image.jsx +32 -0
  197. package/project/client/react-components/markup/component-image-lab.jsx +696 -0
  198. package/project/client/react-components/markup/component-image-node-diagram.jsx +506 -0
  199. package/project/client/react-components/markup/component-image-result.jsx +22 -0
  200. package/project/client/react-components/markup/component-image-sequence-diagram.jsx +645 -0
  201. package/project/client/react-components/markup/component-image-state-machine.jsx +633 -0
  202. package/project/client/react-components/markup/component-image-table.jsx +96 -0
  203. package/project/client/react-components/markup/component-local-note.jsx +99 -0
  204. package/project/client/react-components/markup/component-markup-remarkable.jsx +79 -0
  205. package/project/client/react-components/markup/component-markup.jsx +1036 -0
  206. package/project/client/react-components/markup/component-table-data-table.jsx +146 -0
  207. package/project/client/stores/style-store.js +96 -0
  208. package/project/z-abs-complayer-markup-client.tree +239 -0
@@ -0,0 +1,696 @@
1
+
2
+ 'use strict';
3
+
4
+ import Group from 'z-abs-complayer-bootstrap-client/client/group';
5
+ import ReactComponentBase from 'z-abs-corelayer-client/client/react-component/react-component-base';
6
+ import React from 'react';
7
+
8
+
9
+ export default class ComponentImageLab extends ReactComponentBase {
10
+ constructor(props) {
11
+ super(props);
12
+ this.nodeY = 30;
13
+ this.networkWidth = 20;
14
+ this.nodeWidth = 100;
15
+ this.nodeWidthHalf = this.nodeWidth / 2;
16
+ this.nodeHeight = 10;
17
+
18
+ this.nodeClientX = 30;
19
+ this.clientNetworkX = this.nodeClientX + this.nodeWidth - 4;
20
+ this.clientAddressesX = this.clientNetworkX + this.networkWidth;
21
+
22
+ this.nodeSutX = 750;
23
+ this.sutServerNetworkX = this.nodeSutX - this.networkWidth + 4;
24
+ this.sutServerAddressesX = this.sutServerNetworkX;
25
+ this.sutClientNetworkX = this.nodeSutX + this.nodeWidth - 4;
26
+ this.sutClientAddressesX = this.sutClientNetworkX + this.networkWidth;
27
+
28
+ this.nodeServerX = 1470;
29
+ this.serverNetworkX = this.nodeServerX - this.networkWidth + 4;
30
+ this.serverAddressesX = this.serverNetworkX;
31
+
32
+ this.networkBias = 36;
33
+ this.networkExtraBias = 16;
34
+ this.addressBias = this.networkBias / 2;
35
+ this.cloudYBias = this.networkBias / 3;
36
+ this.cloudXBias = this.addressBias / 2;
37
+
38
+ this.virtualNetworksHeight = [];
39
+ this.networkYs = [];
40
+
41
+ this.bottom = 0;
42
+ this.helpHeight = 70;
43
+
44
+ this.key = 0;
45
+
46
+ this.InterfaceRadiusOuter = 12;
47
+ this.InterfaceRadiusInner = 10;
48
+ this.InterfaceGuiWidthOuter = 20;
49
+ this.InterfaceGuiWidthInner = 12;
50
+ this.InterfaceGuiWidthOuterHalf = this.InterfaceGuiWidthOuter / 2;
51
+ this.InterfaceGuiWidthInnerHalf = this.InterfaceGuiWidthInner / 2;
52
+ }
53
+
54
+ shouldUpdate(nextProps, nextState) {
55
+ return !this.shallowCompare(this.props.width, nextProps.width)
56
+ || !this.shallowCompare(this.props.height, nextProps.height)
57
+ || !this.shallowCompare(this.props.virtualNetworks, nextProps.virtualNetworks)
58
+ || !this.shallowCompare(this.props.pingResults, nextProps.pingResults);
59
+ }
60
+
61
+ renderClientInterface(client, x, y) {
62
+ if('gui' === client.type) {
63
+ return (
64
+ <g>
65
+ <rect className={`${this._addressPrefixClass(client)}outer_address`} x={x - this.InterfaceGuiWidthOuterHalf} y={y - this.InterfaceGuiWidthOuterHalf} rx="1" ry="1" width={this.InterfaceGuiWidthOuter} height={this.InterfaceGuiWidthOuter} />
66
+ <rect className={this._addressPostfixClass(client)} x={x - this.InterfaceGuiWidthInnerHalf} y={y - this.InterfaceGuiWidthInnerHalf} width={this.InterfaceGuiWidthInner} height={this.InterfaceGuiWidthInner} />
67
+ </g>
68
+ );
69
+ }
70
+ else if('ip' === client.type) {
71
+ return (
72
+ <g>
73
+ <circle className="outer_address" cx={x} cy={y} r={this.InterfaceRadiusOuter} />
74
+ <circle className={this._addressClass(client)} cx={x} cy={y} r={this.InterfaceRadiusInner} />
75
+ </g>
76
+ );
77
+ }
78
+ }
79
+
80
+ renderClientPing(client, x, y) {
81
+ const key = `client_${client.type}_${client.networkName}_${client.interfaceName}`;
82
+ if('gui' === client.type) {
83
+ return (
84
+ <g key={key}>
85
+ <rect className={`outer_address ${this._pingResultClass(client.address)}`} x={x - this.InterfaceGuiWidthOuterHalf} y={y - this.InterfaceGuiWidthOuterHalf} rx="1" ry="1" width={this.InterfaceGuiWidthOuterHalf} height={this.InterfaceGuiWidthOuter} />
86
+ </g>
87
+ );
88
+ }
89
+ else if('ip' === client.type) {
90
+ const cutoffId = `cut-off-right-circle_${key}`
91
+ return (
92
+ <React.Fragment key={key}>
93
+ <defs>
94
+ <clipPath id={cutoffId}>
95
+ <rect x={x - this.InterfaceRadiusOuter - 1} y={y - this.InterfaceRadiusOuter} width={this.InterfaceRadiusOuter} height={2 * this.InterfaceRadiusOuter} />
96
+ </clipPath>
97
+ </defs>
98
+ <circle className={`outer_address ${this._pingResultClass(client.address)}`} cx={x} cy={y} r={this.InterfaceRadiusOuter} clipPath={`url(#${cutoffId})`} />
99
+ </React.Fragment>
100
+ );
101
+ }
102
+ }
103
+
104
+ renderClientAddress(client, virtualNetworkIndex, addressIndex) {
105
+ const y = this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex);
106
+ const popup = [['name:', client.interfaceName], ['address:', client.address], ['netmask:', client.netmask], ['network:', client.networkName], ['type:', client.type], [client.static ? 'static' : 'dynamic', '']];
107
+ if(client.multicast) {
108
+ popup.push(['multicast', '']);
109
+ }
110
+ if(client.external) {
111
+ popup.push(['external', '']);
112
+ }
113
+ if(client.reduced) {
114
+ popup.push(['reduced', '']);
115
+ }
116
+ if(!client.valid) {
117
+ popup.push(['address exist:', client.validExist, client.validExist ? 'login_valid_success' : 'login_valid_failure']);
118
+ popup.push(['valid address:', client.validAddress, client.validAddress ? 'login_valid_success' : 'login_valid_failure']);
119
+ popup.push(['valid netmask:', client.validNetmask, client.validNetmask ? 'login_valid_success' : 'login_valid_failure']);
120
+ popup.push(['valid family:', client.validFamily, client.validFamily ? 'login_valid_success' : 'login_valid_failure']);
121
+ popup.push(['valid subnet:', client.validSubnet, client.validSubnet ? 'login_valid_success' : 'login_valid_failure']);
122
+ }
123
+ return (
124
+ <g key={++this.key}>
125
+ <text key={++this.key} x={this.clientAddressesX + 16} y={y + 4}>
126
+ {`${client.interfaceName}: ${null !== client.address ? client.address : ''}`}
127
+ </text>
128
+ <Group className="pull-right" placement="right" title="Address - client" showTime={-1} text={popup}>
129
+ {this.renderClientInterface(client, this.clientAddressesX, y)}
130
+ </Group>
131
+ </g>
132
+ );
133
+ }
134
+
135
+ renderSutClientPing(sutClient, x, y) {
136
+ const key = `sutClient_${sutClient.type}_${sutClient.networkName}_${sutClient.interfaceName}`;
137
+ if('gui' === sutClient.type) {
138
+ return (
139
+ <g key={key}>
140
+ <rect className={`outer_address ${this._pingResultClass(sutClient.address)}`} x={x - this.InterfaceGuiWidthOuterHalf} y={y - this.InterfaceGuiWidthOuterHalf} rx="1" ry="1" width={this.InterfaceGuiWidthOuterHalf} height={this.InterfaceGuiWidthOuter} />
141
+ </g>
142
+ );
143
+ }
144
+ else if('ip' === sutClient.type) {
145
+ const cutoffId = `cut-off-right-circle_${key}`
146
+ return (
147
+ <React.Fragment key={key}>
148
+ <defs>
149
+ <clipPath id={cutoffId}>
150
+ <rect x={x - this.InterfaceRadiusOuter - 1} y={y - this.InterfaceRadiusOuter} width={this.InterfaceRadiusOuter} height={2 * this.InterfaceRadiusOuter} />
151
+ </clipPath>
152
+ </defs>
153
+ <circle className={`outer_address ${this._pingResultClass(sutClient.address)}`} cx={x} cy={y} r={this.InterfaceRadiusOuter} clipPath={`url(#${cutoffId})`} />
154
+ </React.Fragment>
155
+ );
156
+ }
157
+ }
158
+
159
+ renderSutServerPing(sutServer, x, y) {
160
+ const key = `sutServer${sutServer.type}_${sutServer.networkName}_${sutServer.interfaceName}`;
161
+ if('gui' === sutServer.type) {
162
+ return (
163
+ <g key={key}>
164
+ <rect className={`outer_address ${this._pingResultClass(sutServer.address)}`} x={x} y={y - this.InterfaceGuiWidthOuterHalf} rx="1" ry="1" width={this.InterfaceGuiWidthOuterHalf} height={this.InterfaceGuiWidthOuter} />
165
+ </g>
166
+ );
167
+ }
168
+ else if('ip' === sutServer.type) {
169
+ const cutoffId = `cut-off-right-circle_${key}`
170
+ return (
171
+ <React.Fragment key={key}>
172
+ <defs>
173
+ <clipPath id={cutoffId}>
174
+ <rect x={x} y={y - this.InterfaceRadiusOuter} width={this.InterfaceRadiusOuter + 1} height={2 * this.InterfaceRadiusOuter} />
175
+ </clipPath>
176
+ </defs>
177
+ <circle className={`outer_address ${this._pingResultClass(sutServer.address)}`} cx={x} cy={y} r={this.InterfaceRadiusOuter} clipPath={`url(#${cutoffId})`} />
178
+ </React.Fragment>
179
+ );
180
+ }
181
+ }
182
+
183
+ renderSutServerInterface(sutServer, x, y) {
184
+ if('gui' === sutServer.type) {
185
+ return (
186
+ <g>
187
+ <rect className={`${this._addressPrefixClass(sutServer)}outer_address`} x={x - this.InterfaceGuiWidthOuterHalf} y={y - this.InterfaceGuiWidthOuterHalf} rx="1" ry="1" width={this.InterfaceGuiWidthOuter} height={this.InterfaceGuiWidthOuter} />
188
+ <rect className={this._addressPostfixClass(sutServer)} x={x - this.InterfaceGuiWidthInnerHalf} y={y - this.InterfaceGuiWidthInnerHalf} width={this.InterfaceGuiWidthInner} height={this.InterfaceGuiWidthInner} />
189
+ </g>
190
+ );
191
+ }
192
+ else if('ip' === sutServer.type) {
193
+ return (
194
+ <g>
195
+ <circle className="outer_address" cx={x} cy={y} r={this.InterfaceRadiusOuter} />
196
+ <circle className={this._addressClass(sutServer)} cx={x} cy={y} r={this.InterfaceRadiusInner} />
197
+ </g>
198
+ );
199
+ }
200
+ }
201
+
202
+ renderSutServerAddress(sutServer, virtualNetworkIndex, addressIndex) {
203
+ const y = this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex);
204
+ const popup = [['name:', sutServer.interfaceName], ['address:', sutServer.address], ['netmask:', sutServer.netmask], ['network:', sutServer.networkName], ['type:', sutServer.type], [sutServer.static ? 'static' : 'dynamic', '']];
205
+ if(sutServer.multicast) {
206
+ popup.push(['multicast', '']);
207
+ }
208
+ if(sutServer.external) {
209
+ popup.push(['external', '']);
210
+ }
211
+ if(sutServer.reduced) {
212
+ popup.push(['reduced', '']);
213
+ }
214
+ if(!sutServer.valid && !(sutServer.external && sutServer.validAddress && sutServer.validNetmask && sutServer.validFamily) && !(sutServer.multicast && sutServer.validAddress && sutServer.validFamily)) {
215
+ popup.push(['address exist:', sutServer.validExist, sutServer.validExist ? 'login_valid_success' : 'login_valid_failure']);
216
+ popup.push(['valid address:', sutServer.validAddress, sutServer.validAddress ? 'login_valid_success' : 'login_valid_failure']);
217
+ popup.push(['valid netmask:', sutServer.validNetmask, sutServer.validNetmask ? 'login_valid_success' : 'login_valid_failure']);
218
+ popup.push(['valid family:', sutServer.validFamily, sutServer.validFamily ? 'login_valid_success' : 'login_valid_failure']);
219
+ popup.push(['valid subnet:', sutServer.validSubnet, sutServer.validSubnet ? 'login_valid_success' : 'login_valid_failure']);
220
+ }
221
+ return (
222
+ <g key={++this.key}>
223
+ <text key={++this.key} x={this.sutServerAddressesX - 16} y={y + 4} textAnchor="end">
224
+ {`${sutServer.interfaceName}: ${null !== sutServer.address ? sutServer.address : ''}`}
225
+ </text>
226
+ <Group className="pull-right" placement="left" title="Address - sut server" showTime={-1} text={popup}>
227
+ {this.renderSutServerInterface(sutServer, this.sutServerAddressesX, y)}
228
+ </Group>
229
+ </g>
230
+ );
231
+ }
232
+
233
+ renderSutClientAddress(sutClient, virtualNetworkIndex, addressIndex) {
234
+ const y = this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex);
235
+ const popup = [['name:', sutClient.interfaceName], ['address:', sutClient.address], ['netmask:', sutClient.netmask], ['network:', sutClient.networkName], [sutClient.static ? 'static' : 'dynamic', '']];
236
+ if(sutClient.multicast) {
237
+ popup.push(['multicast', '']);
238
+ }
239
+ if(sutClient.external) {
240
+ popup.push(['external', '']);
241
+ }
242
+ if(sutClient.reduced) {
243
+ popup.push(['reduced', '']);
244
+ }
245
+ if(!sutClient.valid && !(sutClient.external && sutClient.validAddress && sutClient.validNetmask && sutClient.validFamily) && !(sutClient.multicast && sutClient.validAddress && sutClient.validFamily)) {
246
+ popup.push(['address exist:', sutClient.validExist, sutClient.validExist ? 'login_valid_success' : 'login_valid_failure']);
247
+ popup.push(['valid address:', sutClient.validAddress, sutClient.validAddress ? 'login_valid_success' : 'login_valid_failure']);
248
+ popup.push(['valid netmask:', sutClient.validNetmask, sutClient.validNetmask ? 'login_valid_success' : 'login_valid_failure']);
249
+ popup.push(['valid family:', sutClient.validFamily, sutClient.validFamily ? 'login_valid_success' : 'login_valid_failure']);
250
+ popup.push(['valid subnet:', sutClient.validSubnet, sutClient.validSubnet ? 'login_valid_success' : 'login_valid_failure']);
251
+ }
252
+ return (
253
+ <g key={++this.key}>
254
+ <text key={++this.key} x={this.sutClientAddressesX + 16} y={y + 4}>
255
+ {`${sutClient.interfaceName}: ${null !== sutClient.address ? sutClient.address : ''}`}
256
+ </text>
257
+ <circle className="outer_address" cx={this.sutClientAddressesX + 2} cy={y} r={this.InterfaceRadiusOuter} />
258
+ <Group className="pull-right" placement="right" title="Address - sut client" showTime={-1} text={popup}>
259
+ <circle className={this._addressClass(sutClient)} cx={this.sutClientAddressesX + 2} cy={y} r={this.InterfaceRadiusInner} />
260
+ </Group>
261
+ </g>
262
+ );
263
+ }
264
+
265
+ renderServerAddress(server, virtualNetworkIndex, addressIndex) {
266
+ const y = this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex);
267
+ const popup = [['name:', server.interfaceName], ['address:', server.address], ['netmask:', server.netmask], ['network:', server.networkName], [server.static ? 'static' : 'dynamic', '']];
268
+ if(server.multicast) {
269
+ popup.push(['multicast', '']);
270
+ }
271
+ if(server.external) {
272
+ popup.push(['external', '']);
273
+ }
274
+ if(server.reduced) {
275
+ popup.push(['reduced', '']);
276
+ }
277
+ if(!server.valid) {
278
+ popup.push(['address exist:', server.validExist, server.validExist ? 'login_valid_success' : 'login_valid_failure']);
279
+ popup.push(['valid address:', server.validAddress, server.validAddress ? 'login_valid_success' : 'login_valid_failure']);
280
+ popup.push(['valid netmask:', server.validNetmask, server.validNetmask ? 'login_valid_success' : 'login_valid_failure']);
281
+ popup.push(['valid family:', server.validFamily, server.validFamily ? 'login_valid_success' : 'login_valid_failure']);
282
+ popup.push(['valid subnet:', server.validSubnet, server.validSubnet ? 'login_valid_success' : 'login_valid_failure']);
283
+ }
284
+ return (
285
+ <g key={++this.key}>
286
+ <text key={++this.key} x={this.serverAddressesX - 16} y={y + 4} textAnchor="end">
287
+ {`${server.interfaceName}: ${null !== server.address ? server.address : ''}`}
288
+ </text>
289
+ <circle className="outer_address" cx={this.serverAddressesX - 2} cy={y} r={this.InterfaceRadiusOuter} />
290
+ <Group className="pull-right" placement="left" title="Address - server" showTime={-1} text={popup}>
291
+ <circle className={this._addressClass(server)} cx={this.serverAddressesX - 2} cy={y} r={this.InterfaceRadiusInner} />
292
+ </Group>
293
+ </g>
294
+ );
295
+ }
296
+
297
+ renderServerPing(server, x, y) {
298
+ const key = `server${server.type}_${server.networkName}_${server.interfaceName}`;
299
+ if('gui' === server.type) {
300
+ return (
301
+ <g key={key}>
302
+ <rect className={`outer_address ${this._pingResultClass(server.address)}`} x={x} y={y - this.InterfaceGuiWidthOuterHalf} rx="1" ry="1" width={this.InterfaceGuiWidthOuterHalf} height={this.InterfaceGuiWidthOuter} />
303
+ </g>
304
+ );
305
+ }
306
+ else if('ip' === server.type) {
307
+ const cutoffId = `cut-off-right-circle_${key}`
308
+ return (
309
+ <React.Fragment key={key}>
310
+ <defs>
311
+ <clipPath id={cutoffId}>
312
+ <rect x={x} y={y - this.InterfaceRadiusOuter} width={this.InterfaceRadiusOuter + 1} height={2 * this.InterfaceRadiusOuter} />
313
+ </clipPath>
314
+ </defs>
315
+ <circle className={`outer_address ${this._pingResultClass(server.address)}`} cx={x} cy={y} r={this.InterfaceRadiusOuter} clipPath={`url(#${cutoffId})`} />
316
+ </React.Fragment>
317
+ );
318
+ }
319
+ }
320
+
321
+ renderClientNetwork(virtualNetwork, index) {
322
+ return (
323
+ <g key={++this.key}>
324
+ <Group className="pull-right" placement="right" title="Network" showTime={-1} text={this._networkPopover(virtualNetwork)}>
325
+ <rect key={++this.key} x={this.clientNetworkX} y={this.networkYs[index]} rx="4" ry="8" width={this.networkWidth} height={this.virtualNetworksHeight[index]} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
326
+ </Group>
327
+ </g>
328
+ );
329
+ }
330
+
331
+ renderSutServerNetwork(virtualNetwork, index) {
332
+ return (
333
+ <g key={++this.key}>
334
+ <Group className="pull-right" placement="left" title="Network" showTime={-1} text={this._networkPopover(virtualNetwork)}>
335
+ <rect key={++this.key} x={this.sutServerNetworkX} y={this.networkYs[index]} rx="4" ry="8" width={this.networkWidth} height={this.virtualNetworksHeight[index]} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
336
+ </Group>
337
+ </g>
338
+ );
339
+ }
340
+
341
+ renderSutClientNetwork(virtualNetwork, index) {
342
+ return (
343
+ <g key={++this.key}>
344
+ <Group className="pull-right" placement="right" title="Network" showTime={-1} text={this._networkPopover(virtualNetwork)}>
345
+ <rect key={++this.key} x={this.sutClientNetworkX} y={this.networkYs[index]} rx="4" ry="8" width={this.networkWidth} height={this.virtualNetworksHeight[index]} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
346
+ </Group>
347
+ </g>
348
+ );
349
+ }
350
+
351
+ renderServerNetwork(virtualNetwork, index) {
352
+ return (
353
+ <g key={++this.key}>
354
+ <Group className="pull-right" placement="left" title="Network"showTime={-1} text={this._networkPopover(virtualNetwork)}>
355
+ <rect key={++this.key} x={this.serverNetworkX} y={this.networkYs[index]} rx="4" ry="8" width={this.networkWidth} height={this.virtualNetworksHeight[index]} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
356
+ </Group>
357
+ </g>
358
+ );
359
+ }
360
+
361
+ renderNodeClient() {
362
+ let radius = 10;
363
+ return (
364
+ <>
365
+ <text key={++this.key} x={this.nodeClientX + this.nodeWidthHalf} y="20" textAnchor="middle" style={{fontWeight:'bold'}}>Actor Clients</text>
366
+ <rect key={++this.key} x={this.nodeClientX} y={this.nodeY} rx={radius} ry={radius} width={this.nodeWidth} height={this.nodeHeight} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
367
+ </>
368
+ );
369
+ }
370
+
371
+ renderNodeSut() {
372
+ let radius = 10;
373
+ return (
374
+ <>
375
+ <text key={++this.key} x={this.nodeSutX + this.nodeWidthHalf} y="20" textAnchor="middle" style={{fontWeight:'bold'}}>System Under Test</text>
376
+ <rect key={++this.key} x={this.nodeSutX} y={this.nodeY} rx={radius} ry={radius} width={this.nodeWidth} height={this.nodeHeight} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
377
+ </>
378
+ );
379
+ }
380
+
381
+ renderNodeServer() {
382
+ let radius = 10;
383
+ return (
384
+ <>
385
+ <text key={++this.key} x={this.nodeServerX + this.nodeWidthHalf} y="20" textAnchor="middle" style={{fontWeight:'bold'}}>Actor Servers</text>
386
+ <rect key={++this.key} x={this.nodeServerX} y={this.nodeY} rx={radius} ry={radius} width={this.nodeWidth} height={this.nodeHeight} style={{fill:"#f9ffff",stroke:"black",strokeWidth:2}} />
387
+ </>
388
+ );
389
+ }
390
+
391
+ renderClient(virtualNetworks) {
392
+ if(0 === virtualNetworks.length) {
393
+ return null;
394
+ }
395
+ const clientAddressesSvg = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
396
+ return virtualNetwork.clients.map((client, addressIndex) => {
397
+ return this.renderClientAddress(client, virtualNetworkIndex, addressIndex);
398
+ });
399
+ });
400
+ const clientNetworksSvg = virtualNetworks.map((virtualNetwork, index) => {
401
+ return this.renderClientNetwork(virtualNetwork, index);
402
+ });
403
+ const clientPings = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
404
+ return virtualNetwork.clients.map((client, addressIndex) => {
405
+ return this.renderClientPing(client, this.clientAddressesX, this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex));
406
+ });
407
+ });
408
+ return (
409
+ <g>
410
+ {clientAddressesSvg}
411
+ {clientNetworksSvg}
412
+ {clientPings}
413
+ {this.renderNodeClient()}
414
+ </g>
415
+ );
416
+ }
417
+
418
+ renderSut(virtualNetworks) {
419
+ if(0 === virtualNetworks.length) {
420
+ return null;
421
+ }
422
+ const sutClientAddressesSvg = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
423
+ let addressIndex = 0;
424
+ return virtualNetwork.suts.map((sutClient) => {
425
+ if('client' === sutClient.direction || 'client/server' === sutClient.direction || 'server/client' === sutClient.direction) {
426
+ return this.renderSutClientAddress(sutClient, virtualNetworkIndex, addressIndex++);
427
+ }
428
+ });
429
+ });
430
+ const sutServerAddressesSvg = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
431
+ let addressIndex = 0;
432
+ return virtualNetwork.suts.map((sutServer) => {
433
+ if('server' === sutServer.direction || 'client/server' === sutServer.direction || 'server/client' === sutServer.direction) {
434
+ return this.renderSutServerAddress(sutServer, virtualNetworkIndex, addressIndex++);
435
+ }
436
+ });
437
+ });
438
+ const sutServerPings = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
439
+ let addressIndex = 0;
440
+ return virtualNetwork.suts.map((sutServer) => {
441
+ if('server' === sutServer.direction || 'client/server' === sutServer.direction || 'server/client' === sutServer.direction) {
442
+ return this.renderSutServerPing(sutServer, this.sutServerAddressesX, this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex++));
443
+ }
444
+ });
445
+ });
446
+ const sutClientPing = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
447
+ let addressIndex = 0;
448
+ return virtualNetwork.suts.map((sutClient) => {
449
+ if('client' === sutClient.direction || 'client/server' === sutClient.direction || 'server/client' === sutClient.direction) {
450
+ return this.renderSutClientPing(sutClient, this.sutClientAddressesX, this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex++));
451
+ }
452
+ });
453
+ });
454
+ const sutServerNetworksSvg = virtualNetworks.map((virtualNetwork, index) => {
455
+ return this.renderSutServerNetwork(virtualNetwork, index);
456
+ });
457
+ const sutClientNetworksSvg = virtualNetworks.map((virtualNetwork, index) => {
458
+ return this.renderSutClientNetwork(virtualNetwork, index);
459
+ });
460
+ return (
461
+ <g>
462
+ {sutServerAddressesSvg}
463
+ {sutServerNetworksSvg}
464
+ {sutServerPings}
465
+ {sutClientAddressesSvg}
466
+ {sutClientNetworksSvg}
467
+ {sutClientPing}
468
+ {this.renderNodeSut()}
469
+ </g>
470
+ );
471
+ }
472
+
473
+ renderServer(virtualNetworks) {
474
+ if(0 === virtualNetworks.length) {
475
+ return null;
476
+ }
477
+ const serverAddressesSvg = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
478
+ return virtualNetwork.servers.map((server, addressIndex) => {
479
+ return this.renderServerAddress(server, virtualNetworkIndex, addressIndex);
480
+ });
481
+ });
482
+ const serverNetworksSvg = virtualNetworks.map((virtualNetwork, index) => {
483
+ return this.renderServerNetwork(virtualNetwork, index);
484
+ });
485
+ const serverPings = virtualNetworks.map((virtualNetwork, virtualNetworkIndex) => {
486
+ return virtualNetwork.servers.map((server, addressIndex) => {
487
+ return this.renderServerPing(server, this.serverAddressesX, this.networkYs[virtualNetworkIndex] + this.addressBias + (2 * this.addressBias * addressIndex));
488
+ });
489
+ });
490
+ return (
491
+ <g>
492
+ {serverAddressesSvg}
493
+ {serverNetworksSvg}
494
+ {serverPings}
495
+ {this.renderNodeServer()}
496
+ </g>
497
+ );
498
+ }
499
+
500
+ renderClouds(virtualNetworks) {
501
+ const networks = virtualNetworks.map((virtualNetwork, index) => {
502
+ return (
503
+ <g key={index}>
504
+ <text key={++this.key} x={this.nodeClientX + this.nodeWidth + 32} y={this.networkYs[index] - 20} style={{fontWeight:'bold'}}>
505
+ {virtualNetwork.networkName}, {virtualNetwork.family}, {virtualNetwork.subnet}, {virtualNetwork.description}
506
+ </text>
507
+ <text key={++this.key} x={this.nodeSutX + this.nodeWidth + 32} y={this.networkYs[index] - 20} style={{fontWeight:'bold'}}>
508
+ {virtualNetwork.networkName}, {virtualNetwork.family}, {virtualNetwork.subnet}, {virtualNetwork.description}
509
+ </text>
510
+ <rect key={++this.key} className={this._networkClass(virtualNetwork)} x={this.nodeClientX + this.nodeWidth + this.cloudXBias} y={this.networkYs[index] - this.cloudYBias} rx="4" ry="8" width={this.nodeSutX - (this.nodeClientX + this.nodeWidth) - 2 * this.cloudXBias} height={this.virtualNetworksHeight[index] + 2 * this.cloudYBias} />
511
+ <rect key={++this.key} className={this._networkClass(virtualNetwork)} x={this.nodeSutX + this.nodeWidth + this.cloudXBias} y={this.networkYs[index] - this.cloudYBias} rx="4" ry="8" width={this.nodeServerX - (this.nodeSutX + this.nodeWidth) - 2 * this.cloudXBias} height={this.virtualNetworksHeight[index] + 2 * this.cloudYBias} />
512
+ </g>
513
+ );
514
+ });
515
+ return (
516
+ <g>
517
+ {networks}
518
+ </g>
519
+ );
520
+ }
521
+
522
+ renderInfoInterface(indexX, indexY, classNamePrefix, className, text, link) {
523
+ const width = 230;
524
+ const xBias = 120;
525
+ const yBias = 30;
526
+ const yDelta = 30;
527
+ const textY = 5;
528
+ return (
529
+ <g>
530
+ <circle className="outer_address" cx={this.nodeClientX + xBias + width * indexX} cy={this.bottom + yBias + yDelta * indexY} r={this.InterfaceRadiusOuter} />
531
+ <circle className={`${classNamePrefix}_${className}`} cx={this.nodeClientX + xBias + width * indexX} cy={this.bottom + yBias + yDelta * indexY} r={this.InterfaceRadiusInner} />
532
+ <text key={++this.key} x={this.nodeClientX + xBias + width * indexX + 16} y={this.bottom + yBias + yDelta * indexY + textY} textAnchor="left" style={{fontWeight:'bold'}}>
533
+ {text}
534
+ </text>
535
+ </g>
536
+ );
537
+ }
538
+
539
+ renderInfos() {
540
+ let indexDynamic = -1;
541
+ let indexStatic = -1;
542
+ return (
543
+ <>
544
+ {this.renderInfoInterface(++indexDynamic, 0, 'dynamic', 'address_success', 'Dynamic Chosen Address')}
545
+ {this.renderInfoInterface(++indexDynamic, 0, 'dynamic', 'address_reduced', 'Dynamic Reduced Address')}
546
+ {this.renderInfoInterface(++indexDynamic, 0, 'dynamic', 'address_multicast', 'Dynamic Multicast Address')}
547
+ {this.renderInfoInterface(++indexDynamic, 0, 'dynamic', 'address_external', 'Dynamic External Address')}
548
+ {this.renderInfoInterface(++indexDynamic, 0, 'dynamic', 'address_failure', 'Dynamic Failed Address')}
549
+ {this.renderInfoInterface(++indexStatic, 1, 'static', 'address_success', 'Static Chosen Address')}
550
+ {this.renderInfoInterface(++indexStatic, 1, 'static', 'address_reduced', 'Static Reduced Address')}
551
+ {this.renderInfoInterface(++indexStatic, 1, 'static', 'address_multicast', 'Static Multicast Address')}
552
+ {this.renderInfoInterface(++indexStatic, 1, 'static', 'address_external', 'Static External Address')}
553
+ {this.renderInfoInterface(++indexStatic, 1, 'static', 'address_failure', 'Static Failed Address')}
554
+ </>
555
+ );
556
+ }
557
+
558
+ render() {
559
+ const virtualNetworks = this.props.virtualNetworks;
560
+ this._calculate(virtualNetworks);
561
+ const viewBox = [0, 0, this.nodeServerX + this.nodeWidth + this.nodeClientX, this.nodeHeight + 2 * this.nodeY + this.helpHeight].join(' ');
562
+ return (
563
+ <svg width={this.props.width} height={this.props.height} viewBox={viewBox}>
564
+ {this.renderClouds(virtualNetworks)}
565
+ {this.renderClient(virtualNetworks)}
566
+ {this.renderSut(virtualNetworks)}
567
+ {this.renderServer(virtualNetworks)}
568
+ {this.renderInfos()}
569
+ </svg>
570
+ );
571
+ }
572
+
573
+ _calculate(virtualNetworks) {
574
+ this.virtualNetworksHeight = [];
575
+ this.networkYs = [];
576
+ this.bottom = 0;
577
+ this.nodeHeight = this.networkBias * (virtualNetworks.length + 1);
578
+ if(virtualNetworks.length >= 2) {
579
+ this.nodeHeight += this.networkExtraBias * (virtualNetworks.length - 1);
580
+ }
581
+ let top = this.nodeY + this.networkBias;
582
+ for(let i = 0; i < virtualNetworks.length; ++i) {
583
+ this.virtualNetworksHeight.push(2 * this.addressBias * Math.max(1, this._calculateSutLength(virtualNetworks[i].suts), virtualNetworks[i].servers.length, virtualNetworks[i].clients.length));
584
+ this.nodeHeight += this.virtualNetworksHeight[i];
585
+ this.networkYs.push(top);
586
+ top += this.virtualNetworksHeight[i] + this.networkBias + this.networkExtraBias;
587
+ }
588
+ this.bottom = top;
589
+ }
590
+
591
+ _calculateSutLength(suts) {
592
+ let server = 0;
593
+ let client = 0;
594
+ suts.forEach((sut) => {
595
+ if('server' === sut.direction) {
596
+ ++server;
597
+ }
598
+ else if('client' === sut.direction) {
599
+ ++client;
600
+ }
601
+ else if('server/client' === sut.direction) {
602
+ ++server;
603
+ ++client;
604
+ }
605
+ else if('client/server' === sut.direction) {
606
+ ++server;
607
+ ++client;
608
+ }
609
+ });
610
+ return Math.max(server, client);
611
+ }
612
+
613
+ _pingResultClass(address) {
614
+ if(!this.props.pingResults || 0 === this.props.pingResults.size) {
615
+ return 'ping_none';
616
+ }
617
+ const pingResult = this.props.pingResults.get(address);
618
+ if(undefined === pingResult) {
619
+ return 'ping_undefined';
620
+ }
621
+ else if(pingResult.result) {
622
+ return 'ping_success';
623
+ }
624
+ else {
625
+ return 'ping_failure';
626
+ }
627
+ }
628
+
629
+ _addressPrefixClass(address) {
630
+ if(address.static) {
631
+ return 'static_';
632
+ }
633
+ else {
634
+ return 'dynamic_';
635
+ }
636
+ }
637
+
638
+ _addressPostfixClass(address) {
639
+ if(address.valid) {
640
+ if(address.reduced) {
641
+ return 'address_reduced';
642
+ }
643
+ else if(address.multicast) {
644
+ return 'address_multicast';
645
+ }
646
+ else {
647
+ return 'address_success';
648
+ }
649
+ }
650
+ else if(address.external && ((address.validAddress && address.validNetmask && address.validFamily)) || (address.multicast && address.validAddress && address.validFamily)) {
651
+ return 'address_external';
652
+ }
653
+ return 'address_failure';
654
+ }
655
+
656
+ _addressClass(address) {
657
+ return `${this._addressPrefixClass(address)}${this._addressPostfixClass(address)}`;
658
+ }
659
+
660
+ _networkClass(network) {
661
+ if(network.valid) {
662
+ if(network.reduced) {
663
+ if(network.forceLocalhost) {
664
+ return 'network_reduced_local';
665
+ }
666
+ else {
667
+ return 'network_reduced';
668
+ }
669
+ }
670
+ else {
671
+ if(network.forceLocalhost) {
672
+ return 'network_success_local';
673
+ }
674
+ else {
675
+ return 'network_success';
676
+ }
677
+ }
678
+ }
679
+ else {
680
+ return 'network_failure';
681
+ }
682
+ }
683
+
684
+ _networkPopover(virtualNetwork) {
685
+ const popup = [['name:', virtualNetwork.networkName], ['family:', virtualNetwork.family], ['subnet:', virtualNetwork.subnet]];
686
+ if(virtualNetwork.valid) {
687
+ if(virtualNetwork.reduced) {
688
+ popup.push(['reduced', '']);
689
+ }
690
+ }
691
+ else {
692
+ popup.push(['not valid', '']);
693
+ }
694
+ return popup;
695
+ }
696
+ }