feat: node creation and serialization logic in workflow editor
This commit is contained in:
@@ -9,6 +9,7 @@ export abstract class BaseWorkflowNode extends ClassicPreset.Node {
|
||||
width = 280;
|
||||
height = 140;
|
||||
execStatus: 'idle' | 'running' | 'completed' | 'error' = 'idle';
|
||||
nodeType: string = '';
|
||||
|
||||
constructor(label: string) {
|
||||
super(label);
|
||||
|
||||
@@ -593,7 +593,9 @@ export const nodeRegistry: Record<string, NodeRegistryEntry> = {
|
||||
export function createNodeByType(type: string): BaseWorkflowNode | null {
|
||||
const entry = nodeRegistry[type];
|
||||
if (!entry) return null;
|
||||
return entry.factory();
|
||||
const node = entry.factory();
|
||||
node.nodeType = type;
|
||||
return node;
|
||||
}
|
||||
|
||||
export function getNodesByCategory(): Record<
|
||||
|
||||
Reference in New Issue
Block a user