fix(dashboard): fmtSpd() all speed displays -- 1.00G->1G, 400.00G->400G, 1600->1.6T
This commit is contained in:
parent
f2b26e3286
commit
8432a44574
@ -5197,7 +5197,7 @@ function searchSwitches() {
|
||||
buildDOM(el('sw-table'), items.map(function(s) {
|
||||
var catColors = { DataCenter: 'b-blue', Campus: 'b-green', SP: 'b-purple', Core: 'b-orange', Edge: 'b-cyan', Industrial: 'b-yellow' };
|
||||
var statusColors = { Active: 'b-green', 'EoS_Announced': 'b-yellow', EoL: 'b-red', Legacy: 'b-neutral' };
|
||||
var maxSpd = s.max_speed_gbps >= 1000 ? (s.max_speed_gbps/1000) + 'T' : s.max_speed_gbps + 'G';
|
||||
var maxSpd = fmtSpd(s.max_speed_gbps);
|
||||
var cap = s.switching_capacity_tbps ? s.switching_capacity_tbps + ' Tbps' : '—';
|
||||
// Thumbnail — show image if available, otherwise a switch icon
|
||||
var thumb = s.image_url
|
||||
@ -5266,7 +5266,7 @@ async function openSwitchDetail(id) {
|
||||
h += '<div class="panel-stat"><div class="panel-stat-label">Category</div><div class="panel-stat-val" style="font-size:1rem">' + esc(s.category || '—') + '</div></div>';
|
||||
h += '<div class="panel-stat"><div class="panel-stat-label">Total Ports</div><div class="panel-stat-val">' + esc(s.total_ports || '—') + '</div></div>';
|
||||
h += '<div class="panel-stat"><div class="panel-stat-label">Switching Capacity</div><div class="panel-stat-val">' + (s.switching_capacity_tbps ? s.switching_capacity_tbps + ' <small>Tbps</small>' : '—') + '</div></div>';
|
||||
h += '<div class="panel-stat"><div class="panel-stat-label">Max Speed</div><div class="panel-stat-val">' + (s.max_speed_gbps >= 1000 ? (s.max_speed_gbps/1000) + 'T' : (s.max_speed_gbps || '—') + 'G') + '</div></div>';
|
||||
h += '<div class="panel-stat"><div class="panel-stat-label">Max Speed</div><div class="panel-stat-val">' + (fmtSpd(s.max_speed_gbps)) + '</div></div>';
|
||||
h += '</div>';
|
||||
|
||||
h += '<div class="panel-section">Specifications</div>';
|
||||
@ -5870,7 +5870,7 @@ async function loadStandardsList() {
|
||||
var ff = Array.isArray(s.form_factors) ? s.form_factors[0] : (s.form_factors || s.form_factor || '');
|
||||
return '<span style="background:' + heat + '22;color:' + heat + ';padding:2px 10px;border-radius:10px;font-size:0.72rem;font-weight:600;cursor:pointer" '
|
||||
+ 'title="Composite score: ' + score.toFixed(2) + '">'
|
||||
+ esc((s.speed_gbps ? s.speed_gbps + 'G ' : '') + (ff || s.name || s.category || ''))
|
||||
+ esc((s.speed_gbps ? fmtSpd(s.speed_gbps) + ' ' : '') + (ff || s.name || s.category || ''))
|
||||
+ '</span>';
|
||||
}).join('')
|
||||
+ '</div></div>';
|
||||
@ -5941,7 +5941,7 @@ function renderFormFactors(items) {
|
||||
var sCl = statusColors[f.status] || '#888';
|
||||
var fCl = familyColors[f.family] || '#888';
|
||||
var sLbl = statusLabels[f.status] || f.status || '';
|
||||
var maxSpd = f.max_speed_gbps >= 1000 ? (f.max_speed_gbps/1000) + 'T' : (f.max_speed_gbps || '?') + 'G';
|
||||
var maxSpd = fmtSpd(f.max_speed_gbps);
|
||||
// Description: show first part (DE) if bilingual
|
||||
var descFull = f.description || '';
|
||||
var descDE = descFull.split('//')[0].trim();
|
||||
@ -6060,7 +6060,7 @@ async function openFormFactorDetail(name) {
|
||||
var descFull = f.description || '';
|
||||
var descDE = descFull.split('//')[0].trim();
|
||||
var descEN = descFull.includes('//') ? descFull.split('//')[1].trim() : '';
|
||||
var maxSpd = f.max_speed_gbps >= 1000 ? (f.max_speed_gbps/1000) + 'T' : (f.max_speed_gbps || '?') + 'G';
|
||||
var maxSpd = fmtSpd(f.max_speed_gbps);
|
||||
var supersedes = Array.isArray(f.supersedes) ? f.supersedes.filter(Boolean) : [];
|
||||
var hype = FF_HYPE[f.name] || { phase:'—', pct:50, signal:'—', sigCol:'#888', sigLbl:'Keine Daten' };
|
||||
var useCases = FF_USE_CASES[f.name] || [];
|
||||
@ -6922,7 +6922,7 @@ async function runFinder() {
|
||||
'<div style="font-size:1.1rem;font-weight:700">' + sw.vendor + ' ' + sw.model + '</div>' +
|
||||
'<div style="color:var(--text-dim);font-size:0.8rem">' +
|
||||
(sw.series ? sw.series + ' · ' : '') +
|
||||
'Max speed: ' + (sw.max_speed_gbps || '?') + 'G' +
|
||||
'Max speed: ' + fmtSpd(sw.max_speed_gbps) +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div style="text-align:right;font-size:0.8rem;color:var(--text-dim)">' +
|
||||
@ -12275,7 +12275,7 @@ async function openSignalPriceChart(txId, partNumber) {
|
||||
var d = await (await fetch('/api/price-history/' + txId + '?days=180', { headers: { 'Authorization': 'Bearer ' + tok } })).json();
|
||||
var tx = d.transceiver || {};
|
||||
document.getElementById('ph-title').textContent = 'Price History — ' + (tx.part_number || partNumber || txId)
|
||||
+ (tx.form_factor ? ' (' + tx.form_factor + (tx.speed_gbps ? ' · ' + tx.speed_gbps + 'G' : '') + ')' : '');
|
||||
+ (tx.form_factor ? ' (' + tx.form_factor + (tx.speed_gbps ? ' · ' + fmtSpd(tx.speed_gbps) : '') + ')' : '');
|
||||
|
||||
var series = d.series || [];
|
||||
if (!series.length) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user