Skip to content

Commit d1876da

Browse files
committed
Template tweaks
1 parent c2f3610 commit d1876da

File tree

7 files changed

+80
-54
lines changed

7 files changed

+80
-54
lines changed

templates/apduLog.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{define "apduLog"}}
2+
3+
<h1>APDU LOG</h1>
4+
5+
<h2>Count: {{len .}}</h2>
6+
<h2>Duration(ms): {{. | ApduTotalDurMs}}</h2>
7+
8+
{{ range . }}
9+
<div><pre>
10+
Desc: <b>{{ .Desc }}</b>
11+
Dur(ms): <b>{{ .DurMs }}</b>
12+
</pre></div>
13+
<div><pre>
14+
-> {{ .Tx | BytesToHex }}
15+
{{if .Child}}
16+
--> {{ .Child.Tx | BytesToHex }}
17+
<-- {{ .Child.Rx | BytesToHex }}
18+
{{end}}
19+
<- {{ .Rx | BytesToHex }}
20+
</pre></div>
21+
<hr>
22+
{{ end }}
23+
24+
{{end}}

templates/cardAccess.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{define "cardAccess"}}
2+
3+
<h2>CardAccess</h2>
4+
{{if .}}
5+
{{template "fileHexAndTlv" .RawData}}
6+
{{else}}
7+
<i>No data</i>
8+
{{end}}
9+
10+
{{end}}

templates/cardSecurity.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{define "cardSecurity"}}
2+
3+
<h2>CardSecurity</h2>
4+
{{if .}}
5+
{{template "fileHexAndTlv" .RawData}}
6+
{{else}}
7+
<i>No data</i>
8+
{{end}}
9+
10+
{{end}}

templates/com.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{define "com"}}
2+
3+
<h2>COM</h2>
4+
{{if .}}
5+
{{template "fileHexAndTlv" .RawData}}
6+
{{else}}
7+
<i>No data</i>
8+
{{end}}
9+
10+
{{end}}

templates/dir.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{define "dir"}}
2+
3+
<h2>DIR</h2>
4+
{{if .}}
5+
{{template "fileHexAndTlv" .RawData}}
6+
{{else}}
7+
<i>No data</i>
8+
{{end}}
9+
10+
{{end}}

templates/output.html

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -64,40 +64,11 @@ <h2>Passive Authentication <sub>CardSecurity</sub></h2>
6464
<i>No data</i>
6565
{{end}}
6666

67-
<h2>CardAccess</h2>
68-
{{if .Mf.CardAccess}}
69-
{{template "fileHexAndTlv" .Mf.CardAccess.RawData}}
70-
{{else}}
71-
<i>No data</i>
72-
{{end}}
73-
74-
<h2>CardSecurity</h2>
75-
{{if .Mf.CardSecurity}}
76-
{{template "fileHexAndTlv" .Mf.CardSecurity.RawData}}
77-
{{else}}
78-
<i>No data</i>
79-
{{end}}
80-
81-
<h2>DIR</h2>
82-
{{if .Mf.Dir}}
83-
{{template "fileHexAndTlv" .Mf.Dir.RawData}}
84-
{{else}}
85-
<i>No data</i>
86-
{{end}}
87-
88-
<h2>COM</h2>
89-
{{if .Mf.Lds1.Com}}
90-
{{template "fileHexAndTlv" .Mf.Lds1.Com.RawData}}
91-
{{else}}
92-
<i>No data</i>
93-
{{end}}
94-
95-
<h2>SOD <sub>Document Security Object</sub></h2>
96-
{{if .Mf.Lds1.Sod}}
97-
{{template "fileHexAndTlv" .Mf.Lds1.Sod.RawData}}
98-
{{else}}
99-
<i>No data</i>
100-
{{end}}
67+
{{template "cardAccess" .Mf.CardAccess}}
68+
{{template "cardSecurity" .Mf.CardSecurity}}
69+
{{template "dir" .Mf.Dir}}
70+
{{template "com" .Mf.Lds1.Com}}
71+
{{template "sod" .Mf.Lds1.Sod}}
10172

10273
{{template "dg1" .Mf.Lds1.Dg1}}
10374
{{template "dg2" .Mf.Lds1.Dg2}}
@@ -109,26 +80,7 @@ <h2>SOD <sub>Document Security Object</sub></h2>
10980
{{template "dg15" .Mf.Lds1.Dg15}}
11081
{{template "dg16" .Mf.Lds1.Dg16}}
11182

112-
<h1>APDU LOG</h1>
113-
114-
<h2>Count: {{len .Apdus}}</h2>
115-
<h2>Duration(ms): {{.Apdus | ApduTotalDurMs}}</h2>
116-
117-
{{ range .Apdus }}
118-
<div><pre>
119-
Desc: <b>{{ .Desc }}</b>
120-
Dur(ms): <b>{{ .DurMs }}</b>
121-
</pre></div>
122-
<div><pre>
123-
-> {{ .Tx | BytesToHex }}
124-
{{if .Child}}
125-
--> {{ .Child.Tx | BytesToHex }}
126-
<-- {{ .Child.Rx | BytesToHex }}
127-
{{end}}
128-
<- {{ .Rx | BytesToHex }}
129-
</pre></div>
130-
<hr>
131-
{{ end }}
83+
{{template "apduLog" .Apdus}}
13284

13385
<div id="json">
13486
<h1>Document JSON</h1>

templates/sod.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{define "sod"}}
2+
3+
<h2>SOD <sub>Document Security Object</sub></h2>
4+
{{if .}}
5+
{{template "fileHexAndTlv" .RawData}}
6+
{{else}}
7+
<i>No data</i>
8+
{{end}}
9+
10+
{{end}}

0 commit comments

Comments
 (0)