修复无法正常登录的问题

This commit is contained in:
CN-JS-HuiBai
2026-04-05 01:22:25 +08:00
parent af83f42d26
commit 0f4d3a2986
3 changed files with 144 additions and 156 deletions

View File

@@ -362,43 +362,57 @@
function initGlobe() {
if (!dom.globeContainer) return;
myGlobe = Globe()
(dom.globeContainer)
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
.backgroundColor('rgba(0,0,0,0)')
.showAtmosphere(true)
.atmosphereColor('#6366f1')
.atmosphereDaylightAlpha(0.1)
.pointsData([])
.pointColor(() => '#06b6d4')
.pointAltitude(0.05)
.pointRadius(0.8)
.pointsMerge(true)
.pointLabel(d => `
<div style="background: rgba(10, 14, 26, 0.9); padding: 8px 12px; border: 1px solid var(--accent-indigo); border-radius: 8px; backdrop-filter: blur(8px);">
<div style="font-weight: 700; color: #fff; margin-bottom: 4px;">${escapeHtml(d.job)}</div>
<div style="font-size: 0.75rem; color: var(--text-secondary);">${escapeHtml(d.city || '')}, ${escapeHtml(d.countryName || d.country || '')}</div>
<div style="font-size: 0.75rem; margin-top: 4px;">
<span style="color: var(--accent-indigo);">BW:</span> ↓${formatBandwidth(d.netRx)}${formatBandwidth(d.netTx)}
if (typeof Globe !== 'function') {
console.warn('[Globe] Globe.gl library not loaded. 3D visualization will be disabled.');
dom.globeContainer.innerHTML = `
<div style="height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.8rem; text-align: center; padding: 20px;">
Globe.gl 库加载失败<br>请检查网络连接或刷新页面
</div>
</div>
`);
`;
return;
}
// Resizing
const resizeObserver = new ResizeObserver(() => {
if (myGlobe) {
const width = dom.globeContainer.clientWidth;
const height = dom.globeContainer.clientHeight;
myGlobe.width(width).height(height);
}
});
resizeObserver.observe(dom.globeContainer);
try {
myGlobe = Globe()
(dom.globeContainer)
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
.backgroundColor('rgba(0,0,0,0)')
.showAtmosphere(true)
.atmosphereColor('#6366f1')
.atmosphereDaylightAlpha(0.1)
.pointsData([])
.pointColor(() => '#06b6d4')
.pointAltitude(0.05)
.pointRadius(0.8)
.pointsMerge(true)
.pointLabel(d => `
<div style="background: rgba(10, 14, 26, 0.9); padding: 8px 12px; border: 1px solid var(--accent-indigo); border-radius: 8px; backdrop-filter: blur(8px);">
<div style="font-weight: 700; color: #fff; margin-bottom: 4px;">${escapeHtml(d.job)}</div>
<div style="font-size: 0.75rem; color: var(--text-secondary);">${escapeHtml(d.city || '')}, ${escapeHtml(d.countryName || d.country || '')}</div>
<div style="font-size: 0.75rem; margin-top: 4px;">
<span style="color: var(--accent-indigo);">BW:</span> ↓${formatBandwidth(d.netRx)}${formatBandwidth(d.netTx)}
</div>
</div>
`);
// Initial view
myGlobe.controls().autoRotate = true;
myGlobe.controls().autoRotateSpeed = 0.5;
myGlobe.controls().enableZoom = false; // Disable zoom to maintain dashboard feel
// Resizing
const resizeObserver = new ResizeObserver(() => {
if (myGlobe) {
const width = dom.globeContainer.clientWidth;
const height = dom.globeContainer.clientHeight;
myGlobe.width(width).height(height);
}
});
resizeObserver.observe(dom.globeContainer);
// Initial view
myGlobe.controls().autoRotate = true;
myGlobe.controls().autoRotateSpeed = 0.5;
myGlobe.controls().enableZoom = false; // Disable zoom to maintain dashboard feel
} catch (err) {
console.error('[Globe] Initialization failed:', err);
}
}
function updateGlobe(servers) {