-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex_tmpl.html
70 lines (63 loc) · 2.86 KB
/
index_tmpl.html
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
<!DOCTYPE html>
{{- define "struct"}}
<div class="col">
{{- if ne .Type "" }}
<div class="path" title="{{.Path}}">{{.Label}}</div>
<div class="typename">{{.Type}}</div>
<select id="{{.SelectID}}" multiple size="{{.SelectSize}}">
{{- range .Fields }}
<option value="{{.Key}}" title="{{ .Label }} : {{ .Type }}">{{ .Padding }}{{ .Label }}: {{ .ValueString }}</option>
{{- end }}
</select>
<script>
<!-- update visible size of select -->
{
const n = document.getElementById('{{.SelectID}}');
n.setAttribute("size", n.options.length);
}
</script>
{{- if not .NotLive }}
<div class="buttonbar">
<button class="btn" title="explore all selected in the row below" onclick="javascript:explore({{.Row}},{{.Column}},getElementById('{{.SelectID}}'),'down');">⇊</button>
<button class="btn" title="explore all selected in columns on the right" onclick="javascript:explore({{.Row}},{{.Column}},getElementById('{{.SelectID}}'),'right');">⇉</button>
<button class="btn" title="explore all selected in the row above" onclick="javascript:explore({{.Row}},{{.Column}},getElementById('{{.SelectID}}'),'up');">⇈</button>
{{- if .HasZeros }}
<button class="btn" title="hide or show fields with zero values" onclick="javascript:explore({{.Row}},{{.Column}},getElementById('{{.SelectID}}'),'toggleZeros');">z</button>
{{- end}}
{{- if .IsRoot }}
<button class="btn" title="remove all objects except the roots" onclick="javascript:explore({{.Row}},{{.Column}},getElementById('{{.SelectID}}'),'clear');">c</button>
{{- else }}
<button class="btn" title="remove the object from this page" onclick="javascript:explore({{.Row}},{{.Column}},getElementById('{{.SelectID}}'),'remove');">x</button>
{{- end }}
</div>
{{- end}}
{{- end }}
</div>
{{- end}}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="color-scheme" content="light dark"/>
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ADD8E6FF"/>
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#21292c"/>
<title>Struct Explorer</title>
<script>{{.Script}}</script>
<style>{{.Style}}</style>
</head>
<body>
<table>
{{- range .Rows }}
<tr>
{{- range .Cells}}
<td>
{{ template "struct" . }}
</td>
{{- end }}
</tr>
{{- end }}
</table>
<p style="font-size: x-small;" >© 2024 <a href="https://github.com/emicklei/structexplorer">structexplorer</a></p>
</body>
</html>