Skip to content

Commit

Permalink
display in index
Browse files Browse the repository at this point in the history
  • Loading branch information
whyvrafvr committed Sep 6, 2024
1 parent 6cf2e31 commit 2b8c62c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ func bulkSignature(c *gin.Context) {

func setupRouter() *gin.Engine {
r := gin.Default()
t := template.Must(template.ParseFS(tfs, "templates/*"))
t := template.Must(template.New("").Funcs(template.FuncMap{
"inc": func(i int) int {
return i + 1
},
}).ParseFS(tfs, "templates/*"))
r.SetHTMLTemplate(t)

r.Use(cors)
Expand Down
15 changes: 9 additions & 6 deletions api/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@
color: white;
background-color: dodgerblue;
font-weight: bold;
padding: 1px;
}

.key {
color: deepskyblue;
background-color: black;
padding: 1px;
}

@media all and (max-width: 500px) {
Expand Down Expand Up @@ -71,21 +73,22 @@
<thead>
<tr>
<th scope="col">
<span>πŸ”‘ Private Key</span>
<span class="key">πŸ”‘ Private Key</span>
<br />
<span>🚩 Public Address</span>
<span class="address">πŸ“₯ Public Address</span>
</th>
</tr>
</thead>
<tbody>
{{ $index := 1 }}
{{range $k,$a := .}}<tr>
<td>
<span>πŸ”‘</span><br />
<span class="key">{{$k}}</span><br />
<span>🚩</span><br />
<span class="address">{{$a}}</span>
<span>(#{{$index}})</span><br />
<span class="key">πŸ”‘ {{$k}}</span><br />
<span class="address">πŸ“₯ {{$a}}</span>
</td>
</tr>
{{ $index = inc $index }}
{{end}}
</tbody>
</table>
Expand Down

0 comments on commit 2b8c62c

Please sign in to comment.