VEHICLE运载器状态
diff --git a/frontend/src/pages/admin/Rockets.tsx b/frontend/src/pages/admin/Rockets.tsx
index f218934..0a73f0c 100644
--- a/frontend/src/pages/admin/Rockets.tsx
+++ b/frontend/src/pages/admin/Rockets.tsx
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
-import { Button, Col, Form, Input, InputNumber, Row, Switch, Tabs } from 'antd';
+import { Alert, Button, Col, Form, Input, InputNumber, Row, Switch, Tabs } from 'antd';
import { AdminModal } from '../../components/admin/AdminModal';
import { RocketOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
@@ -12,7 +12,7 @@ import { useToast } from '../../contexts/ToastContext';
const defaultStage1 = { name: '一级推进器', dry_mass_kg: 25000, fuel_mass_kg: 400000, max_thrust_n: 7500000, specific_impulse_s: 285, engine_count: 9, length_ratio: 0.65 };
const defaultStage2 = { name: '二级推进器', dry_mass_kg: 4000, fuel_mass_kg: 100000, max_thrust_n: 1000000, specific_impulse_s: 350, engine_count: 1, length_ratio: 0.35 };
-const createDefaults = { color: '#f8fafc', launch_site_name: '发射场', launch_latitude_deg: 0, launch_longitude_deg: 0, payload_mass_kg: 15000, drag_coefficient: 0.4, target_orbit_km: 200, target_velocity_mps: 7800, separation_delay_seconds: 2, second_stage_ignition_delay_seconds: 1, is_active: true, sort_order: 0, stage_1: defaultStage1, stage_2: defaultStage2 };
+const createDefaults = { color: '#f8fafc', launch_site_name: '发射场', launch_latitude_deg: 0, launch_longitude_deg: 0, payload_mass_kg: 15000, drag_coefficient: 0.4, target_orbit_km: 200, target_velocity_mps: 7800, separation_delay_seconds: 2, second_stage_ignition_delay_seconds: 1, is_active: true, sort_order: 0, stage_1: defaultStage1, stage_2: defaultStage2, appearance: {} };
function NumberField({ name, label, suffix, min = 0, max, step }: { name: string | (string | number)[]; label: string; suffix?: string; min?: number; max?: number; step?: number }) {
return
;
@@ -33,6 +33,19 @@ function StageFields({ index }: { index: 1 | 2 }) {
);
}
+function AppearanceFields() {
+ return (
+
+
+
+
+
+
+
+
+ );
+}
+
export function Rockets() {
const [data, setData] = useState
([]);
const [loading, setLoading] = useState(false);
@@ -168,6 +181,7 @@ export function Rockets() {
{ key: 'mission', label: '发射与任务', children:
},
{ key: 'stage1', label: '一级参数', children: },
{ key: 'stage2', label: '二级参数', children: },
+ { key: 'appearance', label: '外观构型(可选)', children: },
]} />
diff --git a/scripts/deploy.sh b/scripts/deploy.sh
index ac3c42d..2d1a938 100755
--- a/scripts/deploy.sh
+++ b/scripts/deploy.sh
@@ -254,6 +254,11 @@ update_system() {
docker-compose cp scripts/upgrade_db.py backend:/app/scripts/upgrade_db.py
docker-compose exec -T backend python scripts/upgrade_db.py --apply
+ # Boot-time tasks (preset rockets, appearance backfill) ran before the new
+ # columns existed, so restart once to let them see the upgraded schema.
+ log "Restarting backend to apply boot-time data migrations..."
+ docker-compose restart backend
+
log "✓ System updated"
}