refactor: 统一启动脚本到planet.sh,修复resetView调用

- 新增planet.sh统一管理start/stop/restart/health/log命令
- docker-compose.yml只保留postgres和redis
- controls.js点击事件调用resetView函数
This commit is contained in:
rayd1o
2026-03-18 18:09:12 +08:00
parent 3b0e9dec5a
commit 11a9dda942
6 changed files with 133 additions and 295 deletions

View File

@@ -185,27 +185,7 @@ function setupRotateControls(camera, earth) {
});
document.getElementById('reset-view').addEventListener('click', function() {
if (!earthObj) return;
const startRotX = earthObj.rotation.x;
const startRotY = earthObj.rotation.y;
const startZoom = zoomLevel;
const targetRotX = 23.5 * Math.PI / 180;
const targetRotY = 0;
const targetZoom = 1.0;
animateValue(0, 1, 800, (progress) => {
const ease = 1 - Math.pow(1 - progress, 3);
earthObj.rotation.x = startRotX + (targetRotX - startRotX) * ease;
earthObj.rotation.y = startRotY + (targetRotY - startRotY) * ease;
zoomLevel = startZoom + (targetZoom - startZoom) * ease;
camera.position.z = CONFIG.defaultCameraZ / zoomLevel;
updateZoomDisplay(zoomLevel, camera.position.z.toFixed(0));
}, () => {
zoomLevel = 1.0;
showStatusMessage('视图已重置', 'info');
});
resetView(camera);
});
}