Enhance batch management functionality by adding node flow execution support and improving batch configuration creation. Introduce new API endpoint for retrieving node flows and update existing batch services to handle execution types. Update frontend components to support new scheduling options and node flow selection.

This commit is contained in:
DDD1542
2026-03-19 15:07:07 +09:00
parent 7f781b0177
commit 43cf91e748
41 changed files with 4020 additions and 3155 deletions

View File

@@ -1,80 +1,35 @@
"use client";
/**
* REST API 소스 노드
*/
import { memo } from "react";
import { Handle, Position, NodeProps } from "reactflow";
import { Globe, Lock } from "lucide-react";
import { NodeProps } from "reactflow";
import { Globe } from "lucide-react";
import { CompactNodeShell } from "./CompactNodeShell";
import type { RestAPISourceNodeData } from "@/types/node-editor";
const METHOD_COLORS: Record<string, string> = {
GET: "bg-emerald-100 text-emerald-700",
POST: "bg-primary/10 text-primary",
PUT: "bg-amber-100 text-yellow-700",
DELETE: "bg-destructive/10 text-destructive",
PATCH: "bg-purple-100 text-purple-700",
};
export const RestAPISourceNode = memo(({ data, selected }: NodeProps<RestAPISourceNodeData>) => {
const methodColor = METHOD_COLORS[data.method] || "bg-muted text-foreground";
const method = data.method || "GET";
const summary = data.url
? `${method} ${data.url}`
: "API URL을 입력해 주세요";
return (
<div
className={`min-w-[250px] rounded-lg border-2 bg-white shadow-md transition-all ${
selected ? "border-orange-500 shadow-lg" : "border-border"
}`}
<CompactNodeShell
color="#10B981"
label={data.displayName || "REST API"}
summary={summary}
icon={<Globe className="h-3.5 w-3.5" />}
selected={selected}
hasInput={false}
>
{/* 헤더 */}
<div className="flex items-center gap-2 rounded-t-lg bg-teal-600 px-3 py-2 text-white">
<Globe className="h-4 w-4" />
<div className="flex-1">
<div className="text-sm font-semibold">{data.displayName || "REST API"}</div>
<div className="text-xs opacity-80">{data.url || "URL 미설정"}</div>
{data.url && (
<div className="flex items-center gap-1.5">
<span className="rounded bg-emerald-500/20 px-1 py-0.5 font-mono text-[9px] font-semibold text-emerald-400">
{method}
</span>
<span className="break-all font-mono">{data.url}</span>
</div>
{data.authentication && <Lock className="h-4 w-4 opacity-70" />}
</div>
{/* 본문 */}
<div className="p-3">
{/* HTTP 메서드 */}
<div className="mb-2 flex items-center gap-2">
<span className={`rounded px-2 py-1 text-xs font-semibold ${methodColor}`}>{data.method}</span>
{data.timeout && <span className="text-xs text-muted-foreground">{data.timeout}ms</span>}
</div>
{/* 헤더 */}
{data.headers && Object.keys(data.headers).length > 0 && (
<div className="mb-2">
<div className="text-xs font-medium text-foreground">:</div>
<div className="mt-1 space-y-1">
{Object.entries(data.headers)
.slice(0, 2)
.map(([key, value]) => (
<div key={key} className="flex items-center gap-2 text-xs text-muted-foreground">
<span className="font-mono">{key}:</span>
<span className="truncate text-muted-foreground">{value}</span>
</div>
))}
{Object.keys(data.headers).length > 2 && (
<div className="text-xs text-muted-foreground/70">... {Object.keys(data.headers).length - 2}</div>
)}
</div>
</div>
)}
{/* 응답 매핑 */}
{data.responseMapping && (
<div className="rounded bg-teal-50 px-2 py-1 text-xs text-teal-700">
: <code className="font-mono">{data.responseMapping}</code>
</div>
)}
</div>
{/* 핸들 */}
<Handle type="source" position={Position.Right} className="!h-3 !w-3 !bg-teal-500" />
</div>
)}
</CompactNodeShell>
);
});