fix: IXP picker wrong data path + move Facilities card + IX capacity stat
This commit is contained in:
parent
d417aa46c6
commit
9be247410c
@ -591,6 +591,15 @@ body.dark .card{border-top-color:#e8e4dc}
|
|||||||
<div id="ixContent"></div>
|
<div id="ixContent"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Facilities -->
|
||||||
|
<section class="card" id="facCard" title="Physical colocation facilities where this network is present, sourced from PeeringDB — data centers and carrier hotels where interconnection can be arranged">
|
||||||
|
<div class="card-title">
|
||||||
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 21h18M3 7v14M21 7v14M6 21V10M10 21V10M14 21V10M18 21V10M12 7l9-4H3l9 4z"/></svg>
|
||||||
|
Facilities
|
||||||
|
</div>
|
||||||
|
<div id="facContent"></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- Global Infrastructure Map -->
|
<!-- Global Infrastructure Map -->
|
||||||
<section class="card" id="mapCard" style="display:none">
|
<section class="card" id="mapCard" style="display:none">
|
||||||
<div class="card-title" style="cursor:pointer" onclick="toggleExpand(this)">
|
<div class="card-title" style="cursor:pointer" onclick="toggleExpand(this)">
|
||||||
@ -818,15 +827,6 @@ body.dark .card{border-top-color:#e8e4dc}
|
|||||||
<div id="whoisContent"><div class="section-loading">Loading WHOIS data...</div></div>
|
<div id="whoisContent"><div class="section-loading">Loading WHOIS data...</div></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Facilities -->
|
|
||||||
<section class="card" id="facCard" title="Physical colocation facilities where this network is present, sourced from PeeringDB — data centers and carrier hotels where interconnection can be arranged">
|
|
||||||
<div class="card-title">
|
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 21h18M3 7v14M21 7v14M6 21V10M10 21V10M14 21V10M18 21V10M12 7l9-4H3l9 4z"/></svg>
|
|
||||||
Facilities
|
|
||||||
</div>
|
|
||||||
<div id="facContent"></div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<!-- Contacts & Registration -->
|
<!-- Contacts & Registration -->
|
||||||
<section class="card hidden" id="contactsCard" title="Points of Contact and registration data from PeeringDB and RDAP — includes names, roles, and registration dates. Named individuals may be relevant B2B leads.">
|
<section class="card hidden" id="contactsCard" title="Points of Contact and registration data from PeeringDB and RDAP — includes names, roles, and registration dates. Named individuals may be relevant B2B leads.">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
@ -1496,6 +1496,10 @@ function renderDashboard(d) {
|
|||||||
let ixh = '<div class="stat-row">';
|
let ixh = '<div class="stat-row">';
|
||||||
ixh += '<div class="stat"><div class="stat-val green">' + ix.total_connections + '</div><div class="stat-label">Connections</div></div>';
|
ixh += '<div class="stat"><div class="stat-val green">' + ix.total_connections + '</div><div class="stat-label">Connections</div></div>';
|
||||||
ixh += '<div class="stat"><div class="stat-val purple">' + ix.unique_ixps + '</div><div class="stat-label">Unique IXPs</div></div>';
|
ixh += '<div class="stat"><div class="stat-val purple">' + ix.unique_ixps + '</div><div class="stat-label">Unique IXPs</div></div>';
|
||||||
|
// Total capacity across all IX ports
|
||||||
|
var totalMbps = (ix.connections || []).reduce(function(s, c) { return s + (c.speed_mbps || 0); }, 0);
|
||||||
|
var capLabel = totalMbps >= 1000000 ? (totalMbps/1000000).toFixed(2) + ' Tbps' : totalMbps >= 1000 ? (totalMbps/1000).toFixed(0) + ' Gbps' : totalMbps + ' Mbps';
|
||||||
|
ixh += '<div class="stat"><div class="stat-val cyan">' + capLabel + '</div><div class="stat-label">IX Capacity</div></div>';
|
||||||
ixh += '</div>';
|
ixh += '</div>';
|
||||||
|
|
||||||
if (ix.connections && ix.connections.length > 0) {
|
if (ix.connections && ix.connections.length > 0) {
|
||||||
@ -3873,11 +3877,15 @@ function loadNewFeatures(asn) {
|
|||||||
loadRpkiHistory(asn);
|
loadRpkiHistory(asn);
|
||||||
loadAspath(asn);
|
loadAspath(asn);
|
||||||
loadHijackMonitor(asn);
|
loadHijackMonitor(asn);
|
||||||
// IXP picker: pass all IXPs from PeeringDB data
|
// IXP picker: read from ix_presence.connections (the actual API response structure)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const raw = currentLookupData || {};
|
const raw = currentLookupData || {};
|
||||||
const pdb = raw.peeringdb || {};
|
const conns = (raw.ix_presence && raw.ix_presence.connections) || [];
|
||||||
const ixList = (pdb.ix || []).map(ix => ({ ix_id: ix.ix_id || ix.id, name: ix.name, city: ix.city })).filter(ix => ix.ix_id);
|
// Deduplicate by ix_id (one entry per unique IXP)
|
||||||
|
const seen = new Set();
|
||||||
|
const ixList = conns
|
||||||
|
.filter(c => c.ix_id && !seen.has(c.ix_id) && seen.add(c.ix_id))
|
||||||
|
.map(c => ({ ix_id: c.ix_id, name: c.ix_name, city: c.city }));
|
||||||
loadIxPicker(ixList);
|
loadIxPicker(ixList);
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user