@things-factory/labeling 10.0.0-zeta.7 → 10.0.0
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/dist-client/index.d.ts +3 -0
- package/dist-client/index.js +9 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/labeling-workflow-builder.d.ts +26 -0
- package/dist-client/pages/labeling-workflow-builder.js +636 -0
- package/dist-client/pages/labeling-workflow-builder.js.map +1 -0
- package/dist-client/pages/labeling-workflow-list.d.ts +24 -0
- package/dist-client/pages/labeling-workflow-list.js +495 -0
- package/dist-client/pages/labeling-workflow-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +47 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/entities/index.d.ts +5 -0
- package/dist-server/entities/index.js +11 -0
- package/dist-server/entities/index.js.map +1 -0
- package/dist-server/index.d.ts +3 -0
- package/dist-server/index.js +7 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/route.d.ts +2 -0
- package/dist-server/route.js +6 -0
- package/dist-server/route.js.map +1 -0
- package/dist-server/service/index.d.ts +8 -0
- package/dist-server/service/index.js +21 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/labeling-workflow-service.d.ts +69 -0
- package/dist-server/service/labeling-workflow-service.js +521 -0
- package/dist-server/service/labeling-workflow-service.js.map +1 -0
- package/dist-server/service/labeling-workflow.d.ts +30 -0
- package/dist-server/service/labeling-workflow.js +119 -0
- package/dist-server/service/labeling-workflow.js.map +1 -0
- package/dist-server/service/workflow-execution-step.d.ts +28 -0
- package/dist-server/service/workflow-execution-step.js +115 -0
- package/dist-server/service/workflow-execution-step.js.map +1 -0
- package/dist-server/service/workflow-execution.d.ts +27 -0
- package/dist-server/service/workflow-execution.js +110 -0
- package/dist-server/service/workflow-execution.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/types/workflow-types.d.ts +141 -0
- package/dist-server/types/workflow-types.js +488 -0
- package/dist-server/types/workflow-types.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.route = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./pages/labeling-workflow-list.js"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./pages/labeling-workflow-builder.js"), exports);
|
|
7
|
+
var route_js_1 = require("./route.js");
|
|
8
|
+
Object.defineProperty(exports, "route", { enumerable: true, get: function () { return tslib_1.__importDefault(route_js_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":";;;;AAAA,4EAAiD;AACjD,+EAAoD;AAEpD,uCAA6C;AAApC,0HAAA,OAAO,OAAS","sourcesContent":["export * from './pages/labeling-workflow-list.js'\nexport * from './pages/labeling-workflow-builder.js'\n\nexport { default as route } from './route.js'\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PageView } from '@operato/shell';
|
|
2
|
+
/**
|
|
3
|
+
* Workflow Builder Page
|
|
4
|
+
*
|
|
5
|
+
* Generic workflow builder UI for creating and editing labeling workflows
|
|
6
|
+
*/
|
|
7
|
+
export declare class LabelingWorkflowBuilderPage extends PageView {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
workflowId?: string;
|
|
10
|
+
workflow: any;
|
|
11
|
+
selectedStepIndex: number;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: string;
|
|
14
|
+
firstUpdated(): Promise<void>;
|
|
15
|
+
loadWorkflow(): Promise<void>;
|
|
16
|
+
saveWorkflow(): Promise<void>;
|
|
17
|
+
addStep(): void;
|
|
18
|
+
removeStep(index: number): void;
|
|
19
|
+
moveStepUp(index: number): void;
|
|
20
|
+
moveStepDown(index: number): void;
|
|
21
|
+
selectStep(index: number): void;
|
|
22
|
+
updateStep(index: number, field: string, value: any): void;
|
|
23
|
+
updateWorkflow(field: string, value: any): void;
|
|
24
|
+
renderStepEditor(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelingWorkflowBuilderPage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lit_1 = require("lit");
|
|
6
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
7
|
+
const shell_1 = require("@operato/shell");
|
|
8
|
+
const graphql_1 = require("@operato/graphql");
|
|
9
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
10
|
+
/**
|
|
11
|
+
* Workflow Builder Page
|
|
12
|
+
*
|
|
13
|
+
* Generic workflow builder UI for creating and editing labeling workflows
|
|
14
|
+
*/
|
|
15
|
+
let LabelingWorkflowBuilderPage = class LabelingWorkflowBuilderPage extends shell_1.PageView {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.workflow = {
|
|
19
|
+
name: '',
|
|
20
|
+
description: '',
|
|
21
|
+
projectId: null,
|
|
22
|
+
triggerType: 'manual',
|
|
23
|
+
triggerConfig: '',
|
|
24
|
+
steps: [],
|
|
25
|
+
autoStart: false
|
|
26
|
+
};
|
|
27
|
+
this.selectedStepIndex = -1;
|
|
28
|
+
this.loading = false;
|
|
29
|
+
this.error = '';
|
|
30
|
+
}
|
|
31
|
+
static { this.styles = [
|
|
32
|
+
(0, lit_1.css) `
|
|
33
|
+
:host {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
height: 100%;
|
|
37
|
+
background-color: var(--md-sys-color-surface);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.header {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
align-items: center;
|
|
44
|
+
padding: 20px;
|
|
45
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
46
|
+
border-bottom: 1px solid var(--md-sys-color-outline);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.header h1 {
|
|
50
|
+
margin: 0;
|
|
51
|
+
font-size: 24px;
|
|
52
|
+
color: var(--md-sys-color-on-surface);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.header-actions {
|
|
56
|
+
display: flex;
|
|
57
|
+
gap: 10px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.content {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex: 1;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.sidebar {
|
|
67
|
+
width: 300px;
|
|
68
|
+
border-right: 1px solid var(--md-sys-color-outline);
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
padding: 20px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.main-area {
|
|
74
|
+
flex: 1;
|
|
75
|
+
overflow-y: auto;
|
|
76
|
+
padding: 20px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.form-group {
|
|
80
|
+
margin-bottom: 20px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.form-group label {
|
|
84
|
+
display: block;
|
|
85
|
+
margin-bottom: 8px;
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
color: var(--md-sys-color-on-surface);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.form-group input,
|
|
91
|
+
.form-group textarea,
|
|
92
|
+
.form-group select {
|
|
93
|
+
width: 100%;
|
|
94
|
+
padding: 10px;
|
|
95
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
96
|
+
border-radius: 4px;
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
background-color: var(--md-sys-color-surface);
|
|
99
|
+
color: var(--md-sys-color-on-surface);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.form-group textarea {
|
|
103
|
+
min-height: 80px;
|
|
104
|
+
resize: vertical;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
button {
|
|
108
|
+
padding: 10px 20px;
|
|
109
|
+
background-color: var(--md-sys-color-primary);
|
|
110
|
+
color: var(--md-sys-color-on-primary);
|
|
111
|
+
border: none;
|
|
112
|
+
border-radius: 4px;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
button:hover {
|
|
118
|
+
opacity: 0.9;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
button.secondary {
|
|
122
|
+
background-color: var(--md-sys-color-secondary);
|
|
123
|
+
color: var(--md-sys-color-on-secondary);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.steps-container {
|
|
127
|
+
margin-top: 20px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.steps-header {
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
align-items: center;
|
|
134
|
+
margin-bottom: 15px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.steps-header h2 {
|
|
138
|
+
margin: 0;
|
|
139
|
+
font-size: 18px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.step-list {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
gap: 10px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.step-item {
|
|
149
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
150
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
151
|
+
border-radius: 8px;
|
|
152
|
+
padding: 15px;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
transition:
|
|
155
|
+
transform 0.2s,
|
|
156
|
+
box-shadow 0.2s;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.step-item:hover {
|
|
160
|
+
transform: translateY(-2px);
|
|
161
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.step-item.selected {
|
|
165
|
+
border-color: var(--md-sys-color-primary);
|
|
166
|
+
border-width: 2px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.step-header {
|
|
170
|
+
display: flex;
|
|
171
|
+
justify-content: space-between;
|
|
172
|
+
align-items: center;
|
|
173
|
+
margin-bottom: 8px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.step-title {
|
|
177
|
+
font-weight: bold;
|
|
178
|
+
font-size: 16px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.step-actions {
|
|
182
|
+
display: flex;
|
|
183
|
+
gap: 5px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.step-actions button {
|
|
187
|
+
padding: 5px 10px;
|
|
188
|
+
font-size: 12px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.step-type {
|
|
192
|
+
display: inline-block;
|
|
193
|
+
padding: 4px 8px;
|
|
194
|
+
background-color: var(--md-sys-color-primary-container);
|
|
195
|
+
color: var(--md-sys-color-on-primary-container);
|
|
196
|
+
border-radius: 4px;
|
|
197
|
+
font-size: 12px;
|
|
198
|
+
margin-bottom: 8px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.step-config {
|
|
202
|
+
font-size: 12px;
|
|
203
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
204
|
+
margin-top: 8px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.empty-state {
|
|
208
|
+
text-align: center;
|
|
209
|
+
padding: 40px;
|
|
210
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.add-step-button {
|
|
214
|
+
width: 100%;
|
|
215
|
+
padding: 15px;
|
|
216
|
+
border: 2px dashed var(--md-sys-color-outline);
|
|
217
|
+
background-color: transparent;
|
|
218
|
+
color: var(--md-sys-color-on-surface);
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
border-radius: 8px;
|
|
221
|
+
margin-top: 10px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.add-step-button:hover {
|
|
225
|
+
border-color: var(--md-sys-color-primary);
|
|
226
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.loading {
|
|
230
|
+
text-align: center;
|
|
231
|
+
padding: 40px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.error {
|
|
235
|
+
padding: 15px;
|
|
236
|
+
background-color: #ffebee;
|
|
237
|
+
color: #c62828;
|
|
238
|
+
border-radius: 4px;
|
|
239
|
+
margin-bottom: 20px;
|
|
240
|
+
}
|
|
241
|
+
`
|
|
242
|
+
]; }
|
|
243
|
+
async firstUpdated() {
|
|
244
|
+
if (this.workflowId) {
|
|
245
|
+
await this.loadWorkflow();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
async loadWorkflow() {
|
|
249
|
+
this.loading = true;
|
|
250
|
+
this.error = '';
|
|
251
|
+
try {
|
|
252
|
+
const response = await graphql_1.client.query({
|
|
253
|
+
query: (0, graphql_tag_1.default) `
|
|
254
|
+
query GetWorkflow($workflowId: String!) {
|
|
255
|
+
labelingWorkflow(workflowId: $workflowId) {
|
|
256
|
+
id
|
|
257
|
+
name
|
|
258
|
+
description
|
|
259
|
+
projectId
|
|
260
|
+
triggerType
|
|
261
|
+
triggerConfig
|
|
262
|
+
steps {
|
|
263
|
+
name
|
|
264
|
+
type
|
|
265
|
+
order
|
|
266
|
+
config
|
|
267
|
+
continueOnError
|
|
268
|
+
}
|
|
269
|
+
status
|
|
270
|
+
autoStart
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
`,
|
|
274
|
+
variables: { workflowId: this.workflowId }
|
|
275
|
+
});
|
|
276
|
+
this.workflow = response.data.labelingWorkflow;
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
console.error('Failed to load workflow:', error);
|
|
280
|
+
this.error = 'Failed to load workflow. Please try again.';
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
this.loading = false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
async saveWorkflow() {
|
|
287
|
+
this.loading = true;
|
|
288
|
+
this.error = '';
|
|
289
|
+
try {
|
|
290
|
+
const mutation = this.workflowId
|
|
291
|
+
? (0, graphql_tag_1.default) `
|
|
292
|
+
mutation UpdateWorkflow($workflowId: String!, $input: UpdateWorkflowRequest!) {
|
|
293
|
+
updateLabelingWorkflow(workflowId: $workflowId, input: $input) {
|
|
294
|
+
id
|
|
295
|
+
name
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
`
|
|
299
|
+
: (0, graphql_tag_1.default) `
|
|
300
|
+
mutation CreateWorkflow($input: CreateWorkflowRequest!) {
|
|
301
|
+
createLabelingWorkflow(input: $input) {
|
|
302
|
+
id
|
|
303
|
+
name
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
const variables = {
|
|
308
|
+
input: {
|
|
309
|
+
name: this.workflow.name,
|
|
310
|
+
description: this.workflow.description,
|
|
311
|
+
projectId: parseInt(this.workflow.projectId),
|
|
312
|
+
triggerType: this.workflow.triggerType,
|
|
313
|
+
triggerConfig: this.workflow.triggerConfig,
|
|
314
|
+
steps: this.workflow.steps.map((step, index) => ({
|
|
315
|
+
name: step.name,
|
|
316
|
+
type: step.type,
|
|
317
|
+
order: index + 1,
|
|
318
|
+
config: step.config,
|
|
319
|
+
continueOnError: step.continueOnError || false
|
|
320
|
+
})),
|
|
321
|
+
autoStart: this.workflow.autoStart
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
if (this.workflowId) {
|
|
325
|
+
variables.workflowId = this.workflowId;
|
|
326
|
+
}
|
|
327
|
+
await graphql_1.client.mutate({ mutation, variables });
|
|
328
|
+
alert('Workflow saved successfully!');
|
|
329
|
+
history.back();
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
console.error('Failed to save workflow:', error);
|
|
333
|
+
this.error = 'Failed to save workflow. Please check your inputs and try again.';
|
|
334
|
+
}
|
|
335
|
+
finally {
|
|
336
|
+
this.loading = false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
addStep() {
|
|
340
|
+
const newStep = {
|
|
341
|
+
name: `Step ${this.workflow.steps.length + 1}`,
|
|
342
|
+
type: 'import_data',
|
|
343
|
+
config: '{}',
|
|
344
|
+
continueOnError: false
|
|
345
|
+
};
|
|
346
|
+
this.workflow = {
|
|
347
|
+
...this.workflow,
|
|
348
|
+
steps: [...this.workflow.steps, newStep]
|
|
349
|
+
};
|
|
350
|
+
this.selectedStepIndex = this.workflow.steps.length - 1;
|
|
351
|
+
}
|
|
352
|
+
removeStep(index) {
|
|
353
|
+
if (confirm('Are you sure you want to remove this step?')) {
|
|
354
|
+
const steps = [...this.workflow.steps];
|
|
355
|
+
steps.splice(index, 1);
|
|
356
|
+
this.workflow = {
|
|
357
|
+
...this.workflow,
|
|
358
|
+
steps
|
|
359
|
+
};
|
|
360
|
+
if (this.selectedStepIndex === index) {
|
|
361
|
+
this.selectedStepIndex = -1;
|
|
362
|
+
}
|
|
363
|
+
else if (this.selectedStepIndex > index) {
|
|
364
|
+
this.selectedStepIndex--;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
moveStepUp(index) {
|
|
369
|
+
if (index === 0)
|
|
370
|
+
return;
|
|
371
|
+
const steps = [...this.workflow.steps];
|
|
372
|
+
const temp = steps[index];
|
|
373
|
+
steps[index] = steps[index - 1];
|
|
374
|
+
steps[index - 1] = temp;
|
|
375
|
+
this.workflow = {
|
|
376
|
+
...this.workflow,
|
|
377
|
+
steps
|
|
378
|
+
};
|
|
379
|
+
if (this.selectedStepIndex === index) {
|
|
380
|
+
this.selectedStepIndex = index - 1;
|
|
381
|
+
}
|
|
382
|
+
else if (this.selectedStepIndex === index - 1) {
|
|
383
|
+
this.selectedStepIndex = index;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
moveStepDown(index) {
|
|
387
|
+
if (index === this.workflow.steps.length - 1)
|
|
388
|
+
return;
|
|
389
|
+
const steps = [...this.workflow.steps];
|
|
390
|
+
const temp = steps[index];
|
|
391
|
+
steps[index] = steps[index + 1];
|
|
392
|
+
steps[index + 1] = temp;
|
|
393
|
+
this.workflow = {
|
|
394
|
+
...this.workflow,
|
|
395
|
+
steps
|
|
396
|
+
};
|
|
397
|
+
if (this.selectedStepIndex === index) {
|
|
398
|
+
this.selectedStepIndex = index + 1;
|
|
399
|
+
}
|
|
400
|
+
else if (this.selectedStepIndex === index + 1) {
|
|
401
|
+
this.selectedStepIndex = index;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
selectStep(index) {
|
|
405
|
+
this.selectedStepIndex = index;
|
|
406
|
+
}
|
|
407
|
+
updateStep(index, field, value) {
|
|
408
|
+
const steps = [...this.workflow.steps];
|
|
409
|
+
steps[index] = {
|
|
410
|
+
...steps[index],
|
|
411
|
+
[field]: value
|
|
412
|
+
};
|
|
413
|
+
this.workflow = {
|
|
414
|
+
...this.workflow,
|
|
415
|
+
steps
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
updateWorkflow(field, value) {
|
|
419
|
+
this.workflow = {
|
|
420
|
+
...this.workflow,
|
|
421
|
+
[field]: value
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
renderStepEditor() {
|
|
425
|
+
if (this.selectedStepIndex === -1 || !this.workflow.steps[this.selectedStepIndex]) {
|
|
426
|
+
return (0, lit_1.html) ` <div class="empty-state">Select a step to edit its configuration</div> `;
|
|
427
|
+
}
|
|
428
|
+
const step = this.workflow.steps[this.selectedStepIndex];
|
|
429
|
+
return (0, lit_1.html) `
|
|
430
|
+
<div class="form-group">
|
|
431
|
+
<label>Step Name</label>
|
|
432
|
+
<input
|
|
433
|
+
type="text"
|
|
434
|
+
.value=${step.name}
|
|
435
|
+
@input=${(e) => this.updateStep(this.selectedStepIndex, 'name', e.target.value)}
|
|
436
|
+
/>
|
|
437
|
+
</div>
|
|
438
|
+
|
|
439
|
+
<div class="form-group">
|
|
440
|
+
<label>Step Type</label>
|
|
441
|
+
<select
|
|
442
|
+
.value=${step.type}
|
|
443
|
+
@change=${(e) => this.updateStep(this.selectedStepIndex, 'type', e.target.value)}
|
|
444
|
+
>
|
|
445
|
+
<option value="import_data">Import Data</option>
|
|
446
|
+
<option value="generate_predictions">Generate Predictions</option>
|
|
447
|
+
<option value="wait_for_annotations">Wait for Annotations</option>
|
|
448
|
+
<option value="sync_annotations">Sync Annotations</option>
|
|
449
|
+
<option value="validate_quality">Validate Quality</option>
|
|
450
|
+
<option value="export_results">Export Results</option>
|
|
451
|
+
<option value="notification">Notification</option>
|
|
452
|
+
</select>
|
|
453
|
+
</div>
|
|
454
|
+
|
|
455
|
+
<div class="form-group">
|
|
456
|
+
<label>Configuration (JSON)</label>
|
|
457
|
+
<textarea
|
|
458
|
+
.value=${step.config}
|
|
459
|
+
@input=${(e) => this.updateStep(this.selectedStepIndex, 'config', e.target.value)}
|
|
460
|
+
placeholder='{"key": "value"}'
|
|
461
|
+
></textarea>
|
|
462
|
+
</div>
|
|
463
|
+
|
|
464
|
+
<div class="form-group">
|
|
465
|
+
<label>
|
|
466
|
+
<input
|
|
467
|
+
type="checkbox"
|
|
468
|
+
.checked=${step.continueOnError}
|
|
469
|
+
@change=${(e) => this.updateStep(this.selectedStepIndex, 'continueOnError', e.target.checked)}
|
|
470
|
+
/>
|
|
471
|
+
Continue on Error
|
|
472
|
+
</label>
|
|
473
|
+
</div>
|
|
474
|
+
`;
|
|
475
|
+
}
|
|
476
|
+
render() {
|
|
477
|
+
if (this.loading) {
|
|
478
|
+
return (0, lit_1.html) `<div class="loading">Loading...</div>`;
|
|
479
|
+
}
|
|
480
|
+
return (0, lit_1.html) `
|
|
481
|
+
<div class="header">
|
|
482
|
+
<h1>${this.workflowId ? 'Edit Workflow' : 'Create Workflow'}</h1>
|
|
483
|
+
<div class="header-actions">
|
|
484
|
+
<button class="secondary" @click=${() => history.back()}>Cancel</button>
|
|
485
|
+
<button @click=${this.saveWorkflow}>Save Workflow</button>
|
|
486
|
+
</div>
|
|
487
|
+
</div>
|
|
488
|
+
|
|
489
|
+
${this.error ? (0, lit_1.html) `<div class="error">${this.error}</div>` : ''}
|
|
490
|
+
|
|
491
|
+
<div class="content">
|
|
492
|
+
<div class="sidebar">
|
|
493
|
+
<div class="form-group">
|
|
494
|
+
<label>Workflow Name *</label>
|
|
495
|
+
<input
|
|
496
|
+
type="text"
|
|
497
|
+
.value=${this.workflow.name}
|
|
498
|
+
@input=${(e) => this.updateWorkflow('name', e.target.value)}
|
|
499
|
+
placeholder="Enter workflow name"
|
|
500
|
+
required
|
|
501
|
+
/>
|
|
502
|
+
</div>
|
|
503
|
+
|
|
504
|
+
<div class="form-group">
|
|
505
|
+
<label>Description</label>
|
|
506
|
+
<textarea
|
|
507
|
+
.value=${this.workflow.description || ''}
|
|
508
|
+
@input=${(e) => this.updateWorkflow('description', e.target.value)}
|
|
509
|
+
placeholder="Enter workflow description"
|
|
510
|
+
></textarea>
|
|
511
|
+
</div>
|
|
512
|
+
|
|
513
|
+
<div class="form-group">
|
|
514
|
+
<label>Project ID *</label>
|
|
515
|
+
<input
|
|
516
|
+
type="number"
|
|
517
|
+
.value=${this.workflow.projectId || ''}
|
|
518
|
+
@input=${(e) => this.updateWorkflow('projectId', e.target.value)}
|
|
519
|
+
placeholder="Label Studio project ID"
|
|
520
|
+
required
|
|
521
|
+
/>
|
|
522
|
+
</div>
|
|
523
|
+
|
|
524
|
+
<div class="form-group">
|
|
525
|
+
<label>Trigger Type</label>
|
|
526
|
+
<select
|
|
527
|
+
.value=${this.workflow.triggerType}
|
|
528
|
+
@change=${(e) => this.updateWorkflow('triggerType', e.target.value)}
|
|
529
|
+
>
|
|
530
|
+
<option value="manual">Manual</option>
|
|
531
|
+
<option value="scheduled">Scheduled</option>
|
|
532
|
+
<option value="event">Event-based</option>
|
|
533
|
+
</select>
|
|
534
|
+
</div>
|
|
535
|
+
|
|
536
|
+
<div class="form-group">
|
|
537
|
+
<label>
|
|
538
|
+
<input
|
|
539
|
+
type="checkbox"
|
|
540
|
+
.checked=${this.workflow.autoStart}
|
|
541
|
+
@change=${(e) => this.updateWorkflow('autoStart', e.target.checked)}
|
|
542
|
+
/>
|
|
543
|
+
Auto Start
|
|
544
|
+
</label>
|
|
545
|
+
</div>
|
|
546
|
+
|
|
547
|
+
<div class="steps-container">
|
|
548
|
+
<div class="steps-header">
|
|
549
|
+
<h2>Workflow Steps</h2>
|
|
550
|
+
</div>
|
|
551
|
+
|
|
552
|
+
<div class="step-list">
|
|
553
|
+
${this.workflow.steps.length === 0
|
|
554
|
+
? (0, lit_1.html) `<div class="empty-state">No steps added yet</div>`
|
|
555
|
+
: this.workflow.steps.map((step, index) => (0, lit_1.html) `
|
|
556
|
+
<div
|
|
557
|
+
class="step-item ${this.selectedStepIndex === index ? 'selected' : ''}"
|
|
558
|
+
@click=${() => this.selectStep(index)}
|
|
559
|
+
>
|
|
560
|
+
<div class="step-header">
|
|
561
|
+
<div class="step-title">${index + 1}. ${step.name}</div>
|
|
562
|
+
<div class="step-actions">
|
|
563
|
+
${index > 0
|
|
564
|
+
? (0, lit_1.html) `<button
|
|
565
|
+
@click=${(e) => {
|
|
566
|
+
e.stopPropagation();
|
|
567
|
+
this.moveStepUp(index);
|
|
568
|
+
}}
|
|
569
|
+
>
|
|
570
|
+
↑
|
|
571
|
+
</button>`
|
|
572
|
+
: ''}
|
|
573
|
+
${index < this.workflow.steps.length - 1
|
|
574
|
+
? (0, lit_1.html) `<button
|
|
575
|
+
@click=${(e) => {
|
|
576
|
+
e.stopPropagation();
|
|
577
|
+
this.moveStepDown(index);
|
|
578
|
+
}}
|
|
579
|
+
>
|
|
580
|
+
↓
|
|
581
|
+
</button>`
|
|
582
|
+
: ''}
|
|
583
|
+
<button
|
|
584
|
+
class="secondary"
|
|
585
|
+
@click=${(e) => {
|
|
586
|
+
e.stopPropagation();
|
|
587
|
+
this.removeStep(index);
|
|
588
|
+
}}
|
|
589
|
+
>
|
|
590
|
+
×
|
|
591
|
+
</button>
|
|
592
|
+
</div>
|
|
593
|
+
</div>
|
|
594
|
+
<div class="step-type">${step.type}</div>
|
|
595
|
+
${step.continueOnError ? (0, lit_1.html) `<div class="step-config">Continue on error: Yes</div>` : ''}
|
|
596
|
+
</div>
|
|
597
|
+
`)}
|
|
598
|
+
</div>
|
|
599
|
+
|
|
600
|
+
<button class="add-step-button" @click=${this.addStep}>+ Add Step</button>
|
|
601
|
+
</div>
|
|
602
|
+
</div>
|
|
603
|
+
|
|
604
|
+
<div class="main-area">
|
|
605
|
+
<h2>Step Configuration</h2>
|
|
606
|
+
${this.renderStepEditor()}
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
`;
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
exports.LabelingWorkflowBuilderPage = LabelingWorkflowBuilderPage;
|
|
613
|
+
tslib_1.__decorate([
|
|
614
|
+
(0, decorators_js_1.property)({ type: String }),
|
|
615
|
+
tslib_1.__metadata("design:type", String)
|
|
616
|
+
], LabelingWorkflowBuilderPage.prototype, "workflowId", void 0);
|
|
617
|
+
tslib_1.__decorate([
|
|
618
|
+
(0, decorators_js_1.state)(),
|
|
619
|
+
tslib_1.__metadata("design:type", Object)
|
|
620
|
+
], LabelingWorkflowBuilderPage.prototype, "workflow", void 0);
|
|
621
|
+
tslib_1.__decorate([
|
|
622
|
+
(0, decorators_js_1.state)(),
|
|
623
|
+
tslib_1.__metadata("design:type", Number)
|
|
624
|
+
], LabelingWorkflowBuilderPage.prototype, "selectedStepIndex", void 0);
|
|
625
|
+
tslib_1.__decorate([
|
|
626
|
+
(0, decorators_js_1.state)(),
|
|
627
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
628
|
+
], LabelingWorkflowBuilderPage.prototype, "loading", void 0);
|
|
629
|
+
tslib_1.__decorate([
|
|
630
|
+
(0, decorators_js_1.state)(),
|
|
631
|
+
tslib_1.__metadata("design:type", String)
|
|
632
|
+
], LabelingWorkflowBuilderPage.prototype, "error", void 0);
|
|
633
|
+
exports.LabelingWorkflowBuilderPage = LabelingWorkflowBuilderPage = tslib_1.__decorate([
|
|
634
|
+
(0, decorators_js_1.customElement)('labeling-workflow-builder-page')
|
|
635
|
+
], LabelingWorkflowBuilderPage);
|
|
636
|
+
//# sourceMappingURL=labeling-workflow-builder.js.map
|