// ContainerEditor.tsx — 单容器完整编辑(基本/命令/环境变量/端口/资源/探针/生命周期/安全/卷挂载) // 作者: Logan import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { Switch } from '@/components/ui/switch'; import { Plus, Trash2, Cpu, Heart, FolderOpen, Terminal, Shield, Zap, Network, } from 'lucide-react'; import { arrToText, textToArr } from './container-utils'; import type { import { useTranslation } from 'react-i18next'; ContainerEditorProps, ProbeEditorProps, LifecycleHandlerEditorProps, BoolToggleProps, ProbeDef, LifecycleHandler, } from './types'; export function ContainerEditor({ container, onUpdate }: ContainerEditorProps) { const { t } = useTranslation(); const c = container; const sectionBtn = "flex items-center gap-1.5 text-xs font-semibold text-[var(--dg-text-secondary)] mb-2"; return ( <> {/* ---- 基本设置 ---- */}
onUpdate({ name: e.target.value })} placeholder="my-app" className="mt-1 dg-input font-mono text-xs h-8" />
onUpdate({ image: e.target.value })} placeholder="nginx:1.25" className="mt-1 dg-input font-mono text-xs h-8" />
onUpdate({ workingDir: e.target.value })} placeholder="/app" className="mt-1 dg-input font-mono text-xs h-8" />
{/* ---- 命令与参数 ---- */}