fix: finalize earth bgp incident interactions

This commit is contained in:
linkong
2026-04-01 09:41:42 +08:00
parent 016507ad68
commit 4dc6a9d942
6 changed files with 74 additions and 29 deletions

View File

@@ -1 +1 @@
0.22.5 0.22.6

View File

@@ -7,6 +7,25 @@ This project follows the repository versioning rule:
- `feature` -> `+0.1.0` - `feature` -> `+0.1.0`
- `bugfix` -> `+0.0.1` - `bugfix` -> `+0.0.1`
## 0.22.6
Released: 2026-04-01
### Highlights
- Finished the remaining Earth-side BGP interaction changes that were left out of the previous push, so collector and incident selections now use the intended semantic linking behavior in the globe view.
### Improved
- Improved [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js) so BGP incident cards synthesize a clearer narrative summary when backend text is sparse, instead of exposing a thin raw summary.
- Improved [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js) so incident selection reports impacted region counts and related cable counts directly in the Earth status message.
- Improved [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js) so BGP incident-linked cables use a locked visual state, making event-to-cable correlation easier to read on the globe.
### Fixed
- Fixed the omitted Earth-side BGP semantic update from the previous push by actually shipping the `incident nearby satellites` wording, incident narrative fallback, and related-cable lock highlighting in [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js).
- Fixed collector selection semantics in [main.js](/home/ray/dev/linkong/planet/frontend/public/earth/js/main.js) so selecting a BGP collector no longer triggers the weaker nearby-satellite hint and no longer dims cable and landing-point layers as if it were an incident state.
## 0.22.5 ## 0.22.5
Released: 2026-03-31 Released: 2026-03-31

View File

@@ -1,12 +1,12 @@
{ {
"name": "planet-frontend", "name": "planet-frontend",
"version": "0.22.5", "version": "0.22.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "planet-frontend", "name": "planet-frontend",
"version": "0.22.5", "version": "0.22.6",
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.2.6", "@ant-design/icons": "^5.2.6",
"antd": "^5.12.5", "antd": "^5.12.5",

View File

@@ -1,6 +1,6 @@
{ {
"name": "planet-frontend", "name": "planet-frontend",
"version": "0.22.5", "version": "0.22.6",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.2.6", "@ant-design/icons": "^5.2.6",

View File

@@ -433,6 +433,15 @@ function showBGPInfo(marker) {
country: marker.userData.country, country: marker.userData.country,
}, },
]; ];
const observedBy =
marker.userData.observed_by ||
formatBGPObservedBy(marker.userData.collectors);
const impactedScope = formatBGPImpactedScope(impactedRegions);
const relatedCables = formatBGPRelatedCables(marker.userData.related_cables);
const narrative =
marker.userData.summary && marker.userData.summary !== "-"
? marker.userData.summary
: buildBGPIncidentNarrative(marker, impactedRegions);
showInfoCard("bgp", { showInfoCard("bgp", {
anomaly_type: formatBGPAnomalyTypeLabel( anomaly_type: formatBGPAnomalyTypeLabel(
marker.userData.incident_type || marker.userData.anomaly_type, marker.userData.incident_type || marker.userData.anomaly_type,
@@ -465,20 +474,18 @@ function showBGPInfo(marker) {
: marker.userData.new_origin_asn, : marker.userData.new_origin_asn,
confidence: formatBGPConfidence(marker.userData.confidence), confidence: formatBGPConfidence(marker.userData.confidence),
collector: marker.userData.collector, collector: marker.userData.collector,
observed_by: observed_by: observedBy,
marker.userData.observed_by || impacted_scope: impactedScope,
formatBGPObservedBy(marker.userData.collectors), related_cables: relatedCables,
impacted_scope: formatBGPImpactedScope(impactedRegions),
related_cables: formatBGPRelatedCables(marker.userData.related_cables),
related_satellites: related_satellites:
marker.userData.related_satellite_count > 0 marker.userData.related_satellite_count > 0
? `${marker.userData.related_satellite_count}颗附近卫星` ? `${marker.userData.related_satellite_count}事件附近卫星`
: "-", : "-",
location: location:
marker.userData.location || marker.userData.location ||
formatBGPLocation(marker.userData.city, marker.userData.country), formatBGPLocation(marker.userData.city, marker.userData.country),
created_at: formatBGPObservedTime(marker.userData.created_at_raw), created_at: formatBGPObservedTime(marker.userData.created_at_raw),
summary: marker.userData.summary, summary: narrative,
}); });
} }
@@ -495,10 +502,7 @@ function showBGPCollectorInfo(marker) {
origin_asn_count: marker.userData.origin_asn_count ?? 0, origin_asn_count: marker.userData.origin_asn_count ?? 0,
top_event_types: formatBGPTopEventTypes(marker.userData.top_event_types), top_event_types: formatBGPTopEventTypes(marker.userData.top_event_types),
coverage_halo: formatBGPCollectorCoverageHalo(marker.userData), coverage_halo: formatBGPCollectorCoverageHalo(marker.userData),
related_satellites: related_satellites: "-",
marker.userData.related_satellite_count > 0
? `${marker.userData.related_satellite_count}颗附近卫星`
: "-",
latest_event_type: marker.userData.latest_event_type || "-", latest_event_type: marker.userData.latest_event_type || "-",
latest_observed_at: formatBGPObservedTime(marker.userData.latest_observed_at), latest_observed_at: formatBGPObservedTime(marker.userData.latest_observed_at),
baseline_scope: formatBGPScope(marker.userData.baseline_scope), baseline_scope: formatBGPScope(marker.userData.baseline_scope),
@@ -523,6 +527,35 @@ function getBGPRelatedCableNames(marker) {
return names; return names;
} }
function getBGPInfrastructureSummary(marker) {
return {
cableCount: getBGPRelatedCableNames(marker).length,
regionCount: getBGPRelatedRegions(marker).length,
};
}
function buildBGPIncidentNarrative(marker, impactedRegions) {
const eventLabel = formatBGPAnomalyTypeLabel(
marker.userData.incident_type || marker.userData.anomaly_type,
);
const severityLabel = formatBGPSeverityLabel(
marker.userData.rawSeverity || marker.userData.severity,
);
const observedBy =
marker.userData.observed_by ||
formatBGPObservedBy(marker.userData.collectors);
const routeLabel =
marker.userData.route_change ||
formatBGPRouteChange(
marker.userData.origin_asn,
marker.userData.new_origin_asn,
);
const cableCount = getBGPRelatedCableNames(marker).length;
const regionCount = impactedRegions.length;
return `${eventLabel}${severityLabel}${observedBy},影响${regionCount}个区域,关联${cableCount}条海缆线索${routeLabel && routeLabel !== "-" ? `,特征 ${routeLabel}` : ""}`;
}
function getBGPRelatedRegions(marker) { function getBGPRelatedRegions(marker) {
if (Array.isArray(marker?.userData?.impacted_regions) && marker.userData.impacted_regions.length > 0) { if (Array.isArray(marker?.userData?.impacted_regions) && marker.userData.impacted_regions.length > 0) {
return marker.userData.impacted_regions; return marker.userData.impacted_regions;
@@ -572,8 +605,7 @@ function applyCableVisualState() {
if ( if (
(lockedObjectType === "cable" && lockedObject) || (lockedObjectType === "cable" && lockedObject) ||
(lockedObjectType === "satellite" && lockedSatellite) || (lockedObjectType === "satellite" && lockedSatellite) ||
(lockedObjectType === "bgp" && lockedObject) || (lockedObjectType === "bgp" && lockedObject)
(lockedObjectType === "bgp_collector" && lockedObject)
) { ) {
cable.material.opacity = CABLE_CONFIG.otherOpacity; cable.material.opacity = CABLE_CONFIG.otherOpacity;
const origColor = cable.userData.originalColor; const origColor = cable.userData.originalColor;
@@ -1344,9 +1376,10 @@ function onClick(event) {
clickedMarker.userData.related_satellite_count = relatedSatelliteIndices.length; clickedMarker.userData.related_satellite_count = relatedSatelliteIndices.length;
highlightRelatedSatellites(relatedSatelliteIndices, "#7dd3fc"); highlightRelatedSatellites(relatedSatelliteIndices, "#7dd3fc");
} }
const incidentSummary = getBGPInfrastructureSummary(clickedMarker);
showBGPInfo(clickedMarker); showBGPInfo(clickedMarker);
showStatusMessage( showStatusMessage(
`已选择BGP事件: ${clickedMarker.userData.collector}`, `已选择BGP事件: ${clickedMarker.userData.collector} · ${incidentSummary.regionCount}个区域 / ${incidentSummary.cableCount}条相关海缆`,
"info", "info",
); );
return; return;
@@ -1366,14 +1399,7 @@ function onClick(event) {
lastBGPClickPos = { x: event.clientX, y: event.clientY }; lastBGPClickPos = { x: event.clientX, y: event.clientY };
setAutoRotate(false); setAutoRotate(false);
showBGPCollectorCoverageOverlay(clickedMarker, earth); showBGPCollectorCoverageOverlay(clickedMarker, earth);
{ clickedMarker.userData.related_satellite_count = 0;
const relatedSatelliteIndices = getRelatedSatelliteIndicesForRegions(
getBGPRelatedRegions(clickedMarker),
{ limit: 4, maxAngleDeg: 18 },
);
clickedMarker.userData.related_satellite_count = relatedSatelliteIndices.length;
highlightRelatedSatellites(relatedSatelliteIndices, "#93c5fd");
}
showBGPCollectorInfo(clickedMarker); showBGPCollectorInfo(clickedMarker);
showStatusMessage( showStatusMessage(
`已选择观测站: ${clickedMarker.userData.collector}`, `已选择观测站: ${clickedMarker.userData.collector}`,
@@ -1522,7 +1548,7 @@ function animate() {
relatedCableNames.forEach((name) => { relatedCableNames.forEach((name) => {
getCableLines().forEach((cable) => { getCableLines().forEach((cable) => {
if (cable.userData?.name === name) { if (cable.userData?.name === name) {
setCableState(cable.userData.cableId, CABLE_STATE.HOVERED); setCableState(cable.userData.cableId, CABLE_STATE.LOCKED);
} }
}); });
}); });
@@ -1532,7 +1558,7 @@ function animate() {
); );
} else if (lockedObjectType === "bgp_collector" && lockedObject) { } else if (lockedObjectType === "bgp_collector" && lockedObject) {
clearAllCableStates(); clearAllCableStates();
applyLandingPointVisualState(null, true); resetLandingPointVisualState();
} else { } else {
resetLandingPointVisualState(); resetLandingPointVisualState();
} }

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "planet" name = "planet"
version = "0.22.5" version = "0.22.6"
description = "智能星球计划 - 态势感知系统" description = "智能星球计划 - 态势感知系统"
requires-python = ">=3.14" requires-python = ">=3.14"
dependencies = [ dependencies = [