mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
Remove unnecessary fields from JSON served by API.
Resolved merge conflictiun client/components/routeservers/protocols/index.jsx used calculations taken from "decix/decix" (HEAD) branch
This commit is contained in:
committed by
Matthias Hannig
parent
b9aba16303
commit
7bdaea30d7
@@ -83,17 +83,18 @@ type Neighbour struct {
|
|||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
|
|
||||||
// Mandatory fields
|
// Mandatory fields
|
||||||
Address string `json:"address"`
|
Address string `json:"address"`
|
||||||
Asn int `json:"asn"`
|
Asn int `json:"asn"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
RoutesReceived int `json:"routes_received"`
|
RoutesReceived int `json:"routes_received"`
|
||||||
RoutesFiltered int `json:"routes_filtered"`
|
RoutesFiltered int `json:"routes_filtered"`
|
||||||
RoutesExported int `json:"routes_exported"`
|
RoutesExported int `json:"routes_exported"`
|
||||||
RoutesPreferred int `json:"routes_preferred"`
|
RoutesPreferred int `json:"routes_preferred"`
|
||||||
RoutesAccepted int `json:"routes_accepted"`
|
RoutesAccepted int `json:"routes_accepted"`
|
||||||
Uptime time.Duration `json:"uptime"`
|
RoutesPipeFiltered int `json:"routes_pipe_filtered"`
|
||||||
LastError string `json:"last_error"`
|
Uptime time.Duration `json:"uptime"`
|
||||||
|
LastError string `json:"last_error"`
|
||||||
|
|
||||||
// Original response
|
// Original response
|
||||||
Details map[string]interface{} `json:"details"`
|
Details map[string]interface{} `json:"details"`
|
||||||
|
@@ -131,11 +131,12 @@ func parseNeighbours(bird ClientResponse, config Config) ([]api.Neighbour, error
|
|||||||
State: mustString(protocol["state"], "unknown"),
|
State: mustString(protocol["state"], "unknown"),
|
||||||
Description: mustString(protocol["description"], "no description"),
|
Description: mustString(protocol["description"], "no description"),
|
||||||
//TODO make these changes configurable
|
//TODO make these changes configurable
|
||||||
RoutesReceived: mustInt(routes["imported"], 0),
|
RoutesReceived: mustInt(routes["imported"], 0),
|
||||||
RoutesExported: mustInt(routes["exported"], 0), //TODO protocol_exported?
|
RoutesExported: mustInt(routes["exported"], 0), //TODO protocol_exported?
|
||||||
RoutesFiltered: mustInt(routes["pipe_filtered"], 0),
|
RoutesFiltered: mustInt(routes["filtered"], 0),
|
||||||
RoutesPreferred: mustInt(routes["preferred"], 0),
|
RoutesPreferred: mustInt(routes["preferred"], 0),
|
||||||
RoutesAccepted: mustInt(routes["pipe_imported"], mustInt(routes["imported"], 0)),
|
RoutesAccepted: mustInt(routes["pipe_imported"], mustInt(routes["imported"], 0)),
|
||||||
|
RoutesPipeFiltered: mustInt(routes["pipe_filtered"], mustInt(routes["filtered"], 0)),
|
||||||
|
|
||||||
Uptime: uptime,
|
Uptime: uptime,
|
||||||
LastError: lastError,
|
LastError: lastError,
|
||||||
|
@@ -67,6 +67,9 @@ class NeighboursTable extends React.Component {
|
|||||||
pipe_filtered_count = n.pipe_filtered_count
|
pipe_filtered_count = n.pipe_filtered_count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var filtered_count:int = received_count-accepted_count;
|
||||||
|
var filtered_print:string = (filtered_count < 0) ? "0" : filtered_count.toString();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={n.id}>
|
<tr key={n.id}>
|
||||||
<td>
|
<td>
|
||||||
@@ -110,7 +113,7 @@ class NeighboursTable extends React.Component {
|
|||||||
<RoutesLink routeserverId={this.props.routeserverId}
|
<RoutesLink routeserverId={this.props.routeserverId}
|
||||||
protocol={n.id}
|
protocol={n.id}
|
||||||
state={n.state}>
|
state={n.state}>
|
||||||
{received_count - accepted_count}
|
{filtered_print}
|
||||||
</RoutesLink>
|
</RoutesLink>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
Reference in New Issue
Block a user