Skip to content

Commit

Permalink
update pairs loading
Browse files Browse the repository at this point in the history
  • Loading branch information
UtopistMan committed Feb 3, 2022
1 parent 09786db commit b504c4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module widgets
go 1.16

require (
github.com/Sagleft/uexchange-go v1.2.0 // indirect
github.com/Sagleft/uexchange-go v1.3.1
github.com/gin-gonic/gin v1.7.2
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Sagleft/uexchange-go v1.2.0 h1:vxXvj/RJfn0DxCXCcdKSdnDmuUytnMwOu0/sBjptUas=
github.com/Sagleft/uexchange-go v1.2.0/go.mod h1:a3ymZXpf1R5DzzzFS5FVUQSUPD9m+4VChcQ8vLFl36Y=
github.com/Sagleft/uexchange-go v1.3.1 h1:MwUsgqUKC1OpQPsVQw5hMnlyK8anlYimt1dvyDKjYGA=
github.com/Sagleft/uexchange-go v1.3.1/go.mod h1:a3ymZXpf1R5DzzzFS5FVUQSUPD9m+4VChcQ8vLFl36Y=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
2 changes: 2 additions & 0 deletions router.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"log"
"net/http"

"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -32,6 +33,7 @@ func (sol *solution) setupRoutes() error {
c.String(http.StatusInternalServerError, "failed to get pairs: "+err.Error())
return
}
log.Println(pairs)

sol.renderTemplate(
c,
Expand Down
14 changes: 4 additions & 10 deletions templates/pairs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
{{block "head" .}} {{end}}
<body>

<table class="uk-table uk-table-small uk-table-striped uk-text-center">
{{ range .pairs}}
<table>
<tr>
<td>
{{.Pair.PairTitle}}
</td>

<td>
{{.MarketData.Rate}}
</td>
<td>{{.Pair.PairTitle}}</td>
<td>{{.MarketData.Close}}</td>
</tr>

</table>
{{end}}
</table>

{{block "scripts" .}} {{end}}
</body>
Expand Down

0 comments on commit b504c4d

Please sign in to comment.