diff --git a/frontend/app/features/schedules/ArtifactList.tsx b/frontend/app/features/schedules/ArtifactList.tsx new file mode 100644 index 0000000..e931b64 --- /dev/null +++ b/frontend/app/features/schedules/ArtifactList.tsx @@ -0,0 +1,79 @@ +import { type ScheduleArtifact } from "../../services/api"; +import Icon from "../../components/common/Icon"; +import { shortHash } from "./utils"; + +export function ArtifactList({ + artifacts, + keyword, + onDrop, + onDoubleClick, + onContextMenu, + onKeywordChange, +}: { + artifacts: ScheduleArtifact[]; + keyword: string; + onDrop: (artifact: ScheduleArtifact, x: number, y: number) => void; + onDoubleClick: (artifact: ScheduleArtifact) => void; + onContextMenu: (event: React.MouseEvent, artifact: ScheduleArtifact) => void; + onKeywordChange: (keyword: string) => void; +}) { + const filtered = keyword.trim() + ? artifacts.filter((item) => ( + item.script_name.toLowerCase().includes(keyword.trim().toLowerCase()) + || item.version_label.toLowerCase().includes(keyword.trim().toLowerCase()) + )) + : artifacts; + + return ( +
+
+
稳定版本脚本{artifacts.length}
+
+ +

拖动卡片到画布,节点将保存 versions_id

+
+ {filtered.length ? filtered.map((artifact) => ( +
{ + event.dataTransfer.effectAllowed = "copy"; + event.dataTransfer.setData( + "application/x-model-platform-version", + artifact.versions_id, + ); + event.dataTransfer.setData("text/plain", artifact.versions_id); + }} + onContextMenu={(event) => onContextMenu(event, artifact)} + onDoubleClick={() => onDoubleClick(artifact)} + > + + + + + {artifact.script_name} + + {artifact.version_label} · {shortHash(artifact.content_hash)} + + +
+ )) : ( +

+ 暂无稳定版本,请先在"构建脚本"中发布 +

+ )} +
+
+ ); +} diff --git a/frontend/app/features/schedules/NodeInspector.tsx b/frontend/app/features/schedules/NodeInspector.tsx new file mode 100644 index 0000000..dc0d0c5 --- /dev/null +++ b/frontend/app/features/schedules/NodeInspector.tsx @@ -0,0 +1,153 @@ +import { type ScheduleNode } from "../../services/api"; +import Icon from "../../components/common/Icon"; +import { shortHash } from "./utils"; + +type NodeForm = { + nodeName: string; + timeoutSeconds: string; + retryCount: string; + retryIntervalSec: string; + argumentsJson: string; + envRefsJson: string; +}; + +export function NodeInspector({ + node, + form, + busy, + onChange, + onSave, + onDelete, +}: { + node: ScheduleNode; + form: NodeForm; + busy: boolean; + onChange: (form: NodeForm) => void; + onSave: () => void; + onDelete: () => void; +}) { + return ( +
+
+ + + +
+ 节点配置 + {node.node_key} +
+
+
+

稳定版本

+
+ {node.version.script_name} + {node.version.version_label} + versions_id: {node.versions_id} + SHA-256: {shortHash(node.version.content_hash)} +
+
+
+

节点信息

+ +
+ + +
+ +
+
+

运行参数

+