feat: add data sources config system and Earth API integration

- Add data_sources.yaml for configurable data source URLs
- Add data_sources.py to load config with database override support
- Add arcgis_landing_points and arcgis_cable_landing_relation collectors
- Change visualization API to query arcgis_landing_points
- Add /api/v1/datasources/configs/all endpoint
- Update Earth to fetch from API instead of static files
- Fix scheduler collector ID mappings
This commit is contained in:
rayd1o
2026-03-13 10:54:02 +08:00
parent 99771a88c5
commit de32552159
25 changed files with 222 additions and 23 deletions

View File

@@ -128,7 +128,7 @@ export async function loadGeoJSONFromPath(scene, earthObj) {
console.log('正在加载电缆数据...');
showStatusMessage('正在加载电缆数据...', 'warning');
const response = await fetch(PATHS.geoJSON);
const response = await fetch(PATHS.cablesApi);
if (!response.ok) {
throw new Error(`HTTP错误: ${response.status}`);
}
@@ -161,7 +161,7 @@ export async function loadGeoJSONFromPath(scene, earthObj) {
if (!geometry || !geometry.coordinates) continue;
const color = getCableColor(properties);
console.log('电缆:', properties.Name, '颜色:', color);
console.log('电缆 properties:', JSON.stringify(properties));
if (geometry.type === 'MultiLineString') {
for (const lineCoords of geometry.coordinates) {
@@ -239,7 +239,7 @@ export async function loadLandingPoints(scene, earthObj) {
try {
console.log('正在加载登陆点数据...');
const response = await fetch('./landing-point-geo.geojson');
const response = await fetch(PATHS.landingPointsApi);
if (!response.ok) {
console.error('HTTP错误:', response.status);
return;

View File

@@ -9,9 +9,11 @@ export const CONFIG = {
rotationSpeed: 0.002,
};
// Paths
export const PATHS = {
cablesApi: '/api/v1/visualization/geo/cables',
landingPointsApi: '/api/v1/visualization/geo/landing-points',
geoJSON: './geo.json',
landingPointsStatic: './landing-point-geo.geojson',
};
// Cable colors mapping

View File

@@ -171,7 +171,6 @@ function onMouseMove(event, camera) {
c.material.opacity = 1;
});
hoveredCable = cable;
hoveredCable = cable;
}
const userData = cable.userData;

View File

@@ -1,7 +1,7 @@
function Earth() {
return (
<iframe
src="/earth/3dearthmult.html"
src="/earth/index.html"
style={{
width: '100vw',
height: '100vh',