@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.
Files changed (42) hide show
  1. package/dist-client/index.d.ts +3 -0
  2. package/dist-client/index.js +9 -0
  3. package/dist-client/index.js.map +1 -0
  4. package/dist-client/pages/labeling-workflow-builder.d.ts +26 -0
  5. package/dist-client/pages/labeling-workflow-builder.js +636 -0
  6. package/dist-client/pages/labeling-workflow-builder.js.map +1 -0
  7. package/dist-client/pages/labeling-workflow-list.d.ts +24 -0
  8. package/dist-client/pages/labeling-workflow-list.js +495 -0
  9. package/dist-client/pages/labeling-workflow-list.js.map +1 -0
  10. package/dist-client/route.d.ts +1 -0
  11. package/dist-client/route.js +47 -0
  12. package/dist-client/route.js.map +1 -0
  13. package/dist-client/tsconfig.tsbuildinfo +1 -0
  14. package/dist-server/entities/index.d.ts +5 -0
  15. package/dist-server/entities/index.js +11 -0
  16. package/dist-server/entities/index.js.map +1 -0
  17. package/dist-server/index.d.ts +3 -0
  18. package/dist-server/index.js +7 -0
  19. package/dist-server/index.js.map +1 -0
  20. package/dist-server/route.d.ts +2 -0
  21. package/dist-server/route.js +6 -0
  22. package/dist-server/route.js.map +1 -0
  23. package/dist-server/service/index.d.ts +8 -0
  24. package/dist-server/service/index.js +21 -0
  25. package/dist-server/service/index.js.map +1 -0
  26. package/dist-server/service/labeling-workflow-service.d.ts +69 -0
  27. package/dist-server/service/labeling-workflow-service.js +521 -0
  28. package/dist-server/service/labeling-workflow-service.js.map +1 -0
  29. package/dist-server/service/labeling-workflow.d.ts +30 -0
  30. package/dist-server/service/labeling-workflow.js +119 -0
  31. package/dist-server/service/labeling-workflow.js.map +1 -0
  32. package/dist-server/service/workflow-execution-step.d.ts +28 -0
  33. package/dist-server/service/workflow-execution-step.js +115 -0
  34. package/dist-server/service/workflow-execution-step.js.map +1 -0
  35. package/dist-server/service/workflow-execution.d.ts +27 -0
  36. package/dist-server/service/workflow-execution.js +110 -0
  37. package/dist-server/service/workflow-execution.js.map +1 -0
  38. package/dist-server/tsconfig.tsbuildinfo +1 -0
  39. package/dist-server/types/workflow-types.d.ts +141 -0
  40. package/dist-server/types/workflow-types.js +488 -0
  41. package/dist-server/types/workflow-types.js.map +1 -0
  42. package/package.json +10 -10
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labeling-workflow-builder.js","sourceRoot":"","sources":["../../client/pages/labeling-workflow-builder.ts"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qDAAkE;AAClE,0CAAyC;AACzC,8CAAyC;AACzC,sEAA6B;AAE7B;;;;GAIG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,gBAAQ;IAAlD;;QAuNI,aAAQ,GAAQ;YACvB,IAAI,EAAE,EAAE;YACR,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,QAAQ;YACrB,aAAa,EAAE,EAAE;YACjB,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,KAAK;SACjB,CAAA;QACQ,sBAAiB,GAAW,CAAC,CAAC,CAAA;QAC9B,YAAO,GAAY,KAAK,CAAA;QACxB,UAAK,GAAW,EAAE,CAAA;IA2Y7B,CAAC;aA5mBQ,WAAM,GAAG;QACd,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiNF;KACF,AAnNY,CAmNZ;IAgBD,KAAK,CAAC,YAAY;QAChB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;QAC3B,CAAC;IACH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CAAC,CAAC,CAAC,EAAE;;qBAE5F,CACF;;;qDAGkC,IAAI,CAAC,OAAO;;;;;;YAMrD,IAAI,CAAC,gBAAgB,EAAE;;;KAG9B,CAAA;IACH,CAAC;;AA5mBU,kEAA2B;AAsNV;IAA3B,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+DAAoB;AACtC;IAAR,IAAA,qBAAK,GAAE;;6DAQP;AACQ;IAAR,IAAA,qBAAK,GAAE;;sEAA+B;AAC9B;IAAR,IAAA,qBAAK,GAAE;;4DAAyB;AACxB;IAAR,IAAA,qBAAK,GAAE;;0DAAmB;sCAlOhB,2BAA2B;IADvC,IAAA,6BAAa,EAAC,gCAAgC,CAAC;GACnC,2BAA2B,CA6mBvC","sourcesContent":["import { html, css } from 'lit'\nimport { customElement, state, property } from 'lit/decorators.js'\nimport { PageView } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\n/**\n * Workflow Builder Page\n *\n * Generic workflow builder UI for creating and editing labeling workflows\n */\n@customElement('labeling-workflow-builder-page')\nexport class LabelingWorkflowBuilderPage extends PageView {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--md-sys-color-surface);\n }\n\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 20px;\n background-color: var(--md-sys-color-surface-variant);\n border-bottom: 1px solid var(--md-sys-color-outline);\n }\n\n .header h1 {\n margin: 0;\n font-size: 24px;\n color: var(--md-sys-color-on-surface);\n }\n\n .header-actions {\n display: flex;\n gap: 10px;\n }\n\n .content {\n display: flex;\n flex: 1;\n overflow: hidden;\n }\n\n .sidebar {\n width: 300px;\n border-right: 1px solid var(--md-sys-color-outline);\n overflow-y: auto;\n padding: 20px;\n }\n\n .main-area {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n }\n\n .form-group {\n margin-bottom: 20px;\n }\n\n .form-group label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: var(--md-sys-color-on-surface);\n }\n\n .form-group input,\n .form-group textarea,\n .form-group select {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--md-sys-color-outline);\n border-radius: 4px;\n font-size: 14px;\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n }\n\n .form-group textarea {\n min-height: 80px;\n resize: vertical;\n }\n\n button {\n padding: 10px 20px;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n }\n\n button:hover {\n opacity: 0.9;\n }\n\n button.secondary {\n background-color: var(--md-sys-color-secondary);\n color: var(--md-sys-color-on-secondary);\n }\n\n .steps-container {\n margin-top: 20px;\n }\n\n .steps-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 15px;\n }\n\n .steps-header h2 {\n margin: 0;\n font-size: 18px;\n }\n\n .step-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .step-item {\n background-color: var(--md-sys-color-surface-variant);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: 8px;\n padding: 15px;\n cursor: pointer;\n transition:\n transform 0.2s,\n box-shadow 0.2s;\n }\n\n .step-item:hover {\n transform: translateY(-2px);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n }\n\n .step-item.selected {\n border-color: var(--md-sys-color-primary);\n border-width: 2px;\n }\n\n .step-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n }\n\n .step-title {\n font-weight: bold;\n font-size: 16px;\n }\n\n .step-actions {\n display: flex;\n gap: 5px;\n }\n\n .step-actions button {\n padding: 5px 10px;\n font-size: 12px;\n }\n\n .step-type {\n display: inline-block;\n padding: 4px 8px;\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n border-radius: 4px;\n font-size: 12px;\n margin-bottom: 8px;\n }\n\n .step-config {\n font-size: 12px;\n color: var(--md-sys-color-on-surface-variant);\n margin-top: 8px;\n }\n\n .empty-state {\n text-align: center;\n padding: 40px;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n .add-step-button {\n width: 100%;\n padding: 15px;\n border: 2px dashed var(--md-sys-color-outline);\n background-color: transparent;\n color: var(--md-sys-color-on-surface);\n cursor: pointer;\n border-radius: 8px;\n margin-top: 10px;\n }\n\n .add-step-button:hover {\n border-color: var(--md-sys-color-primary);\n background-color: var(--md-sys-color-surface-variant);\n }\n\n .loading {\n text-align: center;\n padding: 40px;\n }\n\n .error {\n padding: 15px;\n background-color: #ffebee;\n color: #c62828;\n border-radius: 4px;\n margin-bottom: 20px;\n }\n `\n ]\n\n @property({ type: String }) workflowId?: string\n @state() workflow: any = {\n name: '',\n description: '',\n projectId: null,\n triggerType: 'manual',\n triggerConfig: '',\n steps: [],\n autoStart: false\n }\n @state() selectedStepIndex: number = -1\n @state() loading: boolean = false\n @state() error: string = ''\n\n async firstUpdated() {\n if (this.workflowId) {\n await this.loadWorkflow()\n }\n }\n\n async loadWorkflow() {\n this.loading = true\n this.error = ''\n\n try {\n const response = await client.query({\n query: gql`\n query GetWorkflow($workflowId: String!) {\n labelingWorkflow(workflowId: $workflowId) {\n id\n name\n description\n projectId\n triggerType\n triggerConfig\n steps {\n name\n type\n order\n config\n continueOnError\n }\n status\n autoStart\n }\n }\n `,\n variables: { workflowId: this.workflowId }\n })\n\n this.workflow = response.data.labelingWorkflow\n } catch (error) {\n console.error('Failed to load workflow:', error)\n this.error = 'Failed to load workflow. Please try again.'\n } finally {\n this.loading = false\n }\n }\n\n async saveWorkflow() {\n this.loading = true\n this.error = ''\n\n try {\n const mutation = this.workflowId\n ? gql`\n mutation UpdateWorkflow($workflowId: String!, $input: UpdateWorkflowRequest!) {\n updateLabelingWorkflow(workflowId: $workflowId, input: $input) {\n id\n name\n }\n }\n `\n : gql`\n mutation CreateWorkflow($input: CreateWorkflowRequest!) {\n createLabelingWorkflow(input: $input) {\n id\n name\n }\n }\n `\n\n const variables: any = {\n input: {\n name: this.workflow.name,\n description: this.workflow.description,\n projectId: parseInt(this.workflow.projectId),\n triggerType: this.workflow.triggerType,\n triggerConfig: this.workflow.triggerConfig,\n steps: this.workflow.steps.map((step: any, index: number) => ({\n name: step.name,\n type: step.type,\n order: index + 1,\n config: step.config,\n continueOnError: step.continueOnError || false\n })),\n autoStart: this.workflow.autoStart\n }\n }\n\n if (this.workflowId) {\n variables.workflowId = this.workflowId\n }\n\n await client.mutate({ mutation, variables })\n\n alert('Workflow saved successfully!')\n history.back()\n } catch (error) {\n console.error('Failed to save workflow:', error)\n this.error = 'Failed to save workflow. Please check your inputs and try again.'\n } finally {\n this.loading = false\n }\n }\n\n addStep() {\n const newStep = {\n name: `Step ${this.workflow.steps.length + 1}`,\n type: 'import_data',\n config: '{}',\n continueOnError: false\n }\n\n this.workflow = {\n ...this.workflow,\n steps: [...this.workflow.steps, newStep]\n }\n\n this.selectedStepIndex = this.workflow.steps.length - 1\n }\n\n removeStep(index: number) {\n if (confirm('Are you sure you want to remove this step?')) {\n const steps = [...this.workflow.steps]\n steps.splice(index, 1)\n\n this.workflow = {\n ...this.workflow,\n steps\n }\n\n if (this.selectedStepIndex === index) {\n this.selectedStepIndex = -1\n } else if (this.selectedStepIndex > index) {\n this.selectedStepIndex--\n }\n }\n }\n\n moveStepUp(index: number) {\n if (index === 0) return\n\n const steps = [...this.workflow.steps]\n const temp = steps[index]\n steps[index] = steps[index - 1]\n steps[index - 1] = temp\n\n this.workflow = {\n ...this.workflow,\n steps\n }\n\n if (this.selectedStepIndex === index) {\n this.selectedStepIndex = index - 1\n } else if (this.selectedStepIndex === index - 1) {\n this.selectedStepIndex = index\n }\n }\n\n moveStepDown(index: number) {\n if (index === this.workflow.steps.length - 1) return\n\n const steps = [...this.workflow.steps]\n const temp = steps[index]\n steps[index] = steps[index + 1]\n steps[index + 1] = temp\n\n this.workflow = {\n ...this.workflow,\n steps\n }\n\n if (this.selectedStepIndex === index) {\n this.selectedStepIndex = index + 1\n } else if (this.selectedStepIndex === index + 1) {\n this.selectedStepIndex = index\n }\n }\n\n selectStep(index: number) {\n this.selectedStepIndex = index\n }\n\n updateStep(index: number, field: string, value: any) {\n const steps = [...this.workflow.steps]\n steps[index] = {\n ...steps[index],\n [field]: value\n }\n\n this.workflow = {\n ...this.workflow,\n steps\n }\n }\n\n updateWorkflow(field: string, value: any) {\n this.workflow = {\n ...this.workflow,\n [field]: value\n }\n }\n\n renderStepEditor() {\n if (this.selectedStepIndex === -1 || !this.workflow.steps[this.selectedStepIndex]) {\n return html` <div class=\"empty-state\">Select a step to edit its configuration</div> `\n }\n\n const step = this.workflow.steps[this.selectedStepIndex]\n\n return html`\n <div class=\"form-group\">\n <label>Step Name</label>\n <input\n type=\"text\"\n .value=${step.name}\n @input=${(e: any) => this.updateStep(this.selectedStepIndex, 'name', e.target.value)}\n />\n </div>\n\n <div class=\"form-group\">\n <label>Step Type</label>\n <select\n .value=${step.type}\n @change=${(e: any) => this.updateStep(this.selectedStepIndex, 'type', e.target.value)}\n >\n <option value=\"import_data\">Import Data</option>\n <option value=\"generate_predictions\">Generate Predictions</option>\n <option value=\"wait_for_annotations\">Wait for Annotations</option>\n <option value=\"sync_annotations\">Sync Annotations</option>\n <option value=\"validate_quality\">Validate Quality</option>\n <option value=\"export_results\">Export Results</option>\n <option value=\"notification\">Notification</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label>Configuration (JSON)</label>\n <textarea\n .value=${step.config}\n @input=${(e: any) => this.updateStep(this.selectedStepIndex, 'config', e.target.value)}\n placeholder='{\"key\": \"value\"}'\n ></textarea>\n </div>\n\n <div class=\"form-group\">\n <label>\n <input\n type=\"checkbox\"\n .checked=${step.continueOnError}\n @change=${(e: any) => this.updateStep(this.selectedStepIndex, 'continueOnError', e.target.checked)}\n />\n Continue on Error\n </label>\n </div>\n `\n }\n\n render() {\n if (this.loading) {\n return html`<div class=\"loading\">Loading...</div>`\n }\n\n return html`\n <div class=\"header\">\n <h1>${this.workflowId ? 'Edit Workflow' : 'Create Workflow'}</h1>\n <div class=\"header-actions\">\n <button class=\"secondary\" @click=${() => history.back()}>Cancel</button>\n <button @click=${this.saveWorkflow}>Save Workflow</button>\n </div>\n </div>\n\n ${this.error ? html`<div class=\"error\">${this.error}</div>` : ''}\n\n <div class=\"content\">\n <div class=\"sidebar\">\n <div class=\"form-group\">\n <label>Workflow Name *</label>\n <input\n type=\"text\"\n .value=${this.workflow.name}\n @input=${(e: any) => this.updateWorkflow('name', e.target.value)}\n placeholder=\"Enter workflow name\"\n required\n />\n </div>\n\n <div class=\"form-group\">\n <label>Description</label>\n <textarea\n .value=${this.workflow.description || ''}\n @input=${(e: any) => this.updateWorkflow('description', e.target.value)}\n placeholder=\"Enter workflow description\"\n ></textarea>\n </div>\n\n <div class=\"form-group\">\n <label>Project ID *</label>\n <input\n type=\"number\"\n .value=${this.workflow.projectId || ''}\n @input=${(e: any) => this.updateWorkflow('projectId', e.target.value)}\n placeholder=\"Label Studio project ID\"\n required\n />\n </div>\n\n <div class=\"form-group\">\n <label>Trigger Type</label>\n <select\n .value=${this.workflow.triggerType}\n @change=${(e: any) => this.updateWorkflow('triggerType', e.target.value)}\n >\n <option value=\"manual\">Manual</option>\n <option value=\"scheduled\">Scheduled</option>\n <option value=\"event\">Event-based</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label>\n <input\n type=\"checkbox\"\n .checked=${this.workflow.autoStart}\n @change=${(e: any) => this.updateWorkflow('autoStart', e.target.checked)}\n />\n Auto Start\n </label>\n </div>\n\n <div class=\"steps-container\">\n <div class=\"steps-header\">\n <h2>Workflow Steps</h2>\n </div>\n\n <div class=\"step-list\">\n ${this.workflow.steps.length === 0\n ? html`<div class=\"empty-state\">No steps added yet</div>`\n : this.workflow.steps.map(\n (step: any, index: number) => html`\n <div\n class=\"step-item ${this.selectedStepIndex === index ? 'selected' : ''}\"\n @click=${() => this.selectStep(index)}\n >\n <div class=\"step-header\">\n <div class=\"step-title\">${index + 1}. ${step.name}</div>\n <div class=\"step-actions\">\n ${index > 0\n ? html`<button\n @click=${(e: Event) => {\n e.stopPropagation()\n this.moveStepUp(index)\n }}\n >\n ↑\n </button>`\n : ''}\n ${index < this.workflow.steps.length - 1\n ? html`<button\n @click=${(e: Event) => {\n e.stopPropagation()\n this.moveStepDown(index)\n }}\n >\n ↓\n </button>`\n : ''}\n <button\n class=\"secondary\"\n @click=${(e: Event) => {\n e.stopPropagation()\n this.removeStep(index)\n }}\n >\n ×\n </button>\n </div>\n </div>\n <div class=\"step-type\">${step.type}</div>\n ${step.continueOnError ? html`<div class=\"step-config\">Continue on error: Yes</div>` : ''}\n </div>\n `\n )}\n </div>\n\n <button class=\"add-step-button\" @click=${this.addStep}>+ Add Step</button>\n </div>\n </div>\n\n <div class=\"main-area\">\n <h2>Step Configuration</h2>\n ${this.renderStepEditor()}\n </div>\n </div>\n `\n }\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { PageView } from '@operato/shell';
2
+ /**
3
+ * Workflow List Page
4
+ *
5
+ * Displays all labeling workflows with CRUD operations
6
+ */
7
+ export declare class LabelingWorkflowListPage extends PageView {
8
+ static styles: import("lit").CSSResult[];
9
+ workflows: any[];
10
+ loading: boolean;
11
+ filterStatus: string;
12
+ filterProjectId: string;
13
+ firstUpdated(): Promise<void>;
14
+ loadWorkflows(): Promise<void>;
15
+ createWorkflow(): void;
16
+ editWorkflow(workflowId: string, event: Event): void;
17
+ executeWorkflow(workflowId: string, event: Event): Promise<void>;
18
+ pauseWorkflow(workflowId: string, event: Event): Promise<void>;
19
+ resumeWorkflow(workflowId: string, event: Event): Promise<void>;
20
+ deleteWorkflow(workflowId: string, event: Event): Promise<void>;
21
+ getStatusClass(status: string): "status-active" | "status-draft" | "status-paused" | "status-completed" | "status-failed" | "";
22
+ get filteredWorkflows(): any[];
23
+ render(): import("lit-html").TemplateResult<1>;
24
+ }
@@ -0,0 +1,495 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LabelingWorkflowListPage = 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
+ const shell_2 = require("@operato/shell");
11
+ /**
12
+ * Workflow List Page
13
+ *
14
+ * Displays all labeling workflows with CRUD operations
15
+ */
16
+ let LabelingWorkflowListPage = class LabelingWorkflowListPage extends shell_1.PageView {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.workflows = [];
20
+ this.loading = true;
21
+ this.filterStatus = 'all';
22
+ this.filterProjectId = '';
23
+ }
24
+ static { this.styles = [
25
+ (0, lit_1.css) `
26
+ :host {
27
+ display: flex;
28
+ flex-direction: column;
29
+ padding: 20px;
30
+ background-color: var(--md-sys-color-surface);
31
+ }
32
+
33
+ .header {
34
+ display: flex;
35
+ justify-content: space-between;
36
+ align-items: center;
37
+ margin-bottom: 20px;
38
+ }
39
+
40
+ h1 {
41
+ font-size: 24px;
42
+ margin: 0;
43
+ color: var(--md-sys-color-on-surface);
44
+ }
45
+
46
+ .toolbar {
47
+ display: flex;
48
+ gap: 10px;
49
+ }
50
+
51
+ button {
52
+ padding: 10px 20px;
53
+ background-color: var(--md-sys-color-primary);
54
+ color: var(--md-sys-color-on-primary);
55
+ border: none;
56
+ border-radius: 4px;
57
+ cursor: pointer;
58
+ }
59
+
60
+ button:hover {
61
+ opacity: 0.9;
62
+ }
63
+
64
+ button.secondary {
65
+ background-color: var(--md-sys-color-secondary);
66
+ color: var(--md-sys-color-on-secondary);
67
+ }
68
+
69
+ .workflow-list {
70
+ display: grid;
71
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
72
+ gap: 20px;
73
+ }
74
+
75
+ .workflow-card {
76
+ background-color: var(--md-sys-color-surface-variant);
77
+ border-radius: 8px;
78
+ padding: 20px;
79
+ cursor: pointer;
80
+ transition:
81
+ transform 0.2s,
82
+ box-shadow 0.2s;
83
+ border: 1px solid var(--md-sys-color-outline);
84
+ }
85
+
86
+ .workflow-card:hover {
87
+ transform: translateY(-4px);
88
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
89
+ }
90
+
91
+ .workflow-header {
92
+ display: flex;
93
+ justify-content: space-between;
94
+ align-items: start;
95
+ margin-bottom: 10px;
96
+ }
97
+
98
+ .workflow-name {
99
+ font-size: 18px;
100
+ font-weight: bold;
101
+ margin-bottom: 5px;
102
+ color: var(--md-sys-color-on-surface);
103
+ }
104
+
105
+ .workflow-status {
106
+ display: inline-block;
107
+ padding: 4px 8px;
108
+ border-radius: 4px;
109
+ font-size: 12px;
110
+ font-weight: 500;
111
+ }
112
+
113
+ .status-active {
114
+ background-color: #4caf50;
115
+ color: white;
116
+ }
117
+
118
+ .status-draft {
119
+ background-color: #9e9e9e;
120
+ color: white;
121
+ }
122
+
123
+ .status-paused {
124
+ background-color: #ff9800;
125
+ color: white;
126
+ }
127
+
128
+ .status-completed {
129
+ background-color: #2196f3;
130
+ color: white;
131
+ }
132
+
133
+ .status-failed {
134
+ background-color: #f44336;
135
+ color: white;
136
+ }
137
+
138
+ .workflow-description {
139
+ font-size: 14px;
140
+ color: var(--md-sys-color-on-surface-variant);
141
+ margin-bottom: 10px;
142
+ overflow: hidden;
143
+ text-overflow: ellipsis;
144
+ display: -webkit-box;
145
+ -webkit-line-clamp: 2;
146
+ -webkit-box-orient: vertical;
147
+ }
148
+
149
+ .workflow-info {
150
+ font-size: 12px;
151
+ color: var(--md-sys-color-on-surface-variant);
152
+ margin-bottom: 5px;
153
+ }
154
+
155
+ .workflow-steps {
156
+ font-size: 12px;
157
+ color: var(--md-sys-color-on-surface-variant);
158
+ margin-top: 10px;
159
+ padding-top: 10px;
160
+ border-top: 1px solid var(--md-sys-color-outline);
161
+ }
162
+
163
+ .workflow-actions {
164
+ display: flex;
165
+ gap: 5px;
166
+ margin-top: 15px;
167
+ }
168
+
169
+ .workflow-actions button {
170
+ flex: 1;
171
+ padding: 8px;
172
+ font-size: 12px;
173
+ }
174
+
175
+ .loading {
176
+ text-align: center;
177
+ padding: 40px;
178
+ color: var(--md-sys-color-on-surface-variant);
179
+ }
180
+
181
+ .empty-state {
182
+ text-align: center;
183
+ padding: 60px 20px;
184
+ color: var(--md-sys-color-on-surface-variant);
185
+ }
186
+
187
+ .empty-state h2 {
188
+ font-size: 20px;
189
+ margin-bottom: 10px;
190
+ }
191
+
192
+ .empty-state p {
193
+ font-size: 14px;
194
+ margin-bottom: 20px;
195
+ }
196
+
197
+ .filter-bar {
198
+ display: flex;
199
+ gap: 10px;
200
+ margin-bottom: 20px;
201
+ align-items: center;
202
+ }
203
+
204
+ .filter-bar select,
205
+ .filter-bar input {
206
+ padding: 8px 12px;
207
+ border: 1px solid var(--md-sys-color-outline);
208
+ border-radius: 4px;
209
+ background-color: var(--md-sys-color-surface);
210
+ color: var(--md-sys-color-on-surface);
211
+ }
212
+
213
+ .filter-bar label {
214
+ font-size: 14px;
215
+ color: var(--md-sys-color-on-surface-variant);
216
+ }
217
+ `
218
+ ]; }
219
+ async firstUpdated() {
220
+ await this.loadWorkflows();
221
+ }
222
+ async loadWorkflows() {
223
+ this.loading = true;
224
+ try {
225
+ const response = await graphql_1.client.query({
226
+ query: (0, graphql_tag_1.default) `
227
+ query GetWorkflows($projectId: Int) {
228
+ labelingWorkflows(projectId: $projectId) {
229
+ items {
230
+ id
231
+ name
232
+ description
233
+ projectId
234
+ status
235
+ triggerType
236
+ steps {
237
+ name
238
+ type
239
+ }
240
+ createdAt
241
+ lastExecutedAt
242
+ }
243
+ }
244
+ }
245
+ `,
246
+ variables: this.filterProjectId ? { projectId: parseInt(this.filterProjectId) } : {}
247
+ });
248
+ this.workflows = response.data.labelingWorkflows.items || [];
249
+ }
250
+ catch (error) {
251
+ console.error('Failed to load workflows:', error);
252
+ alert('Failed to load workflows');
253
+ }
254
+ finally {
255
+ this.loading = false;
256
+ }
257
+ }
258
+ createWorkflow() {
259
+ (0, shell_2.navigate)('workflow-builder');
260
+ }
261
+ editWorkflow(workflowId, event) {
262
+ event.stopPropagation();
263
+ (0, shell_2.navigate)(`workflow-builder/${workflowId}`);
264
+ }
265
+ async executeWorkflow(workflowId, event) {
266
+ event.stopPropagation();
267
+ if (!confirm('Execute this workflow?'))
268
+ return;
269
+ try {
270
+ const response = await graphql_1.client.mutate({
271
+ mutation: (0, graphql_tag_1.default) `
272
+ mutation ExecuteWorkflow($workflowId: String!) {
273
+ executeLabelingWorkflow(input: { workflowId: $workflowId }) {
274
+ executionId
275
+ status
276
+ summary
277
+ }
278
+ }
279
+ `,
280
+ variables: { workflowId }
281
+ });
282
+ const result = response.data.executeLabelingWorkflow;
283
+ alert(`Workflow execution started!\nExecution ID: ${result.executionId}`);
284
+ await this.loadWorkflows();
285
+ }
286
+ catch (error) {
287
+ console.error('Failed to execute workflow:', error);
288
+ alert('Failed to execute workflow');
289
+ }
290
+ }
291
+ async pauseWorkflow(workflowId, event) {
292
+ event.stopPropagation();
293
+ if (!confirm('Pause this workflow?'))
294
+ return;
295
+ try {
296
+ await graphql_1.client.mutate({
297
+ mutation: (0, graphql_tag_1.default) `
298
+ mutation PauseWorkflow($workflowId: String!) {
299
+ pauseLabelingWorkflow(workflowId: $workflowId) {
300
+ id
301
+ status
302
+ }
303
+ }
304
+ `,
305
+ variables: { workflowId }
306
+ });
307
+ alert('Workflow paused successfully');
308
+ await this.loadWorkflows();
309
+ }
310
+ catch (error) {
311
+ console.error('Failed to pause workflow:', error);
312
+ alert('Failed to pause workflow');
313
+ }
314
+ }
315
+ async resumeWorkflow(workflowId, event) {
316
+ event.stopPropagation();
317
+ if (!confirm('Resume this workflow?'))
318
+ return;
319
+ try {
320
+ await graphql_1.client.mutate({
321
+ mutation: (0, graphql_tag_1.default) `
322
+ mutation ResumeWorkflow($workflowId: String!) {
323
+ resumeLabelingWorkflow(workflowId: $workflowId) {
324
+ id
325
+ status
326
+ }
327
+ }
328
+ `,
329
+ variables: { workflowId }
330
+ });
331
+ alert('Workflow resumed successfully');
332
+ await this.loadWorkflows();
333
+ }
334
+ catch (error) {
335
+ console.error('Failed to resume workflow:', error);
336
+ alert('Failed to resume workflow');
337
+ }
338
+ }
339
+ async deleteWorkflow(workflowId, event) {
340
+ event.stopPropagation();
341
+ if (!confirm('Are you sure you want to delete this workflow? This action cannot be undone.'))
342
+ return;
343
+ try {
344
+ await graphql_1.client.mutate({
345
+ mutation: (0, graphql_tag_1.default) `
346
+ mutation DeleteWorkflow($workflowId: String!) {
347
+ deleteLabelingWorkflow(workflowId: $workflowId)
348
+ }
349
+ `,
350
+ variables: { workflowId }
351
+ });
352
+ alert('Workflow deleted successfully');
353
+ await this.loadWorkflows();
354
+ }
355
+ catch (error) {
356
+ console.error('Failed to delete workflow:', error);
357
+ alert('Failed to delete workflow');
358
+ }
359
+ }
360
+ getStatusClass(status) {
361
+ switch (status?.toLowerCase()) {
362
+ case 'active':
363
+ return 'status-active';
364
+ case 'draft':
365
+ return 'status-draft';
366
+ case 'paused':
367
+ return 'status-paused';
368
+ case 'completed':
369
+ return 'status-completed';
370
+ case 'failed':
371
+ return 'status-failed';
372
+ default:
373
+ return '';
374
+ }
375
+ }
376
+ get filteredWorkflows() {
377
+ return this.workflows.filter(workflow => {
378
+ if (this.filterStatus !== 'all' && workflow.status !== this.filterStatus) {
379
+ return false;
380
+ }
381
+ return true;
382
+ });
383
+ }
384
+ render() {
385
+ if (this.loading) {
386
+ return (0, lit_1.html) `<div class="loading">Loading workflows...</div>`;
387
+ }
388
+ return (0, lit_1.html) `
389
+ <div class="header">
390
+ <h1>Labeling Workflows</h1>
391
+ <div class="toolbar">
392
+ <button @click=${this.createWorkflow}>Create Workflow</button>
393
+ <button class="secondary" @click=${this.loadWorkflows}>Refresh</button>
394
+ </div>
395
+ </div>
396
+
397
+ <div class="filter-bar">
398
+ <label>Status:</label>
399
+ <select
400
+ .value=${this.filterStatus}
401
+ @change=${(e) => {
402
+ this.filterStatus = e.target.value;
403
+ this.requestUpdate();
404
+ }}
405
+ >
406
+ <option value="all">All</option>
407
+ <option value="draft">Draft</option>
408
+ <option value="active">Active</option>
409
+ <option value="paused">Paused</option>
410
+ <option value="completed">Completed</option>
411
+ <option value="failed">Failed</option>
412
+ </select>
413
+
414
+ <label>Project ID:</label>
415
+ <input
416
+ type="number"
417
+ .value=${this.filterProjectId}
418
+ @input=${(e) => (this.filterProjectId = e.target.value)}
419
+ placeholder="Filter by project"
420
+ />
421
+ <button class="secondary" @click=${this.loadWorkflows}>Apply Filter</button>
422
+ </div>
423
+
424
+ ${this.filteredWorkflows.length === 0
425
+ ? (0, lit_1.html) `
426
+ <div class="empty-state">
427
+ <h2>No workflows found</h2>
428
+ <p>Create your first labeling workflow to get started</p>
429
+ <button @click=${this.createWorkflow}>Create Workflow</button>
430
+ </div>
431
+ `
432
+ : (0, lit_1.html) `
433
+ <div class="workflow-list">
434
+ ${this.filteredWorkflows.map(workflow => (0, lit_1.html) `
435
+ <div class="workflow-card">
436
+ <div class="workflow-header">
437
+ <div class="workflow-name">${workflow.name}</div>
438
+ <span class="workflow-status ${this.getStatusClass(workflow.status)}">${workflow.status}</span>
439
+ </div>
440
+
441
+ <div class="workflow-description">${workflow.description || 'No description'}</div>
442
+
443
+ <div class="workflow-info">Project ID: ${workflow.projectId}</div>
444
+ <div class="workflow-info">Trigger: ${workflow.triggerType}</div>
445
+ <div class="workflow-info">Created: ${new Date(workflow.createdAt).toLocaleDateString()}</div>
446
+ ${workflow.lastExecutedAt
447
+ ? (0, lit_1.html) `<div class="workflow-info">
448
+ Last executed: ${new Date(workflow.lastExecutedAt).toLocaleDateString()}
449
+ </div>`
450
+ : ''}
451
+
452
+ <div class="workflow-steps">${workflow.steps.length} steps configured</div>
453
+
454
+ <div class="workflow-actions">
455
+ <button @click=${(e) => this.editWorkflow(workflow.id, e)}>Edit</button>
456
+ <button @click=${(e) => this.executeWorkflow(workflow.id, e)}>Execute</button>
457
+ ${workflow.status === 'active'
458
+ ? (0, lit_1.html) `<button class="secondary" @click=${(e) => this.pauseWorkflow(workflow.id, e)}>
459
+ Pause
460
+ </button>`
461
+ : workflow.status === 'paused'
462
+ ? (0, lit_1.html) `<button @click=${(e) => this.resumeWorkflow(workflow.id, e)}>Resume</button>`
463
+ : ''}
464
+ <button class="secondary" @click=${(e) => this.deleteWorkflow(workflow.id, e)}>
465
+ Delete
466
+ </button>
467
+ </div>
468
+ </div>
469
+ `)}
470
+ </div>
471
+ `}
472
+ `;
473
+ }
474
+ };
475
+ exports.LabelingWorkflowListPage = LabelingWorkflowListPage;
476
+ tslib_1.__decorate([
477
+ (0, decorators_js_1.state)(),
478
+ tslib_1.__metadata("design:type", Array)
479
+ ], LabelingWorkflowListPage.prototype, "workflows", void 0);
480
+ tslib_1.__decorate([
481
+ (0, decorators_js_1.state)(),
482
+ tslib_1.__metadata("design:type", Boolean)
483
+ ], LabelingWorkflowListPage.prototype, "loading", void 0);
484
+ tslib_1.__decorate([
485
+ (0, decorators_js_1.state)(),
486
+ tslib_1.__metadata("design:type", String)
487
+ ], LabelingWorkflowListPage.prototype, "filterStatus", void 0);
488
+ tslib_1.__decorate([
489
+ (0, decorators_js_1.state)(),
490
+ tslib_1.__metadata("design:type", String)
491
+ ], LabelingWorkflowListPage.prototype, "filterProjectId", void 0);
492
+ exports.LabelingWorkflowListPage = LabelingWorkflowListPage = tslib_1.__decorate([
493
+ (0, decorators_js_1.customElement)('labeling-workflow-list-page')
494
+ ], LabelingWorkflowListPage);
495
+ //# sourceMappingURL=labeling-workflow-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labeling-workflow-list.js","sourceRoot":"","sources":["../../client/pages/labeling-workflow-list.ts"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qDAAwD;AACxD,0CAAyC;AACzC,8CAAyC;AACzC,sEAA6B;AAC7B,0CAAyC;AAEzC;;;;GAIG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ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A,kBAAkB,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,kBAAkB;oBAC3F,CAAC,CAAC,EAAE;yDAC2B,CAAC,CAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;;;;;iBAKzF,CACF;;WAEJ;KACN,CAAA;IACH,CAAC;;AAxdU,4DAAwB;AAqM1B;IAAR,IAAA,qBAAK,GAAE;;2DAAsB;AACrB;IAAR,IAAA,qBAAK,GAAE;;yDAAwB;AACvB;IAAR,IAAA,qBAAK,GAAE;;8DAA6B;AAC5B;IAAR,IAAA,qBAAK,GAAE;;iEAA6B;mCAxM1B,wBAAwB;IADpC,IAAA,6BAAa,EAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAydpC","sourcesContent":["import { html, css } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { PageView } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\nimport { navigate } from '@operato/shell'\n\n/**\n * Workflow List Page\n *\n * Displays all labeling workflows with CRUD operations\n */\n@customElement('labeling-workflow-list-page')\nexport class LabelingWorkflowListPage extends PageView {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n padding: 20px;\n background-color: var(--md-sys-color-surface);\n }\n\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 20px;\n }\n\n h1 {\n font-size: 24px;\n margin: 0;\n color: var(--md-sys-color-on-surface);\n }\n\n .toolbar {\n display: flex;\n gap: 10px;\n }\n\n button {\n padding: 10px 20px;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n button:hover {\n opacity: 0.9;\n }\n\n button.secondary {\n background-color: var(--md-sys-color-secondary);\n color: var(--md-sys-color-on-secondary);\n }\n\n .workflow-list {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 20px;\n }\n\n .workflow-card {\n background-color: var(--md-sys-color-surface-variant);\n border-radius: 8px;\n padding: 20px;\n cursor: pointer;\n transition:\n transform 0.2s,\n box-shadow 0.2s;\n border: 1px solid var(--md-sys-color-outline);\n }\n\n .workflow-card:hover {\n transform: translateY(-4px);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n }\n\n .workflow-header {\n display: flex;\n justify-content: space-between;\n align-items: start;\n margin-bottom: 10px;\n }\n\n .workflow-name {\n font-size: 18px;\n font-weight: bold;\n margin-bottom: 5px;\n color: var(--md-sys-color-on-surface);\n }\n\n .workflow-status {\n display: inline-block;\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n }\n\n .status-active {\n background-color: #4caf50;\n color: white;\n }\n\n .status-draft {\n background-color: #9e9e9e;\n color: white;\n }\n\n .status-paused {\n background-color: #ff9800;\n color: white;\n }\n\n .status-completed {\n background-color: #2196f3;\n color: white;\n }\n\n .status-failed {\n background-color: #f44336;\n color: white;\n }\n\n .workflow-description {\n font-size: 14px;\n color: var(--md-sys-color-on-surface-variant);\n margin-bottom: 10px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n\n .workflow-info {\n font-size: 12px;\n color: var(--md-sys-color-on-surface-variant);\n margin-bottom: 5px;\n }\n\n .workflow-steps {\n font-size: 12px;\n color: var(--md-sys-color-on-surface-variant);\n margin-top: 10px;\n padding-top: 10px;\n border-top: 1px solid var(--md-sys-color-outline);\n }\n\n .workflow-actions {\n display: flex;\n gap: 5px;\n margin-top: 15px;\n }\n\n .workflow-actions button {\n flex: 1;\n padding: 8px;\n font-size: 12px;\n }\n\n .loading {\n text-align: center;\n padding: 40px;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n .empty-state {\n text-align: center;\n padding: 60px 20px;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n .empty-state h2 {\n font-size: 20px;\n margin-bottom: 10px;\n }\n\n .empty-state p {\n font-size: 14px;\n margin-bottom: 20px;\n }\n\n .filter-bar {\n display: flex;\n gap: 10px;\n margin-bottom: 20px;\n align-items: center;\n }\n\n .filter-bar select,\n .filter-bar input {\n padding: 8px 12px;\n border: 1px solid var(--md-sys-color-outline);\n border-radius: 4px;\n background-color: var(--md-sys-color-surface);\n color: var(--md-sys-color-on-surface);\n }\n\n .filter-bar label {\n font-size: 14px;\n color: var(--md-sys-color-on-surface-variant);\n }\n `\n ]\n\n @state() workflows: any[] = []\n @state() loading: boolean = true\n @state() filterStatus: string = 'all'\n @state() filterProjectId: string = ''\n\n async firstUpdated() {\n await this.loadWorkflows()\n }\n\n async loadWorkflows() {\n this.loading = true\n try {\n const response = await client.query({\n query: gql`\n query GetWorkflows($projectId: Int) {\n labelingWorkflows(projectId: $projectId) {\n items {\n id\n name\n description\n projectId\n status\n triggerType\n steps {\n name\n type\n }\n createdAt\n lastExecutedAt\n }\n }\n }\n `,\n variables: this.filterProjectId ? { projectId: parseInt(this.filterProjectId) } : {}\n })\n\n this.workflows = response.data.labelingWorkflows.items || []\n } catch (error) {\n console.error('Failed to load workflows:', error)\n alert('Failed to load workflows')\n } finally {\n this.loading = false\n }\n }\n\n createWorkflow() {\n navigate('workflow-builder')\n }\n\n editWorkflow(workflowId: string, event: Event) {\n event.stopPropagation()\n navigate(`workflow-builder/${workflowId}`)\n }\n\n async executeWorkflow(workflowId: string, event: Event) {\n event.stopPropagation()\n\n if (!confirm('Execute this workflow?')) return\n\n try {\n const response = await client.mutate({\n mutation: gql`\n mutation ExecuteWorkflow($workflowId: String!) {\n executeLabelingWorkflow(input: { workflowId: $workflowId }) {\n executionId\n status\n summary\n }\n }\n `,\n variables: { workflowId }\n })\n\n const result = response.data.executeLabelingWorkflow\n alert(`Workflow execution started!\\nExecution ID: ${result.executionId}`)\n await this.loadWorkflows()\n } catch (error) {\n console.error('Failed to execute workflow:', error)\n alert('Failed to execute workflow')\n }\n }\n\n async pauseWorkflow(workflowId: string, event: Event) {\n event.stopPropagation()\n\n if (!confirm('Pause this workflow?')) return\n\n try {\n await client.mutate({\n mutation: gql`\n mutation PauseWorkflow($workflowId: String!) {\n pauseLabelingWorkflow(workflowId: $workflowId) {\n id\n status\n }\n }\n `,\n variables: { workflowId }\n })\n\n alert('Workflow paused successfully')\n await this.loadWorkflows()\n } catch (error) {\n console.error('Failed to pause workflow:', error)\n alert('Failed to pause workflow')\n }\n }\n\n async resumeWorkflow(workflowId: string, event: Event) {\n event.stopPropagation()\n\n if (!confirm('Resume this workflow?')) return\n\n try {\n await client.mutate({\n mutation: gql`\n mutation ResumeWorkflow($workflowId: String!) {\n resumeLabelingWorkflow(workflowId: $workflowId) {\n id\n status\n }\n }\n `,\n variables: { workflowId }\n })\n\n alert('Workflow resumed successfully')\n await this.loadWorkflows()\n } catch (error) {\n console.error('Failed to resume workflow:', error)\n alert('Failed to resume workflow')\n }\n }\n\n async deleteWorkflow(workflowId: string, event: Event) {\n event.stopPropagation()\n\n if (!confirm('Are you sure you want to delete this workflow? This action cannot be undone.')) return\n\n try {\n await client.mutate({\n mutation: gql`\n mutation DeleteWorkflow($workflowId: String!) {\n deleteLabelingWorkflow(workflowId: $workflowId)\n }\n `,\n variables: { workflowId }\n })\n\n alert('Workflow deleted successfully')\n await this.loadWorkflows()\n } catch (error) {\n console.error('Failed to delete workflow:', error)\n alert('Failed to delete workflow')\n }\n }\n\n getStatusClass(status: string) {\n switch (status?.toLowerCase()) {\n case 'active':\n return 'status-active'\n case 'draft':\n return 'status-draft'\n case 'paused':\n return 'status-paused'\n case 'completed':\n return 'status-completed'\n case 'failed':\n return 'status-failed'\n default:\n return ''\n }\n }\n\n get filteredWorkflows() {\n return this.workflows.filter(workflow => {\n if (this.filterStatus !== 'all' && workflow.status !== this.filterStatus) {\n return false\n }\n return true\n })\n }\n\n render() {\n if (this.loading) {\n return html`<div class=\"loading\">Loading workflows...</div>`\n }\n\n return html`\n <div class=\"header\">\n <h1>Labeling Workflows</h1>\n <div class=\"toolbar\">\n <button @click=${this.createWorkflow}>Create Workflow</button>\n <button class=\"secondary\" @click=${this.loadWorkflows}>Refresh</button>\n </div>\n </div>\n\n <div class=\"filter-bar\">\n <label>Status:</label>\n <select\n .value=${this.filterStatus}\n @change=${(e: any) => {\n this.filterStatus = e.target.value\n this.requestUpdate()\n }}\n >\n <option value=\"all\">All</option>\n <option value=\"draft\">Draft</option>\n <option value=\"active\">Active</option>\n <option value=\"paused\">Paused</option>\n <option value=\"completed\">Completed</option>\n <option value=\"failed\">Failed</option>\n </select>\n\n <label>Project ID:</label>\n <input\n type=\"number\"\n .value=${this.filterProjectId}\n @input=${(e: any) => (this.filterProjectId = e.target.value)}\n placeholder=\"Filter by project\"\n />\n <button class=\"secondary\" @click=${this.loadWorkflows}>Apply Filter</button>\n </div>\n\n ${this.filteredWorkflows.length === 0\n ? html`\n <div class=\"empty-state\">\n <h2>No workflows found</h2>\n <p>Create your first labeling workflow to get started</p>\n <button @click=${this.createWorkflow}>Create Workflow</button>\n </div>\n `\n : html`\n <div class=\"workflow-list\">\n ${this.filteredWorkflows.map(\n workflow => html`\n <div class=\"workflow-card\">\n <div class=\"workflow-header\">\n <div class=\"workflow-name\">${workflow.name}</div>\n <span class=\"workflow-status ${this.getStatusClass(workflow.status)}\">${workflow.status}</span>\n </div>\n\n <div class=\"workflow-description\">${workflow.description || 'No description'}</div>\n\n <div class=\"workflow-info\">Project ID: ${workflow.projectId}</div>\n <div class=\"workflow-info\">Trigger: ${workflow.triggerType}</div>\n <div class=\"workflow-info\">Created: ${new Date(workflow.createdAt).toLocaleDateString()}</div>\n ${workflow.lastExecutedAt\n ? html`<div class=\"workflow-info\">\n Last executed: ${new Date(workflow.lastExecutedAt).toLocaleDateString()}\n </div>`\n : ''}\n\n <div class=\"workflow-steps\">${workflow.steps.length} steps configured</div>\n\n <div class=\"workflow-actions\">\n <button @click=${(e: Event) => this.editWorkflow(workflow.id, e)}>Edit</button>\n <button @click=${(e: Event) => this.executeWorkflow(workflow.id, e)}>Execute</button>\n ${workflow.status === 'active'\n ? html`<button class=\"secondary\" @click=${(e: Event) => this.pauseWorkflow(workflow.id, e)}>\n Pause\n </button>`\n : workflow.status === 'paused'\n ? html`<button @click=${(e: Event) => this.resumeWorkflow(workflow.id, e)}>Resume</button>`\n : ''}\n <button class=\"secondary\" @click=${(e: Event) => this.deleteWorkflow(workflow.id, e)}>\n Delete\n </button>\n </div>\n </div>\n `\n )}\n </div>\n `}\n `\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export default function route(page: string): "labeling-workflows" | "labeling-workflow-builder";