修复线路不显示的问题
This commit is contained in:
@@ -320,6 +320,7 @@
|
|||||||
// setInterval(fetchMetrics, REFRESH_INTERVAL); - Now using WebSockets
|
// setInterval(fetchMetrics, REFRESH_INTERVAL); - Now using WebSockets
|
||||||
initWebSocket();
|
initWebSocket();
|
||||||
setInterval(fetchNetworkHistory, NETWORK_HISTORY_INTERVAL);
|
setInterval(fetchNetworkHistory, NETWORK_HISTORY_INTERVAL);
|
||||||
|
fetchLatency();
|
||||||
setInterval(fetchLatency, REFRESH_INTERVAL);
|
setInterval(fetchLatency, REFRESH_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,6 +336,7 @@
|
|||||||
if (msg.type === 'overview') {
|
if (msg.type === 'overview') {
|
||||||
allServersData = msg.data.servers || [];
|
allServersData = msg.data.servers || [];
|
||||||
updateDashboard(msg.data);
|
updateDashboard(msg.data);
|
||||||
|
updateMap2D(allServersData);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('WS Message Error:', err);
|
console.error('WS Message Error:', err);
|
||||||
@@ -689,26 +691,38 @@
|
|||||||
data: lineData
|
data: lineData
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add or update line series
|
window.latencySeries = lineSeries;
|
||||||
const options = myMap2D.getOption();
|
} else {
|
||||||
const series = options.series;
|
window.latencySeries = null;
|
||||||
|
|
||||||
// Filter out existing latency lines to update
|
|
||||||
const newSeries = series.filter(s => s.type !== 'lines' || !s.latencyLine);
|
|
||||||
lineSeries.latencyLine = true;
|
|
||||||
newSeries.push(lineSeries);
|
|
||||||
|
|
||||||
myMap2D.setOption({ series: newSeries });
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
window.latencySeries = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Combine all series
|
||||||
|
const finalSeries = [
|
||||||
|
{
|
||||||
|
type: 'scatter',
|
||||||
|
coordinateSystem: 'geo',
|
||||||
|
geoIndex: 0,
|
||||||
|
symbolSize: 6,
|
||||||
|
itemStyle: {
|
||||||
|
color: '#06b6d4',
|
||||||
|
shadowBlur: 3,
|
||||||
|
shadowColor: 'rgba(6, 182, 212, 0.5)'
|
||||||
|
},
|
||||||
|
data: geoData,
|
||||||
|
zlevel: 1
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
if (window.latencySeries) {
|
||||||
|
finalSeries.push(window.latencySeries);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMap2D.setOption({
|
myMap2D.setOption({
|
||||||
series: [{
|
series: finalSeries
|
||||||
coordinateSystem: 'geo',
|
});
|
||||||
geoIndex: 0,
|
|
||||||
data: geoData
|
|
||||||
}]
|
|
||||||
}, { replaceMerge: ['series'] });
|
|
||||||
|
|
||||||
// Update footer stats
|
// Update footer stats
|
||||||
if (dom.globeTotalNodes) dom.globeTotalNodes.textContent = geoData.length;
|
if (dom.globeTotalNodes) dom.globeTotalNodes.textContent = geoData.length;
|
||||||
|
|||||||
Reference in New Issue
Block a user