rotonda 0.5.2-alpha.0

composable, programmable BGP engine
Documentation
@(title: &str, routes: &[(Prefix, Vec<RouteDetails>)])

@{
    let max_nlri = 1000;
    let cnt = if routes.len() > max_nlri {
        format!(
            "(showing first {max_nlri}/{} prefixes ({} routes))",
            routes.len(),
            routes.iter().take(max_nlri)
                .map(|(_nlri, routes2)| routes2.len()).sum::<usize>()
        )
    } else {
        format!(
            "({}/{} prefixes/routes)",
            routes.len(),
            routes.iter()
                .map(|(_nlri, routes2)| routes2.len()).sum::<usize>()
        )
    };
    
}
<h2>@title @cnt</h2>
<table>
    <tr>
        <th>prefix</th>
        <th>source</th>
        <th>peer&nbsp;ASN</th>
        <th>rib view</th>
        <th>origin&nbsp;ASN</th>
        <th>RPKI&nbsp;ROV</th>
        <th>OTC</th>
        <th>as_path</th>
        <th>communities</th>
    </tr>
    @for (nlri, routes2) in routes.iter().take(max_nlri) {
        @for details in routes2.iter() {
        @{
            let RouteDetails {bmp_router, peer_asn, ribview, origin_asn, rov_status, otc, as_path, communities} = details;
        }
        <tr>
            <td><a href="/routes/@nlri">@nlri</a></td>
            <td>
                @if let Some(bmp_router) = bmp_router {
                    @#bmp_details(&bmp_router)
                }
            </td>
            <td>@#peer_asn.map(peer_asn_link).alt("")</td>
            <td>@ribview.alt("")</a></td>
            <td>@origin_asn</td>
            <td>@rov_status</td>
            <td>@otc.alt("")</td>
            <td>@as_path</td>
            <td>@communities</td>
        </tr>
        }
    }
</table>