@ucdjs/pipelines-ui 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +27 -0
- package/dist/components/detail/execution-result.d.mts +49 -0
- package/dist/components/detail/execution-result.mjs +366 -0
- package/dist/components/detail/version-selector.d.mts +21 -0
- package/dist/components/detail/version-selector.mjs +132 -0
- package/dist/components/graph/details.d.mts +14 -0
- package/dist/components/graph/details.mjs +369 -0
- package/dist/components/graph/filters.d.mts +14 -0
- package/dist/components/graph/filters.mjs +183 -0
- package/dist/components/graph/node-types.d.mts +10 -0
- package/dist/components/graph/node-types.mjs +13 -0
- package/dist/components/graph/nodes.d.mts +14 -0
- package/dist/components/graph/nodes.mjs +264 -0
- package/dist/components/graph/pipeline-graph.d.mts +15 -0
- package/dist/components/graph/pipeline-graph.mjs +241 -0
- package/dist/components/logs/execution-log-payload.d.mts +12 -0
- package/dist/components/logs/execution-log-payload.mjs +79 -0
- package/dist/components/logs/execution-log-table.d.mts +16 -0
- package/dist/components/logs/execution-log-table.mjs +121 -0
- package/dist/components/logs/execution-span-drawer.d.mts +16 -0
- package/dist/components/logs/execution-span-drawer.mjs +208 -0
- package/dist/components/logs/execution-waterfall.d.mts +18 -0
- package/dist/components/logs/execution-waterfall.mjs +354 -0
- package/dist/components/pipeline-sidebar.d.mts +6 -0
- package/dist/components/pipeline-sidebar.mjs +190 -0
- package/dist/components/status-badge.d.mts +11 -0
- package/dist/components/status-badge.mjs +50 -0
- package/dist/components/status-icon.d.mts +11 -0
- package/dist/components/status-icon.mjs +46 -0
- package/dist/hooks/index.d.mts +7 -0
- package/dist/hooks/index.mjs +8 -0
- package/dist/hooks/use-event-view.d.mts +19 -0
- package/dist/hooks/use-event-view.mjs +112 -0
- package/dist/hooks/use-execute.d.mts +20 -0
- package/dist/hooks/use-execute.mjs +68 -0
- package/dist/hooks/use-pipeline-file.d.mts +20 -0
- package/dist/hooks/use-pipeline-file.mjs +39 -0
- package/dist/hooks/use-pipeline-versions.d.mts +10 -0
- package/dist/hooks/use-pipeline-versions.mjs +137 -0
- package/dist/hooks/use-pipeline.d.mts +21 -0
- package/dist/hooks/use-pipeline.mjs +46 -0
- package/dist/hooks/use-pipelines.d.mts +26 -0
- package/dist/hooks/use-pipelines.mjs +38 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.mjs +29 -0
- package/dist/lib/adapter.d.mts +26 -0
- package/dist/lib/adapter.mjs +74 -0
- package/dist/lib/colors.d.mts +7 -0
- package/dist/lib/colors.mjs +15 -0
- package/dist/lib/execution-logs.d.mts +19 -0
- package/dist/lib/execution-logs.mjs +74 -0
- package/dist/lib/format-time.d.mts +4 -0
- package/dist/lib/format-time.mjs +7 -0
- package/dist/lib/index.d.mts +5 -0
- package/dist/lib/index.mjs +6 -0
- package/dist/lib/layout.d.mts +8 -0
- package/dist/lib/layout.mjs +71 -0
- package/dist/lib/pipeline-utils.d.mts +9 -0
- package/dist/lib/pipeline-utils.mjs +49 -0
- package/dist/lib/utils.d.mts +6 -0
- package/dist/lib/utils.mjs +10 -0
- package/dist/styles/globals.css +3 -0
- package/dist/types.d.mts +143 -0
- package/package.json +95 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.mjs";
|
|
2
|
+
import { formatDuration } from "../../lib/execution-logs.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/logs/execution-waterfall.tsx
|
|
8
|
+
const phaseOptions = [
|
|
9
|
+
"Pipeline",
|
|
10
|
+
"Version",
|
|
11
|
+
"Parse",
|
|
12
|
+
"Resolve",
|
|
13
|
+
"Artifact",
|
|
14
|
+
"File",
|
|
15
|
+
"Cache",
|
|
16
|
+
"Error"
|
|
17
|
+
];
|
|
18
|
+
const phaseLabels = {
|
|
19
|
+
Pipeline: "Pipeline",
|
|
20
|
+
Version: "Version",
|
|
21
|
+
Parse: "Parse",
|
|
22
|
+
Resolve: "Resolve",
|
|
23
|
+
Artifact: "Artifact",
|
|
24
|
+
File: "File",
|
|
25
|
+
Cache: "Cache",
|
|
26
|
+
Error: "Error"
|
|
27
|
+
};
|
|
28
|
+
function getPhaseColor(phase) {
|
|
29
|
+
switch (phase) {
|
|
30
|
+
case "Pipeline": return "bg-sky-400/70";
|
|
31
|
+
case "Version": return "bg-emerald-400/70";
|
|
32
|
+
case "Parse": return "bg-amber-400/70";
|
|
33
|
+
case "Resolve": return "bg-violet-400/70";
|
|
34
|
+
case "Artifact": return "bg-rose-400/70";
|
|
35
|
+
case "File": return "bg-cyan-400/70";
|
|
36
|
+
case "Cache": return "bg-lime-400/70";
|
|
37
|
+
case "Error": return "bg-red-500/80";
|
|
38
|
+
default: return "bg-slate-400/70";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function formatTickLabel(valueMs) {
|
|
42
|
+
if (valueMs <= 0) return "0ms";
|
|
43
|
+
if (valueMs < 1) return "<1ms";
|
|
44
|
+
return formatDuration(valueMs);
|
|
45
|
+
}
|
|
46
|
+
function buildTicks(durationMs, count = 6) {
|
|
47
|
+
if (durationMs <= 0) return [0];
|
|
48
|
+
if (count < 2) return [0, durationMs];
|
|
49
|
+
const step = durationMs / (count - 1);
|
|
50
|
+
return Array.from({ length: count }, (_, index) => index * step);
|
|
51
|
+
}
|
|
52
|
+
function ExecutionWaterfall(t0) {
|
|
53
|
+
const $ = c(65);
|
|
54
|
+
const { spans, selectedSpanId, onSelect, onSpanClick } = t0;
|
|
55
|
+
const hasSpans = spans.length > 0;
|
|
56
|
+
const [activePhases, setActivePhases] = useState(_temp);
|
|
57
|
+
let t1;
|
|
58
|
+
if ($[0] !== hasSpans || $[1] !== spans) {
|
|
59
|
+
t1 = hasSpans ? Math.min(...spans.map(_temp2)) : 0;
|
|
60
|
+
$[0] = hasSpans;
|
|
61
|
+
$[1] = spans;
|
|
62
|
+
$[2] = t1;
|
|
63
|
+
} else t1 = $[2];
|
|
64
|
+
const start = t1;
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[3] !== hasSpans || $[4] !== spans) {
|
|
67
|
+
t2 = hasSpans ? Math.max(...spans.map(_temp3)) : 0;
|
|
68
|
+
$[3] = hasSpans;
|
|
69
|
+
$[4] = spans;
|
|
70
|
+
$[5] = t2;
|
|
71
|
+
} else t2 = $[5];
|
|
72
|
+
const end = t2;
|
|
73
|
+
const duration = Math.max(end - start, 1);
|
|
74
|
+
let t10;
|
|
75
|
+
let t11;
|
|
76
|
+
let t3;
|
|
77
|
+
let t4;
|
|
78
|
+
let t5;
|
|
79
|
+
let t6;
|
|
80
|
+
let t7;
|
|
81
|
+
let t8;
|
|
82
|
+
let t9;
|
|
83
|
+
if ($[6] !== activePhases || $[7] !== duration || $[8] !== hasSpans || $[9] !== onSelect || $[10] !== onSpanClick || $[11] !== selectedSpanId || $[12] !== spans || $[13] !== start) {
|
|
84
|
+
let t12;
|
|
85
|
+
if ($[23] !== activePhases) {
|
|
86
|
+
t12 = (span) => activePhases.has(span.phase);
|
|
87
|
+
$[23] = activePhases;
|
|
88
|
+
$[24] = t12;
|
|
89
|
+
} else t12 = $[24];
|
|
90
|
+
const sortedSpans = [...spans.filter(t12)].sort(_temp4);
|
|
91
|
+
const ticks = buildTicks(duration, 6);
|
|
92
|
+
t10 = "border border-border rounded-lg bg-card/40";
|
|
93
|
+
let t13;
|
|
94
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
95
|
+
t13 = /* @__PURE__ */ jsx("h3", {
|
|
96
|
+
className: "text-xs font-semibold",
|
|
97
|
+
children: "Execution Timeline"
|
|
98
|
+
});
|
|
99
|
+
$[25] = t13;
|
|
100
|
+
} else t13 = $[25];
|
|
101
|
+
const t14 = spans.length;
|
|
102
|
+
let t15;
|
|
103
|
+
if ($[26] !== duration) {
|
|
104
|
+
t15 = formatDuration(duration);
|
|
105
|
+
$[26] = duration;
|
|
106
|
+
$[27] = t15;
|
|
107
|
+
} else t15 = $[27];
|
|
108
|
+
let t16;
|
|
109
|
+
if ($[28] !== spans.length || $[29] !== t15) {
|
|
110
|
+
t16 = /* @__PURE__ */ jsxs("div", { children: [t13, /* @__PURE__ */ jsxs("p", {
|
|
111
|
+
className: "text-[11px] text-muted-foreground",
|
|
112
|
+
children: [
|
|
113
|
+
t14,
|
|
114
|
+
" ",
|
|
115
|
+
"spans ·",
|
|
116
|
+
" ",
|
|
117
|
+
t15
|
|
118
|
+
]
|
|
119
|
+
})] });
|
|
120
|
+
$[28] = spans.length;
|
|
121
|
+
$[29] = t15;
|
|
122
|
+
$[30] = t16;
|
|
123
|
+
} else t16 = $[30];
|
|
124
|
+
let t17;
|
|
125
|
+
if ($[31] !== onSelect) {
|
|
126
|
+
t17 = /* @__PURE__ */ jsx("button", {
|
|
127
|
+
type: "button",
|
|
128
|
+
className: "text-xs text-muted-foreground hover:text-foreground",
|
|
129
|
+
onClick: () => onSelect(null),
|
|
130
|
+
children: "Clear filter"
|
|
131
|
+
});
|
|
132
|
+
$[31] = onSelect;
|
|
133
|
+
$[32] = t17;
|
|
134
|
+
} else t17 = $[32];
|
|
135
|
+
if ($[33] !== t16 || $[34] !== t17) {
|
|
136
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
137
|
+
className: "flex items-center justify-between px-3 py-1.5 border-b border-border",
|
|
138
|
+
children: [t16, t17]
|
|
139
|
+
});
|
|
140
|
+
$[33] = t16;
|
|
141
|
+
$[34] = t17;
|
|
142
|
+
$[35] = t11;
|
|
143
|
+
} else t11 = $[35];
|
|
144
|
+
t8 = "p-2";
|
|
145
|
+
const t18 = hasSpans && "hidden";
|
|
146
|
+
let t19;
|
|
147
|
+
if ($[36] !== t18) {
|
|
148
|
+
t19 = cn("border border-dashed border-border rounded-lg p-4 text-xs text-muted-foreground", t18);
|
|
149
|
+
$[36] = t18;
|
|
150
|
+
$[37] = t19;
|
|
151
|
+
} else t19 = $[37];
|
|
152
|
+
if ($[38] !== t19) {
|
|
153
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
154
|
+
className: t19,
|
|
155
|
+
children: "No spans recorded for this execution."
|
|
156
|
+
});
|
|
157
|
+
$[38] = t19;
|
|
158
|
+
$[39] = t9;
|
|
159
|
+
} else t9 = $[39];
|
|
160
|
+
const t20 = !hasSpans && "hidden";
|
|
161
|
+
if ($[40] !== t20) {
|
|
162
|
+
t5 = cn(t20);
|
|
163
|
+
$[40] = t20;
|
|
164
|
+
$[41] = t5;
|
|
165
|
+
} else t5 = $[41];
|
|
166
|
+
let t21;
|
|
167
|
+
if ($[42] !== activePhases) {
|
|
168
|
+
t21 = phaseOptions.map((phase) => {
|
|
169
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
170
|
+
type: "button",
|
|
171
|
+
onClick: () => {
|
|
172
|
+
setActivePhases((current) => {
|
|
173
|
+
const next = new Set(current);
|
|
174
|
+
if (next.has(phase)) next.delete(phase);
|
|
175
|
+
else next.add(phase);
|
|
176
|
+
return next.size === 0 ? current : next;
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
className: cn("inline-flex items-center gap-2 rounded-full border px-2 py-1 text-[10px] uppercase tracking-wide", activePhases.has(phase) ? "border-border text-foreground" : "border-border/40 text-muted-foreground/70"),
|
|
180
|
+
children: [/* @__PURE__ */ jsx("span", { className: cn("h-2 w-2 rounded-full", getPhaseColor(phase)) }), phaseLabels[phase]]
|
|
181
|
+
}, phase);
|
|
182
|
+
});
|
|
183
|
+
$[42] = activePhases;
|
|
184
|
+
$[43] = t21;
|
|
185
|
+
} else t21 = $[43];
|
|
186
|
+
if ($[44] !== t21) {
|
|
187
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
188
|
+
className: "flex flex-wrap gap-2 pb-1 -mt-1",
|
|
189
|
+
children: t21
|
|
190
|
+
});
|
|
191
|
+
$[44] = t21;
|
|
192
|
+
$[45] = t6;
|
|
193
|
+
} else t6 = $[45];
|
|
194
|
+
let t22;
|
|
195
|
+
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
196
|
+
t22 = /* @__PURE__ */ jsx("div", {
|
|
197
|
+
className: "uppercase tracking-wide",
|
|
198
|
+
children: "Name"
|
|
199
|
+
});
|
|
200
|
+
$[46] = t22;
|
|
201
|
+
} else t22 = $[46];
|
|
202
|
+
let t23;
|
|
203
|
+
if ($[47] !== duration) {
|
|
204
|
+
t23 = (tick) => {
|
|
205
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
206
|
+
className: "absolute top-0 bottom-0",
|
|
207
|
+
style: { left: `${tick / duration * 100}%` },
|
|
208
|
+
children: [/* @__PURE__ */ jsx("div", { className: "h-full w-px bg-border/60" }), /* @__PURE__ */ jsx("div", {
|
|
209
|
+
className: "absolute -top-4 -translate-x-1/2 text-[10px]",
|
|
210
|
+
children: formatTickLabel(tick)
|
|
211
|
+
})]
|
|
212
|
+
}, tick);
|
|
213
|
+
};
|
|
214
|
+
$[47] = duration;
|
|
215
|
+
$[48] = t23;
|
|
216
|
+
} else t23 = $[48];
|
|
217
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
218
|
+
className: "grid grid-cols-[250px_minmax(0,1fr)] items-center text-[11px] text-muted-foreground pb-2 pt-4",
|
|
219
|
+
children: [t22, /* @__PURE__ */ jsx("div", {
|
|
220
|
+
className: "relative h-4 min-w-0",
|
|
221
|
+
children: ticks.map(t23)
|
|
222
|
+
})]
|
|
223
|
+
});
|
|
224
|
+
t3 = "space-y-1";
|
|
225
|
+
t4 = sortedSpans.map((span_0, index) => {
|
|
226
|
+
const left_0 = Math.min((span_0.start - start) / duration * 100, 100);
|
|
227
|
+
const width = Math.max((span_0.end - span_0.start) / duration * 100, 1.5);
|
|
228
|
+
const clampedWidth = Math.min(width, 100 - left_0);
|
|
229
|
+
const isSelected = selectedSpanId === span_0.spanId;
|
|
230
|
+
const phaseColor = span_0.isError ? "bg-red-500/80" : getPhaseColor(span_0.phase);
|
|
231
|
+
const spanKey = `${span_0.spanId}-${span_0.start}-${span_0.end}-${span_0.phase}-${index}`;
|
|
232
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
233
|
+
className: "grid grid-cols-[250px_minmax(0,1fr)] items-center",
|
|
234
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
235
|
+
className: "text-xs text-muted-foreground truncate pr-3",
|
|
236
|
+
title: span_0.label,
|
|
237
|
+
children: span_0.label
|
|
238
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
239
|
+
className: "relative h-6 rounded-sm bg-muted/40 min-w-0 overflow-hidden",
|
|
240
|
+
children: [ticks.map((tick_0) => {
|
|
241
|
+
return /* @__PURE__ */ jsx("span", {
|
|
242
|
+
className: "absolute top-0 bottom-0 w-px bg-border/40",
|
|
243
|
+
style: { left: `${tick_0 / duration * 100}%` }
|
|
244
|
+
}, `${spanKey}-tick-${tick_0}`);
|
|
245
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
onClick: () => {
|
|
248
|
+
onSelect(span_0.spanId);
|
|
249
|
+
onSpanClick?.(span_0);
|
|
250
|
+
},
|
|
251
|
+
className: cn("absolute top-1 h-4 rounded-sm text-[10px] font-medium text-white/90 px-1 truncate", phaseColor, isSelected && "ring-2 ring-offset-1 ring-primary"),
|
|
252
|
+
style: {
|
|
253
|
+
left: `${Math.min(left_0, 98)}%`,
|
|
254
|
+
width: `${clampedWidth}%`
|
|
255
|
+
},
|
|
256
|
+
title: `${span_0.label} · ${formatDuration(span_0.durationMs)}`,
|
|
257
|
+
children: formatDuration(span_0.durationMs)
|
|
258
|
+
})]
|
|
259
|
+
})]
|
|
260
|
+
}, spanKey);
|
|
261
|
+
});
|
|
262
|
+
$[6] = activePhases;
|
|
263
|
+
$[7] = duration;
|
|
264
|
+
$[8] = hasSpans;
|
|
265
|
+
$[9] = onSelect;
|
|
266
|
+
$[10] = onSpanClick;
|
|
267
|
+
$[11] = selectedSpanId;
|
|
268
|
+
$[12] = spans;
|
|
269
|
+
$[13] = start;
|
|
270
|
+
$[14] = t10;
|
|
271
|
+
$[15] = t11;
|
|
272
|
+
$[16] = t3;
|
|
273
|
+
$[17] = t4;
|
|
274
|
+
$[18] = t5;
|
|
275
|
+
$[19] = t6;
|
|
276
|
+
$[20] = t7;
|
|
277
|
+
$[21] = t8;
|
|
278
|
+
$[22] = t9;
|
|
279
|
+
} else {
|
|
280
|
+
t10 = $[14];
|
|
281
|
+
t11 = $[15];
|
|
282
|
+
t3 = $[16];
|
|
283
|
+
t4 = $[17];
|
|
284
|
+
t5 = $[18];
|
|
285
|
+
t6 = $[19];
|
|
286
|
+
t7 = $[20];
|
|
287
|
+
t8 = $[21];
|
|
288
|
+
t9 = $[22];
|
|
289
|
+
}
|
|
290
|
+
let t12;
|
|
291
|
+
if ($[49] !== t3 || $[50] !== t4) {
|
|
292
|
+
t12 = /* @__PURE__ */ jsx("div", {
|
|
293
|
+
className: t3,
|
|
294
|
+
children: t4
|
|
295
|
+
});
|
|
296
|
+
$[49] = t3;
|
|
297
|
+
$[50] = t4;
|
|
298
|
+
$[51] = t12;
|
|
299
|
+
} else t12 = $[51];
|
|
300
|
+
let t13;
|
|
301
|
+
if ($[52] !== t12 || $[53] !== t5 || $[54] !== t6 || $[55] !== t7) {
|
|
302
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
303
|
+
className: t5,
|
|
304
|
+
children: [
|
|
305
|
+
t6,
|
|
306
|
+
t7,
|
|
307
|
+
t12
|
|
308
|
+
]
|
|
309
|
+
});
|
|
310
|
+
$[52] = t12;
|
|
311
|
+
$[53] = t5;
|
|
312
|
+
$[54] = t6;
|
|
313
|
+
$[55] = t7;
|
|
314
|
+
$[56] = t13;
|
|
315
|
+
} else t13 = $[56];
|
|
316
|
+
let t14;
|
|
317
|
+
if ($[57] !== t13 || $[58] !== t8 || $[59] !== t9) {
|
|
318
|
+
t14 = /* @__PURE__ */ jsxs("div", {
|
|
319
|
+
className: t8,
|
|
320
|
+
children: [t9, t13]
|
|
321
|
+
});
|
|
322
|
+
$[57] = t13;
|
|
323
|
+
$[58] = t8;
|
|
324
|
+
$[59] = t9;
|
|
325
|
+
$[60] = t14;
|
|
326
|
+
} else t14 = $[60];
|
|
327
|
+
let t15;
|
|
328
|
+
if ($[61] !== t10 || $[62] !== t11 || $[63] !== t14) {
|
|
329
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
330
|
+
className: t10,
|
|
331
|
+
children: [t11, t14]
|
|
332
|
+
});
|
|
333
|
+
$[61] = t10;
|
|
334
|
+
$[62] = t11;
|
|
335
|
+
$[63] = t14;
|
|
336
|
+
$[64] = t15;
|
|
337
|
+
} else t15 = $[64];
|
|
338
|
+
return t15;
|
|
339
|
+
}
|
|
340
|
+
function _temp4(a, b) {
|
|
341
|
+
return a.start - b.start;
|
|
342
|
+
}
|
|
343
|
+
function _temp3(s_0) {
|
|
344
|
+
return s_0.end;
|
|
345
|
+
}
|
|
346
|
+
function _temp2(s) {
|
|
347
|
+
return s.start;
|
|
348
|
+
}
|
|
349
|
+
function _temp() {
|
|
350
|
+
return new Set(phaseOptions);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
//#endregion
|
|
354
|
+
export { ExecutionWaterfall };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import { usePipelines } from "../hooks/use-pipelines.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Link, useParams } from "@tanstack/react-router";
|
|
7
|
+
import { ThemeToggle } from "@ucdjs-internal/shared-ui/components/theme-toggle";
|
|
8
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem } from "@ucdjs-internal/shared-ui/ui/sidebar";
|
|
9
|
+
import { BookOpen, ExternalLink, Folder, FolderOpen } from "lucide-react";
|
|
10
|
+
|
|
11
|
+
//#region src/components/pipeline-sidebar.tsx
|
|
12
|
+
function PipelineSidebar() {
|
|
13
|
+
const $ = c(24);
|
|
14
|
+
const { data, loading } = usePipelines();
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
17
|
+
t0 = { strict: false };
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
} else t0 = $[0];
|
|
20
|
+
const params = useParams(t0);
|
|
21
|
+
const currentPipelineId = typeof params.id === "string" ? params.id : void 0;
|
|
22
|
+
const currentFileSlug = typeof params.file === "string" ? params.file : void 0;
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t1 = {};
|
|
26
|
+
$[1] = t1;
|
|
27
|
+
} else t1 = $[1];
|
|
28
|
+
const [openFiles, setOpenFiles] = useState(t1);
|
|
29
|
+
data?.files;
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[2] !== data?.files) {
|
|
32
|
+
t2 = data?.files ?? [];
|
|
33
|
+
$[2] = data?.files;
|
|
34
|
+
$[3] = t2;
|
|
35
|
+
} else t2 = $[3];
|
|
36
|
+
const files = t2;
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
39
|
+
t3 = (fileId) => {
|
|
40
|
+
setOpenFiles((prev) => ({
|
|
41
|
+
...prev,
|
|
42
|
+
[fileId]: !prev[fileId]
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
$[4] = t3;
|
|
46
|
+
} else t3 = $[4];
|
|
47
|
+
const toggleFile = t3;
|
|
48
|
+
let t4;
|
|
49
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t4 = /* @__PURE__ */ jsx(SidebarHeader, {
|
|
51
|
+
className: "p-4",
|
|
52
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
53
|
+
className: "flex items-center justify-between gap-3",
|
|
54
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: "min-w-0",
|
|
56
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
57
|
+
className: "text-sm font-semibold text-sidebar-foreground tracking-tight truncate",
|
|
58
|
+
children: "UCD Pipelines"
|
|
59
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
60
|
+
className: "text-[10px] text-muted-foreground truncate",
|
|
61
|
+
children: "Pipeline files"
|
|
62
|
+
})]
|
|
63
|
+
}), /* @__PURE__ */ jsx(ThemeToggle, {})]
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
$[5] = t4;
|
|
67
|
+
} else t4 = $[5];
|
|
68
|
+
let t5;
|
|
69
|
+
if ($[6] !== currentFileSlug || $[7] !== currentPipelineId || $[8] !== files || $[9] !== loading || $[10] !== openFiles) {
|
|
70
|
+
t5 = loading ? /* @__PURE__ */ jsx("div", {
|
|
71
|
+
className: "px-2 py-2 text-xs text-muted-foreground",
|
|
72
|
+
children: "Loading..."
|
|
73
|
+
}) : files.map((file) => {
|
|
74
|
+
const isFileActive = currentFileSlug === file.fileId;
|
|
75
|
+
const isOpen = openFiles[file.fileId] ?? isFileActive;
|
|
76
|
+
const fileName = file.fileLabel ?? file.filePath.split("/").pop() ?? file.filePath;
|
|
77
|
+
return /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [/* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
78
|
+
isActive: isFileActive,
|
|
79
|
+
className: "w-full justify-start gap-2",
|
|
80
|
+
onClick: (event) => {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
toggleFile(file.fileId);
|
|
83
|
+
},
|
|
84
|
+
render: /* @__PURE__ */ jsxs(Link, {
|
|
85
|
+
to: "/pipelines/$file",
|
|
86
|
+
params: { file: file.fileId },
|
|
87
|
+
children: [
|
|
88
|
+
isOpen ? /* @__PURE__ */ jsx(FolderOpen, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Folder, { className: "h-4 w-4" }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: "truncate flex-1",
|
|
91
|
+
children: fileName
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: "text-[10px] text-muted-foreground",
|
|
95
|
+
children: file.pipelines.length
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
}), isOpen && /* @__PURE__ */ jsx(SidebarMenuSub, { children: file.pipelines.map((pipeline) => {
|
|
100
|
+
return /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(SidebarMenuSubButton, {
|
|
101
|
+
isActive: currentPipelineId === pipeline.id && currentFileSlug === file.fileId,
|
|
102
|
+
render: /* @__PURE__ */ jsxs(Link, {
|
|
103
|
+
to: "/pipelines/$file/$id",
|
|
104
|
+
params: {
|
|
105
|
+
file: file.fileId,
|
|
106
|
+
id: pipeline.id
|
|
107
|
+
},
|
|
108
|
+
children: [/* @__PURE__ */ jsx("div", { className: cn("w-2 h-2 rounded-full shrink-0", pipeline.sourceId.startsWith("github-") && "bg-blue-500", pipeline.sourceId.startsWith("gitlab-") && "bg-orange-500", !pipeline.sourceId.startsWith("github-") && !pipeline.sourceId.startsWith("gitlab-") && "bg-emerald-500") }), /* @__PURE__ */ jsx("span", {
|
|
109
|
+
className: "truncate flex-1",
|
|
110
|
+
children: pipeline.name || pipeline.id
|
|
111
|
+
})]
|
|
112
|
+
})
|
|
113
|
+
}) }, `${file.fileId}-${pipeline.id}`);
|
|
114
|
+
}) })] }, file.fileId);
|
|
115
|
+
});
|
|
116
|
+
$[6] = currentFileSlug;
|
|
117
|
+
$[7] = currentPipelineId;
|
|
118
|
+
$[8] = files;
|
|
119
|
+
$[9] = loading;
|
|
120
|
+
$[10] = openFiles;
|
|
121
|
+
$[11] = t5;
|
|
122
|
+
} else t5 = $[11];
|
|
123
|
+
let t6;
|
|
124
|
+
if ($[12] !== t5) {
|
|
125
|
+
t6 = /* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: t5 }) }) });
|
|
126
|
+
$[12] = t5;
|
|
127
|
+
$[13] = t6;
|
|
128
|
+
} else t6 = $[13];
|
|
129
|
+
let t7;
|
|
130
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
131
|
+
t7 = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Documentation" });
|
|
132
|
+
$[14] = t7;
|
|
133
|
+
} else t7 = $[14];
|
|
134
|
+
let t8;
|
|
135
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
136
|
+
t8 = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, { render: /* @__PURE__ */ jsxs("a", {
|
|
137
|
+
href: "https://docs.ucdjs.dev/pipelines",
|
|
138
|
+
children: [/* @__PURE__ */ jsx(BookOpen, { className: "size-4" }), /* @__PURE__ */ jsx("span", { children: "Getting Started" })]
|
|
139
|
+
}) }) });
|
|
140
|
+
$[15] = t8;
|
|
141
|
+
} else t8 = $[15];
|
|
142
|
+
let t9;
|
|
143
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
144
|
+
t9 = /* @__PURE__ */ jsxs(SidebarGroup, { children: [t7, /* @__PURE__ */ jsxs(SidebarMenu, { children: [t8, /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, { render: /* @__PURE__ */ jsxs("a", {
|
|
145
|
+
href: "https://docs.ucdjs.dev/pipelines/api",
|
|
146
|
+
target: "_blank",
|
|
147
|
+
rel: "noopener noreferrer",
|
|
148
|
+
children: [/* @__PURE__ */ jsx(ExternalLink, { className: "size-4" }), /* @__PURE__ */ jsx("span", { children: "API Reference" })]
|
|
149
|
+
}) }) })] })] });
|
|
150
|
+
$[16] = t9;
|
|
151
|
+
} else t9 = $[16];
|
|
152
|
+
let t10;
|
|
153
|
+
if ($[17] !== data?.errors) {
|
|
154
|
+
t10 = (data?.errors?.length || 0) > 0 && /* @__PURE__ */ jsx("div", {
|
|
155
|
+
className: "px-2 py-1.5",
|
|
156
|
+
children: /* @__PURE__ */ jsxs("p", {
|
|
157
|
+
className: "text-xs text-destructive font-medium",
|
|
158
|
+
children: [
|
|
159
|
+
data?.errors.length,
|
|
160
|
+
" ",
|
|
161
|
+
"error",
|
|
162
|
+
data?.errors.length !== 1 ? "s" : ""
|
|
163
|
+
]
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
$[17] = data?.errors;
|
|
167
|
+
$[18] = t10;
|
|
168
|
+
} else t10 = $[18];
|
|
169
|
+
let t11;
|
|
170
|
+
if ($[19] !== t10) {
|
|
171
|
+
t11 = /* @__PURE__ */ jsxs(SidebarFooter, { children: [t9, t10] });
|
|
172
|
+
$[19] = t10;
|
|
173
|
+
$[20] = t11;
|
|
174
|
+
} else t11 = $[20];
|
|
175
|
+
let t12;
|
|
176
|
+
if ($[21] !== t11 || $[22] !== t6) {
|
|
177
|
+
t12 = /* @__PURE__ */ jsxs(Sidebar, { children: [
|
|
178
|
+
t4,
|
|
179
|
+
t6,
|
|
180
|
+
t11
|
|
181
|
+
] });
|
|
182
|
+
$[21] = t11;
|
|
183
|
+
$[22] = t6;
|
|
184
|
+
$[23] = t12;
|
|
185
|
+
} else t12 = $[23];
|
|
186
|
+
return t12;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
export { PipelineSidebar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ExecutionStatus } from "@ucdjs/pipelines-executor";
|
|
3
|
+
|
|
4
|
+
//#region src/components/status-badge.d.ts
|
|
5
|
+
declare function StatusBadge({
|
|
6
|
+
status
|
|
7
|
+
}: {
|
|
8
|
+
status: ExecutionStatus;
|
|
9
|
+
}): react.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { StatusBadge };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Badge } from "@ucdjs-internal/shared-ui/ui/badge";
|
|
4
|
+
|
|
5
|
+
//#region src/components/status-badge.tsx
|
|
6
|
+
function StatusBadge(t0) {
|
|
7
|
+
const $ = c(3);
|
|
8
|
+
const { status } = t0;
|
|
9
|
+
switch (status) {
|
|
10
|
+
case "completed": {
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx(Badge, {
|
|
14
|
+
variant: "outline",
|
|
15
|
+
className: "bg-green-50 text-green-700 border-green-200 text-xs",
|
|
16
|
+
children: "Success"
|
|
17
|
+
});
|
|
18
|
+
$[0] = t1;
|
|
19
|
+
} else t1 = $[0];
|
|
20
|
+
return t1;
|
|
21
|
+
}
|
|
22
|
+
case "failed": {
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t1 = /* @__PURE__ */ jsx(Badge, {
|
|
26
|
+
variant: "outline",
|
|
27
|
+
className: "bg-red-50 text-red-700 border-red-200 text-xs",
|
|
28
|
+
children: "Failed"
|
|
29
|
+
});
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else t1 = $[1];
|
|
32
|
+
return t1;
|
|
33
|
+
}
|
|
34
|
+
case "running": {
|
|
35
|
+
let t1;
|
|
36
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
37
|
+
t1 = /* @__PURE__ */ jsx(Badge, {
|
|
38
|
+
variant: "outline",
|
|
39
|
+
className: "bg-yellow-50 text-yellow-700 border-yellow-200 text-xs",
|
|
40
|
+
children: "Running"
|
|
41
|
+
});
|
|
42
|
+
$[2] = t1;
|
|
43
|
+
} else t1 = $[2];
|
|
44
|
+
return t1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { StatusBadge };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from "react";
|
|
2
|
+
import { ExecutionStatus } from "@ucdjs/pipelines-executor";
|
|
3
|
+
|
|
4
|
+
//#region src/components/status-icon.d.ts
|
|
5
|
+
declare function StatusIcon({
|
|
6
|
+
status
|
|
7
|
+
}: {
|
|
8
|
+
status: ExecutionStatus;
|
|
9
|
+
}): react.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { StatusIcon };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CheckCircle2, Clock, XCircle } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/status-icon.tsx
|
|
6
|
+
function StatusIcon(t0) {
|
|
7
|
+
const $ = c(4);
|
|
8
|
+
const { status } = t0;
|
|
9
|
+
switch (status) {
|
|
10
|
+
case "completed": {
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx(CheckCircle2, { className: "h-4 w-4 text-green-500" });
|
|
14
|
+
$[0] = t1;
|
|
15
|
+
} else t1 = $[0];
|
|
16
|
+
return t1;
|
|
17
|
+
}
|
|
18
|
+
case "failed": {
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
21
|
+
t1 = /* @__PURE__ */ jsx(XCircle, { className: "h-4 w-4 text-red-500" });
|
|
22
|
+
$[1] = t1;
|
|
23
|
+
} else t1 = $[1];
|
|
24
|
+
return t1;
|
|
25
|
+
}
|
|
26
|
+
case "running": {
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
29
|
+
t1 = /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4 text-yellow-500 animate-pulse" });
|
|
30
|
+
$[2] = t1;
|
|
31
|
+
} else t1 = $[2];
|
|
32
|
+
return t1;
|
|
33
|
+
}
|
|
34
|
+
default: {
|
|
35
|
+
let t1;
|
|
36
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
37
|
+
t1 = /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4 text-gray-400" });
|
|
38
|
+
$[3] = t1;
|
|
39
|
+
} else t1 = $[3];
|
|
40
|
+
return t1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { StatusIcon };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EventViewActions, EventViewState, useEventView } from "./use-event-view.mjs";
|
|
2
|
+
import { UseExecuteOptions, UseExecuteReturn, useExecute } from "./use-execute.mjs";
|
|
3
|
+
import { UsePipelineOptions, UsePipelineReturn, usePipeline } from "./use-pipeline.mjs";
|
|
4
|
+
import { PipelineFileResponse, UsePipelineFileOptions, UsePipelineFileReturn, usePipelineFile } from "./use-pipeline-file.mjs";
|
|
5
|
+
import { UsePipelineVersionsReturn, usePipelineVersions } from "./use-pipeline-versions.mjs";
|
|
6
|
+
import { UsePipelinesOptions, UsePipelinesReturn, usePipelines } from "./use-pipelines.mjs";
|
|
7
|
+
export { type EventViewActions, type EventViewState, type PipelineFileResponse, type UseExecuteOptions, type UseExecuteReturn, type UsePipelineFileOptions, type UsePipelineFileReturn, type UsePipelineOptions, type UsePipelineReturn, type UsePipelineVersionsReturn, type UsePipelinesOptions, type UsePipelinesReturn, useEventView, useExecute, usePipeline, usePipelineFile, usePipelineVersions, usePipelines };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useEventView } from "./use-event-view.mjs";
|
|
2
|
+
import { useExecute } from "./use-execute.mjs";
|
|
3
|
+
import { usePipeline } from "./use-pipeline.mjs";
|
|
4
|
+
import { usePipelineFile } from "./use-pipeline-file.mjs";
|
|
5
|
+
import { usePipelineVersions } from "./use-pipeline-versions.mjs";
|
|
6
|
+
import { usePipelines } from "./use-pipelines.mjs";
|
|
7
|
+
|
|
8
|
+
export { useEventView, useExecute, usePipeline, usePipelineFile, usePipelineVersions, usePipelines };
|