refactor: pipeline edit view

This commit is contained in:
xiaojunnuo
2022-10-26 09:02:47 +08:00
parent af919c2f6e
commit 370a28c10e
48 changed files with 1606 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
export * from "./pipeline";
@@ -0,0 +1,95 @@
export enum RunStrategy {
AlwaysRun,
SkipWhenSucceed,
}
export enum ConcurrencyStrategy {
Serial,
Parallel,
}
export enum NextStrategy {
AllSuccess,
OneSuccess,
}
export enum HandlerType {
//清空后续任务的状态
ClearFollowStatus,
SendEmail,
}
export type EventHandler = {
type: HandlerType;
params: {
[key: string]: any;
};
};
export type RunnableStrategy = {
runStrategy: RunStrategy;
onSuccess: EventHandler[];
onError: EventHandler[];
};
export type Step = Runnable & {
type: string; //插件类型
input: {
[key: string]: any;
};
};
export type Task = Runnable & {
steps: Step[];
};
export type Stage = Runnable & {
tasks: Task[];
concurrency: ConcurrencyStrategy;
next: NextStrategy;
};
export type Trigger = {
id: string;
title: string;
cron: string;
};
export type Runnable = {
id: string;
title: string;
status?: string;
lastTime?: number;
strategy?: RunnableStrategy;
};
export type Pipeline = Runnable & {
version: number;
stages: Stage[];
triggers: Trigger[];
};
export type Context = {
[key: string]: any;
};
export type Log = {
title: string;
time: number;
level: string;
text: string;
};
export type HistoryResult = {
title: string;
/**
* 任务状态
*/
status: string;
startTime: number;
endTime?: number;
/**
* 处理结果
*/
result?: string;
errorMessage?: string;
};