diff --git a/src/components/ModuleSwitcher.tsx b/src/components/ModuleSwitcher.tsx index 97d9452..7627777 100644 --- a/src/components/ModuleSwitcher.tsx +++ b/src/components/ModuleSwitcher.tsx @@ -3,7 +3,11 @@ import { Link, useLocation } from 'react-router-dom'; import { LayoutGrid, Home, Edit3, Activity, ChevronDown, Globe } from 'lucide-react'; import { motion, AnimatePresence } from 'motion/react'; -const ModuleSwitcher: React.FC = () => { +interface ModuleSwitcherProps { + variant?: 'light' | 'dark'; +} + +const ModuleSwitcher: React.FC = ({ variant = 'light' }) => { const [isOpen, setIsOpen] = useState(false); const location = useLocation(); @@ -20,11 +24,15 @@ const ModuleSwitcher: React.FC = () => {
diff --git a/src/pages/OmniEditor.tsx b/src/pages/OmniEditor.tsx index bf7452e..9787f4c 100644 --- a/src/pages/OmniEditor.tsx +++ b/src/pages/OmniEditor.tsx @@ -4,9 +4,13 @@ import { Bot, CheckCircle, ChevronDown, + Cloud, Database, + Download, Eye, Grid3X3, + HelpCircle, + History, Layers3, MessageSquare, PanelLeftClose, @@ -15,10 +19,13 @@ import { Plus, Send, Settings, + Share2, Sparkles, Table2, Terminal, Trash2, + Upload, + UserCircle, Workflow, X, Zap, @@ -28,15 +35,22 @@ import { useLocation } from 'react-router-dom'; import ModuleSwitcher from '../components/ModuleSwitcher'; import { useLanguage } from '../context/LanguageContext'; import { + buildRuntimeConfig, createDefaultWorkflow, + ensureValidationChecklist, getBehaviorSectionsForNode, + getInputOutputsForEdge, + getInputOutputsForNode, getNodeConnectionAnchor, + getNodeStatusFromValidation, getParametersForNode, + getValidationsForNode, InitialSpaceType, WorkflowEdge, WorkflowModel, WorkflowNode, WorkflowNodeKind, + WorkflowNodeStatus, WorkflowPortType, } from '../workflowModel'; @@ -59,6 +73,7 @@ const portColors: Record = { interface WorkflowCardProps { node: WorkflowNode; + status: WorkflowNodeStatus; selected: boolean; onSelect: (id: string) => void; onDragStart: (id: string, event: React.MouseEvent) => void; @@ -67,6 +82,7 @@ interface WorkflowCardProps { const WorkflowCard: React.FC = ({ node, + status, selected, onSelect, onDragStart, @@ -74,6 +90,18 @@ const WorkflowCard: React.FC = ({ }) => { const style = kindStyles[node.kind]; const Icon = style.icon; + const statusFrame = + status === 'error' + ? 'border-red-300 shadow-red-100' + : status === 'warning' + ? 'border-amber-300 shadow-amber-100' + : 'border-slate-200'; + const statusHeader = + status === 'error' + ? 'bg-red-50 border-red-100' + : status === 'warning' + ? 'bg-amber-50 border-amber-100' + : style.bg; return ( + + + + + + {[ + ['Share', Share2], + ['History', History], + ['Import', Upload], + ['Export', Download], + ].map(([label, Icon]) => { + const actionLabel = label as string; + return ( + -
- - {t('visa_connected')} - + ); + })} -
- {[ - ['Environment', 'Global model context'], - ['Space', 'Grid, network, continuous, GIS'], - ['Agents', 'Agent subjects and observation arrows'], - ['Attributes', 'Endogenous and exogenous variables'], - ['Behaviors', 'Inputs, calculation, outputs'], - ].map(([label, hint], index) => ( - - ))} -
+
+
@@ -484,6 +575,28 @@ const OmniEditor: React.FC = () => { : '当前默认收起 AI:先把右侧图形化模型编辑器作为主工作区。'}

+
+
Pipeline Nodes
+
+ {[ + ['Data Source', Database, 'Excel / raw data entry'], + ['Parameter Table', Table2, 'Model-ready parameters'], + ['Validation', CheckCircle, 'Rules and checks'], + ['Model Output', Layers3, 'Simulation outputs'], + ].map(([label, Icon, desc]) => ( + + ))} +
+
{messages.map((msg, index) => (
@@ -602,6 +715,7 @@ const OmniEditor: React.FC = () => { {
-