Display compatibility score on the client
This commit is contained in:
parent
474d02ebcb
commit
da0ed3a356
@ -83,6 +83,7 @@ func executeQuery(rw http.ResponseWriter, req *http.Request) {
|
||||
Name: value.name,
|
||||
Url: value.url,
|
||||
Score: value.score,
|
||||
Compatibility: value.compatibility,
|
||||
DistanceToUser: value.distanceToUser,
|
||||
DistanceToStn: value.distanceToStn,
|
||||
ClosestStn: value.closestStn,
|
||||
|
@ -100,8 +100,9 @@
|
||||
<th>Distance to user</th>
|
||||
<th>Closest station</th>
|
||||
<th>Distance to station</th>
|
||||
<th>Access count</th>
|
||||
<th>Compatibility</th>
|
||||
<th>Score</th>
|
||||
<th>Access count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#each records}}
|
||||
@ -110,8 +111,9 @@
|
||||
<td>{{#prettyFloat 2}}{{distanceToUser}}{{/prettyFloat}} km</td>
|
||||
<td>{{closestStn}}</td>
|
||||
<td>{{distanceToStn}} m</td>
|
||||
<td>{{accessCount}}</td>
|
||||
<td>{{#prettyFloat 4}}{{compatibility}}{{/prettyFloat}}</td>
|
||||
<td>{{#prettyFloat 4}}{{score}}{{/prettyFloat}}</td>
|
||||
<td>{{accessCount}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
|
1
types.go
1
types.go
@ -59,6 +59,7 @@ type jsonProjection struct {
|
||||
type jsonRecord struct {
|
||||
AccessCount int `json:"accessCount"`
|
||||
ClosestStn string `json:"closestStn"`
|
||||
Compatibility float64 `json:"compatibility"`
|
||||
DistanceToStn float64 `json:"distanceToStn"`
|
||||
DistanceToUser float64 `json:"distanceToUser"`
|
||||
Id int `json:"id"`
|
||||
|
Loading…
Reference in New Issue
Block a user