release: bump version to 0.35.1

This commit is contained in:
linkong
2026-04-22 18:04:54 +08:00
parent 439a512148
commit 6a5f9f7ad4
11 changed files with 62 additions and 80 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "planet-frontend",
"version": "0.35.0",
"version": "0.35.1",
"private": true,
"packageManager": "bun@1",
"dependencies": {

View File

@@ -282,23 +282,23 @@
<!-- 2-col KPI grid -->
<div class="stats-grid">
<div class="stat-cell">
<span class="stat-num" id="cable-count"></span>
<span class="stat-num" id="cable-count" data-earth-stat="cable-count"></span>
<span class="stat-label">海缆系统</span>
</div>
<div class="stat-cell">
<span class="stat-num" id="landing-point-count"></span>
<span class="stat-num" id="landing-point-count" data-earth-stat="landing-point-count"></span>
<span class="stat-label">登陆点</span>
</div>
<div class="stat-cell">
<span class="stat-num" id="satellite-count"></span>
<span class="stat-num" id="satellite-count" data-earth-stat="satellite-count"></span>
<span class="stat-label">在轨卫星</span>
</div>
<div class="stat-cell">
<span class="stat-num" id="bgp-anomaly-count"></span>
<span class="stat-num" id="bgp-anomaly-count" data-earth-stat="bgp-anomaly-count"></span>
<span class="stat-label">BGP 事件</span>
</div>
<div class="stat-cell">
<span class="stat-num" id="bgp-collector-count"></span>
<span class="stat-num" id="bgp-collector-count" data-earth-stat="bgp-collector-count"></span>
<span class="stat-label">BGP 观测站</span>
</div>
<div class="stat-cell">
@@ -310,12 +310,12 @@
<!-- BGP status footer -->
<div class="stats-footer">
<span class="stats-footer-dot"></span>
<span id="bgp-status-summary" class="stats-footer-text">暂无观测数据</span>
<span id="bgp-status-summary" class="stats-footer-text" data-earth-stat="bgp-status-summary">暂无观测数据</span>
</div>
<!-- hidden elements kept for JS compatibility -->
<span id="terrain-status" hidden></span>
<span id="texture-quality" hidden></span>
<span id="terrain-status" data-earth-stat="terrain-status" hidden></span>
<span id="texture-quality" data-earth-stat="texture-quality" hidden></span>
<span id="camera-distance" hidden></span>
</div>
@@ -486,19 +486,19 @@
</div>
<div class="earth-mobile-stats-grid">
<div class="earth-mobile-stat-card">
<span id="mobile-cable-count" class="earth-mobile-stat-num"></span>
<span id="mobile-cable-count" class="earth-mobile-stat-num" data-earth-stat="cable-count"></span>
<span class="earth-mobile-stat-label">海缆系统</span>
</div>
<div class="earth-mobile-stat-card">
<span id="mobile-landing-point-count" class="earth-mobile-stat-num"></span>
<span id="mobile-landing-point-count" class="earth-mobile-stat-num" data-earth-stat="landing-point-count"></span>
<span class="earth-mobile-stat-label">登陆点</span>
</div>
<div class="earth-mobile-stat-card">
<span id="mobile-satellite-count" class="earth-mobile-stat-num"></span>
<span id="mobile-satellite-count" class="earth-mobile-stat-num" data-earth-stat="satellite-count"></span>
<span class="earth-mobile-stat-label">在轨卫星</span>
</div>
<div class="earth-mobile-stat-card">
<span id="mobile-bgp-anomaly-count" class="earth-mobile-stat-num"></span>
<span id="mobile-bgp-anomaly-count" class="earth-mobile-stat-num" data-earth-stat="bgp-anomaly-count"></span>
<span class="earth-mobile-stat-label">BGP 事件</span>
</div>
</div>
@@ -509,7 +509,7 @@
</div>
<div class="earth-mobile-situation-card">
<div class="earth-mobile-situation-card-title">BGP 状态</div>
<div id="mobile-bgp-status-summary" class="earth-mobile-situation-status">暂无观测数据</div>
<div id="mobile-bgp-status-summary" class="earth-mobile-situation-status" data-earth-stat="bgp-status-summary">暂无观测数据</div>
</div>
</div>
</section>

View File

@@ -10,7 +10,7 @@ import {
CABLE_CONFIG,
} from "./constants.js";
import { latLonToVector3 } from "./utils.js";
import { updateEarthStats, showStatusMessage } from "./ui.js";
import { setEarthStatValue, updateEarthStats, showStatusMessage } from "./ui.js";
import { showInfoCard } from "./info-card.js";
import { setLegendItems, setLegendMode } from "./legend.js";
@@ -336,9 +336,8 @@ export async function loadGeoJSONFromPath(scene, earthObj, options = {}) {
feature.properties.status === "In Service"),
).length;
const cableCountEl = document.getElementById("cable-count");
const statusEl = document.getElementById("cable-status-summary");
if (cableCountEl) cableCountEl.textContent = cableCount + "个";
setEarthStatValue("cable-count", `${cableCount}`);
if (statusEl) statusEl.textContent = `${inServiceCount}/${cableCount} 运行中`;
updateEarthStats({
@@ -435,10 +434,7 @@ export async function loadLandingPoints(scene, earthObj, options = {}) {
validCount++;
}
const landingPointCountEl = document.getElementById("landing-point-count");
if (landingPointCountEl) {
landingPointCountEl.textContent = validCount + "个";
}
setEarthStatValue("landing-point-count", `${validCount}`);
if (!silent) {
showStatusMessage(`成功加载 ${validCount} 个登陆点`, "success");

View File

@@ -2,7 +2,7 @@
import * as THREE from "three";
import { CONFIG, EARTH_CONFIG, ROTATION_MODE } from "./constants.js";
import { updateZoomDisplay, showStatusMessage } from "./ui.js";
import { setEarthStatValue, updateZoomDisplay, showStatusMessage } from "./ui.js";
import { toggleTerrain, setDayNightEnabled } from "./earth.js";
import { setCelestialDayNightEnabled } from "./celestial.js";
import {
@@ -873,12 +873,7 @@ async function setSatellitesLayerEnabled(button, enabled, { persist = true, sile
if (!enabled && !silent) {
showStatusMessage("卫星已隐藏", "info");
} else if (enabled) {
["satellite-count", "mobile-satellite-count"].forEach((id) => {
const satelliteCountEl = document.getElementById(id);
if (satelliteCountEl) {
satelliteCountEl.textContent = `${getSatelliteCount()}`;
}
});
setEarthStatValue("satellite-count", `${getSatelliteCount()}`);
}
syncMobileLayerCards();
if (persist) persistEarthSettings();
@@ -906,10 +901,7 @@ function setBGPLayerEnabled(button, enabled, { persist = true, silent = false }
active: enabled,
tooltip: enabled ? "隐藏BGP观测" : "显示BGP观测",
});
const bgpCountEl = document.getElementById("bgp-anomaly-count");
if (bgpCountEl) {
bgpCountEl.textContent = `${getBGPCount()}`;
}
setEarthStatValue("bgp-anomaly-count", `${getBGPCount()}`);
syncMobileLayerCards();
if (persist) persistEarthSettings();
if (!silent) {

View File

@@ -19,6 +19,7 @@ import {
updateCoordinatesDisplay,
updateZoomDisplay,
updateEarthStats,
setEarthStatValue,
setLoading,
setLoadingMessage,
showTooltip,
@@ -1032,22 +1033,9 @@ function updateBGPHud(bgpResult) {
}
}
const bgpCountEl = document.getElementById("bgp-anomaly-count");
if (bgpCountEl) {
bgpCountEl.textContent = `${bgpResult.totalCount}`;
}
const bgpCollectorEl = document.getElementById("bgp-collector-count");
if (bgpCollectorEl) {
bgpCollectorEl.textContent = `${bgpResult.collectorCount}`;
}
["bgp-status-summary", "mobile-bgp-status-summary"].forEach((id) => {
const bgpStatusEl = document.getElementById(id);
if (bgpStatusEl) {
bgpStatusEl.textContent = getBGPStatusText(bgpResult);
}
});
setEarthStatValue("bgp-anomaly-count", `${bgpResult.totalCount}`);
setEarthStatValue("bgp-collector-count", `${bgpResult.collectorCount}`);
setEarthStatValue("bgp-status-summary", getBGPStatusText(bgpResult));
}
function ensureCruiseConnector() {
@@ -1410,12 +1398,7 @@ function updateSatelliteToggleUi(enabled, satelliteCount = getSatelliteCount())
});
}
["satellite-count", "mobile-satellite-count"].forEach((id) => {
const satelliteCountEl = document.getElementById(id);
if (satelliteCountEl) {
satelliteCountEl.textContent = `${satelliteCount}`;
}
});
setEarthStatValue("satellite-count", `${satelliteCount}`);
}
function updateCableToggleUi(enabled) {
@@ -1428,15 +1411,8 @@ function updateCableToggleUi(enabled) {
});
}
const cableCountEl = document.getElementById("cable-count");
if (cableCountEl) {
cableCountEl.textContent = `${getCableLines().length}`;
}
const landingPointCountEl = document.getElementById("landing-point-count");
if (landingPointCountEl) {
landingPointCountEl.textContent = `${getLandingPoints().length}`;
}
setEarthStatValue("cable-count", `${getCableLines().length}`);
setEarthStatValue("landing-point-count", `${getLandingPoints().length}`);
}
async function ensureCablesEnabled() {
@@ -1553,8 +1529,7 @@ function disableSatellites() {
function updateStatsSummary() {
updateEarthStats({
cableCount: getCableLines().length,
landingPointCount:
document.getElementById("landing-point-count")?.textContent || 0,
landingPointCount: getLandingPoints().length,
bgpAnomalyCount: `${getBGPCount()}`,
bgpCollectorCount: `${getBGPCollectorCount()}`,
bgpStatusSummary: getBGPStatusSummary(),

View File

@@ -19,10 +19,15 @@ function getElement(id) {
return document.getElementById(id);
}
function setTextTargets(ids, value) {
ids.forEach((id) => {
const element = getElement(id);
if (element) {
function getEarthStatTargets(statKey) {
return Array.from(
document.querySelectorAll(`[data-earth-stat="${statKey}"]`),
);
}
export function setEarthStatValue(statKey, value) {
getEarthStatTargets(statKey).forEach((element) => {
if (element instanceof HTMLElement) {
element.textContent = value;
}
});
@@ -180,13 +185,13 @@ export function updateZoomDisplay(zoomLevel, distance) {
// Update earth stats
export function updateEarthStats(stats) {
setTextTargets(["cable-count", "mobile-cable-count"], String(stats.cableCount || 0));
setTextTargets(["landing-point-count", "mobile-landing-point-count"], String(stats.landingPointCount || 0));
setTextTargets(["bgp-anomaly-count", "mobile-bgp-anomaly-count"], String(stats.bgpAnomalyCount || 0));
setTextTargets(["bgp-collector-count"], String(stats.bgpCollectorCount || 0));
setTextTargets(["bgp-status-summary", "mobile-bgp-status-summary"], stats.bgpStatusSummary || "-");
setTextTargets(["terrain-status"], stats.terrainOn ? "开启" : "关闭");
setTextTargets(["texture-quality"], stats.textureQuality || "8K 卫星图");
setEarthStatValue("cable-count", String(stats.cableCount || 0));
setEarthStatValue("landing-point-count", String(stats.landingPointCount || 0));
setEarthStatValue("bgp-anomaly-count", String(stats.bgpAnomalyCount || 0));
setEarthStatValue("bgp-collector-count", String(stats.bgpCollectorCount || 0));
setEarthStatValue("bgp-status-summary", stats.bgpStatusSummary || "-");
setEarthStatValue("terrain-status", stats.terrainOn ? "开启" : "关闭");
setEarthStatValue("texture-quality", stats.textureQuality || "8K 卫星图");
}
// Show/hide loading via status message