aboutsummaryrefslogtreecommitdiff
path: root/_includes/result_row.html
blob: 879771ae7a41e023e5952ead091c3f3144c8adda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

{% capture ok %}
{% if include.test.result.ok == true %}
<td align="center" class="tooltip cause-tooltip" data-cause="{{ include.test.result.cause }}"><i class="fas fa-check"></i></td>
{% else %}
{% if include.test.result.value == "ERROR" %}
<td align="center" class="tooltip cause-tooltip" data-cause="{{ include.test.result.cause }}"><i class="fas fa-exclamation-triangle"></i></td>
{% else %}
<td align="center" class="tooltip cause-tooltip" data-cause="{{ include.test.result.cause }}"><i class="fas fa-times"></i></td>
{% endif %}
{% endif %}
{% endcapture %}

{% assign color_val=include.depth | minus: 1 | times: 12 %}
{% assign color_channel=255 | minus: color_val %}
{% assign color_red=color_channel %}
{% assign color_green=color_channel %}
{% assign color_blue=color_channel %}

{% if include.test.result.value == "ERROR" %}
	{% assign color_blue=color_blue | minus: 35 %}
	{% assign color_green=color_green | minus: 35 %}
{% elsif include.test.result.value == "FAILURE" or include.test.result.value == "UXSUCCESS" %}
	{% assign color_blue=color_blue | minus: 35 %}
{% else %}
	{% assign color_red=color_red | minus: 35 %}
	{% assign color_blue=color_blue | minus: 35 %}
{% endif %}
{% if color_red < 0 %}
	{% assign color_red=0 %}
{% endif %}
{% if color_green < 0 %}
	{% assign color_green=0 %}
{% endif %}
{% if color_blue < 0 %}
	{% assign color_blue=0 %}
{% endif %}
{% capture color %}background-color: rgb({{color_red}},{{color_green}},{{color_blue}});{% endcapture %}

{% capture hidden %}{% if include.depth > 1 %}display: none;{% endif %}{% endcapture %}

{% capture index %}{% if include.test.index %}<span style="float: right;" title="Test index">({{ include.test.index }})</span>{% endif %}{% endcapture %}

{% if include.test.type == "command" %}
	<tr class="test" data-depth="{{ include.depth }}" style="{{ hidden }}{{ color }}">
	    <td align="center" ><small>{{ include.depth }}</small></td>
	    {{ ok }}
	    <td style="padding-left: {{ include.depth | times: 12 }}px;"><i class="far fa-credit-card" title="Command test"></i> {{ include.test.desc }}{{ index }}</td>
	    <td class="tooltip sw-tooltip" data-natural-sw="'{{ include.test.response.natural_sw }}'" data-sws="'{{ include.test.response.sws | join: ',' }}'">{{ include.test.result.value }}</td>
	    <td>{{ include.test.response.duration | divided_by: 1000000 }} ms</td>
	</tr>
{% elsif include.test.type == "compound" %}
	<tr class="test" data-depth="{{ include.depth }}" style="{{ hidden }}{{ color }}">
	    <td align="center" class="clickable" data-rows="{{ include.test.tests | size }}" data-toggled="false"><i class="fas fa-plus-square"></i></td>
	    {{ ok }}
	    <td style="padding-left: {{ include.depth | times: 12 }}px;"><i class="far fa-clone" title="Compound test"></i> {{ include.test.desc }}{{ index }}</td>
	    <td>{{ include.test.result.value }}</td>
	    <td></td>
	</tr>
	{% for test in include.test.tests %}
		{% assign new_depth=include.depth | plus: 1 %}
	    {% include result_row.html test=test depth=new_depth %}
	{% endfor %}
{% elsif include.test.type == "key-pair-generator" %}
	<tr class="test" data-depth="{{ include.depth }}" style="{{ hidden }}{{ color }}">
		<td></td>
		{{ ok }}
		<td style="padding-left: {{ include.depth | times: 12 }}px;">{{ include.test.desc }}{{ index }}</td>
		<td class="tooltip kpg-tooltip" data-pubkey="{{ include.test.key-pair-generator.keypair.pubkey.raw }}" data-privkey="{{ include.test.key-pair-generator.keypair.privkey.raw }}">{{ include.test.result.value }}</td>
	</tr>
{% elsif include.test.type == "key-agreement" %}
	<tr class="test" data-depth="{{ include.depth }}" style="{{ hidden }}{{ color }}">
		<td></td>
		{{ ok }}
		<td style="padding-left: {{ include.depth | times: 12 }}px;">{{ include.test.desc }}{{ index }}</td>
		<td class="tooltip ka-tooltip" data-pubkey="{{ include.test.key-agreement.pubkey.raw }}" data-privkey="{{ include.test.key-agreement.privkey.raw }}" data-secret="{{ include.test.key-agreement.secret }}">{{ include.test.result.value }}</td>
	</tr>
{% elsif include.test.type == "signature" %}
	<tr class="test" data-depth="{{ include.depth }}" style="{{ hidden }}{{ color }}">
		<td></td>
		{{ ok }}
		<td style="padding-left: {{ include.depth | times: 12 }}px;">{{ include.test.desc }}{{ index }}</td>
		<td class="tooltip sig-tooltip" data-signature="{{ include.test.signature.raw }}">{{ include.test.result.value }}</td>
	</tr>
{% endif %}