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,
|
Name: value.name,
|
||||||
Url: value.url,
|
Url: value.url,
|
||||||
Score: value.score,
|
Score: value.score,
|
||||||
|
Compatibility: value.compatibility,
|
||||||
DistanceToUser: value.distanceToUser,
|
DistanceToUser: value.distanceToUser,
|
||||||
DistanceToStn: value.distanceToStn,
|
DistanceToStn: value.distanceToStn,
|
||||||
ClosestStn: value.closestStn,
|
ClosestStn: value.closestStn,
|
||||||
|
@ -100,8 +100,9 @@
|
|||||||
<th>Distance to user</th>
|
<th>Distance to user</th>
|
||||||
<th>Closest station</th>
|
<th>Closest station</th>
|
||||||
<th>Distance to station</th>
|
<th>Distance to station</th>
|
||||||
<th>Access count</th>
|
<th>Compatibility</th>
|
||||||
<th>Score</th>
|
<th>Score</th>
|
||||||
|
<th>Access count</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{{#each records}}
|
{{#each records}}
|
||||||
@ -110,8 +111,9 @@
|
|||||||
<td>{{#prettyFloat 2}}{{distanceToUser}}{{/prettyFloat}} km</td>
|
<td>{{#prettyFloat 2}}{{distanceToUser}}{{/prettyFloat}} km</td>
|
||||||
<td>{{closestStn}}</td>
|
<td>{{closestStn}}</td>
|
||||||
<td>{{distanceToStn}} m</td>
|
<td>{{distanceToStn}} m</td>
|
||||||
<td>{{accessCount}}</td>
|
<td>{{#prettyFloat 4}}{{compatibility}}{{/prettyFloat}}</td>
|
||||||
<td>{{#prettyFloat 4}}{{score}}{{/prettyFloat}}</td>
|
<td>{{#prettyFloat 4}}{{score}}{{/prettyFloat}}</td>
|
||||||
|
<td>{{accessCount}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</table>
|
</table>
|
||||||
|
1
types.go
1
types.go
@ -59,6 +59,7 @@ type jsonProjection struct {
|
|||||||
type jsonRecord struct {
|
type jsonRecord struct {
|
||||||
AccessCount int `json:"accessCount"`
|
AccessCount int `json:"accessCount"`
|
||||||
ClosestStn string `json:"closestStn"`
|
ClosestStn string `json:"closestStn"`
|
||||||
|
Compatibility float64 `json:"compatibility"`
|
||||||
DistanceToStn float64 `json:"distanceToStn"`
|
DistanceToStn float64 `json:"distanceToStn"`
|
||||||
DistanceToUser float64 `json:"distanceToUser"`
|
DistanceToUser float64 `json:"distanceToUser"`
|
||||||
Id int `json:"id"`
|
Id int `json:"id"`
|
||||||
|
Loading…
Reference in New Issue
Block a user