@things-factory/operato-dataset 9.1.18 → 9.1.19
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/LABELING_INTEGRATION.md +584 -0
- package/dist-client/menu.d.ts +9 -0
- package/dist-client/menu.js +27 -0
- package/dist-client/menu.js.map +1 -1
- package/dist-client/pages/dataset-labeling-workflow-list.d.ts +18 -0
- package/dist-client/pages/dataset-labeling-workflow-list.js +283 -0
- package/dist-client/pages/dataset-labeling-workflow-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -2
- package/dist-server/index.js +3 -2
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -1
- package/dist-server/service/index.js +3 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/labeling/dataset-labeling-workflow.d.ts +54 -0
- package/dist-server/service/labeling/dataset-labeling-workflow.js +264 -0
- package/dist-server/service/labeling/dataset-labeling-workflow.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -40
- package/schema.graphql +1592 -0
- package/things-factory.config.js +1 -1
- package/translations/en.json +1 -1
- package/translations/ja.json +1 -1
- package/translations/ko.json +1 -1
- package/translations/ms.json +1 -1
- package/translations/zh.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PageView } from '@operato/shell';
|
|
2
|
+
/**
|
|
3
|
+
* Labeling Workflow List Page
|
|
4
|
+
*
|
|
5
|
+
* DataSet의 labeling workflow 목록을 보여주는 페이지
|
|
6
|
+
*/
|
|
7
|
+
export declare class DatasetLabelingWorkflowListPage extends PageView {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
workflows: any[];
|
|
10
|
+
loading: boolean;
|
|
11
|
+
firstUpdated(): Promise<void>;
|
|
12
|
+
loadWorkflows(): Promise<void>;
|
|
13
|
+
createAutoWorkflow(): Promise<void>;
|
|
14
|
+
createQuickWorkflow(): Promise<void>;
|
|
15
|
+
executeWorkflow(workflowId: string): Promise<void>;
|
|
16
|
+
getStatusClass(status: string): "status-active" | "status-draft" | "status-paused" | "";
|
|
17
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
import { PageView } from '@operato/shell';
|
|
5
|
+
import { client } from '@operato/graphql';
|
|
6
|
+
import gql from 'graphql-tag';
|
|
7
|
+
/**
|
|
8
|
+
* Labeling Workflow List Page
|
|
9
|
+
*
|
|
10
|
+
* DataSet의 labeling workflow 목록을 보여주는 페이지
|
|
11
|
+
*/
|
|
12
|
+
let DatasetLabelingWorkflowListPage = class DatasetLabelingWorkflowListPage extends PageView {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.workflows = [];
|
|
16
|
+
this.loading = true;
|
|
17
|
+
}
|
|
18
|
+
static { this.styles = [
|
|
19
|
+
css `
|
|
20
|
+
:host {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
padding: 20px;
|
|
24
|
+
background-color: var(--md-sys-color-surface);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h1 {
|
|
28
|
+
font-size: 24px;
|
|
29
|
+
margin-bottom: 20px;
|
|
30
|
+
color: var(--md-sys-color-on-surface);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.toolbar {
|
|
34
|
+
display: flex;
|
|
35
|
+
gap: 10px;
|
|
36
|
+
margin-bottom: 20px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
button {
|
|
40
|
+
padding: 10px 20px;
|
|
41
|
+
background-color: var(--md-sys-color-primary);
|
|
42
|
+
color: var(--md-sys-color-on-primary);
|
|
43
|
+
border: none;
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
button:hover {
|
|
49
|
+
opacity: 0.9;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.workflow-list {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 10px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.workflow-item {
|
|
59
|
+
padding: 15px;
|
|
60
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
61
|
+
border-radius: 8px;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
transition: transform 0.2s;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.workflow-item:hover {
|
|
67
|
+
transform: translateY(-2px);
|
|
68
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.workflow-name {
|
|
72
|
+
font-size: 18px;
|
|
73
|
+
font-weight: bold;
|
|
74
|
+
margin-bottom: 5px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.workflow-info {
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.workflow-status {
|
|
83
|
+
display: inline-block;
|
|
84
|
+
padding: 4px 8px;
|
|
85
|
+
border-radius: 4px;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
margin-left: 10px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.status-active {
|
|
91
|
+
background-color: #4caf50;
|
|
92
|
+
color: white;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.status-draft {
|
|
96
|
+
background-color: #9e9e9e;
|
|
97
|
+
color: white;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.status-paused {
|
|
101
|
+
background-color: #ff9800;
|
|
102
|
+
color: white;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.loading {
|
|
106
|
+
text-align: center;
|
|
107
|
+
padding: 40px;
|
|
108
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
109
|
+
}
|
|
110
|
+
`
|
|
111
|
+
]; }
|
|
112
|
+
async firstUpdated() {
|
|
113
|
+
await this.loadWorkflows();
|
|
114
|
+
}
|
|
115
|
+
async loadWorkflows() {
|
|
116
|
+
this.loading = true;
|
|
117
|
+
try {
|
|
118
|
+
const response = await client.query({
|
|
119
|
+
query: gql `
|
|
120
|
+
query {
|
|
121
|
+
datasetLabelingWorkflows {
|
|
122
|
+
id
|
|
123
|
+
name
|
|
124
|
+
description
|
|
125
|
+
projectId
|
|
126
|
+
status
|
|
127
|
+
triggerType
|
|
128
|
+
createdAt
|
|
129
|
+
lastExecutedAt
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
`
|
|
133
|
+
});
|
|
134
|
+
this.workflows = response.data.datasetLabelingWorkflows || [];
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
console.error('Failed to load workflows:', error);
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
this.loading = false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async createAutoWorkflow() {
|
|
144
|
+
const dataSetId = prompt('Enter DataSet ID:');
|
|
145
|
+
const projectId = prompt('Enter Label Studio Project ID:');
|
|
146
|
+
const workflowName = prompt('Enter Workflow Name:');
|
|
147
|
+
if (!dataSetId || !projectId || !workflowName)
|
|
148
|
+
return;
|
|
149
|
+
try {
|
|
150
|
+
await client.mutate({
|
|
151
|
+
mutation: gql `
|
|
152
|
+
mutation CreateWorkflow($dataSetId: String!, $projectId: Int!, $workflowName: String!) {
|
|
153
|
+
createDatasetLabelingWorkflow(
|
|
154
|
+
dataSetId: $dataSetId
|
|
155
|
+
projectId: $projectId
|
|
156
|
+
workflowName: $workflowName
|
|
157
|
+
autoStart: false
|
|
158
|
+
) {
|
|
159
|
+
id
|
|
160
|
+
name
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`,
|
|
164
|
+
variables: { dataSetId, projectId: parseInt(projectId), workflowName }
|
|
165
|
+
});
|
|
166
|
+
alert('Workflow created successfully!');
|
|
167
|
+
await this.loadWorkflows();
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
console.error('Failed to create workflow:', error);
|
|
171
|
+
alert('Failed to create workflow');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async createQuickWorkflow() {
|
|
175
|
+
const dataSetId = prompt('Enter DataSet ID:');
|
|
176
|
+
const projectId = prompt('Enter Label Studio Project ID:');
|
|
177
|
+
const workflowName = prompt('Enter Workflow Name:');
|
|
178
|
+
if (!dataSetId || !projectId || !workflowName)
|
|
179
|
+
return;
|
|
180
|
+
try {
|
|
181
|
+
await client.mutate({
|
|
182
|
+
mutation: gql `
|
|
183
|
+
mutation CreateQuickWorkflow($dataSetId: String!, $projectId: Int!, $workflowName: String!) {
|
|
184
|
+
createQuickLabelingWorkflow(dataSetId: $dataSetId, projectId: $projectId, workflowName: $workflowName) {
|
|
185
|
+
id
|
|
186
|
+
name
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`,
|
|
190
|
+
variables: { dataSetId, projectId: parseInt(projectId), workflowName }
|
|
191
|
+
});
|
|
192
|
+
alert('Quick workflow created successfully!');
|
|
193
|
+
await this.loadWorkflows();
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
console.error('Failed to create quick workflow:', error);
|
|
197
|
+
alert('Failed to create quick workflow');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
async executeWorkflow(workflowId) {
|
|
201
|
+
if (!confirm('Execute this workflow?'))
|
|
202
|
+
return;
|
|
203
|
+
try {
|
|
204
|
+
await client.mutate({
|
|
205
|
+
mutation: gql `
|
|
206
|
+
mutation ExecuteWorkflow($workflowId: String!) {
|
|
207
|
+
executeDatasetWorkflow(workflowId: $workflowId) {
|
|
208
|
+
executionId
|
|
209
|
+
status
|
|
210
|
+
summary
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`,
|
|
214
|
+
variables: { workflowId }
|
|
215
|
+
});
|
|
216
|
+
alert('Workflow execution started!');
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
console.error('Failed to execute workflow:', error);
|
|
220
|
+
alert('Failed to execute workflow');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
getStatusClass(status) {
|
|
224
|
+
switch (status?.toLowerCase()) {
|
|
225
|
+
case 'active':
|
|
226
|
+
return 'status-active';
|
|
227
|
+
case 'draft':
|
|
228
|
+
return 'status-draft';
|
|
229
|
+
case 'paused':
|
|
230
|
+
return 'status-paused';
|
|
231
|
+
default:
|
|
232
|
+
return '';
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
render() {
|
|
236
|
+
if (this.loading) {
|
|
237
|
+
return html `<div class="loading">Loading workflows...</div>`;
|
|
238
|
+
}
|
|
239
|
+
return html `
|
|
240
|
+
<h1>Labeling Workflows</h1>
|
|
241
|
+
|
|
242
|
+
<div class="toolbar">
|
|
243
|
+
<button @click=${this.createAutoWorkflow}>Create Auto Workflow</button>
|
|
244
|
+
<button @click=${this.createQuickWorkflow}>Create Quick Workflow</button>
|
|
245
|
+
<button @click=${this.loadWorkflows}>Refresh</button>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<div class="workflow-list">
|
|
249
|
+
${this.workflows.length === 0
|
|
250
|
+
? html `<div class="loading">No workflows found</div>`
|
|
251
|
+
: this.workflows.map(workflow => html `
|
|
252
|
+
<div class="workflow-item" @click=${() => this.executeWorkflow(workflow.id)}>
|
|
253
|
+
<div class="workflow-name">
|
|
254
|
+
${workflow.name}
|
|
255
|
+
<span class="workflow-status ${this.getStatusClass(workflow.status)}">${workflow.status}</span>
|
|
256
|
+
</div>
|
|
257
|
+
<div class="workflow-info">Project ID: ${workflow.projectId} | Trigger: ${workflow.triggerType}</div>
|
|
258
|
+
<div class="workflow-info">${workflow.description || 'No description'}</div>
|
|
259
|
+
<div class="workflow-info">
|
|
260
|
+
Created: ${new Date(workflow.createdAt).toLocaleDateString()}
|
|
261
|
+
${workflow.lastExecutedAt
|
|
262
|
+
? ` | Last executed: ${new Date(workflow.lastExecutedAt).toLocaleDateString()}`
|
|
263
|
+
: ''}
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
`)}
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
__decorate([
|
|
272
|
+
state(),
|
|
273
|
+
__metadata("design:type", Array)
|
|
274
|
+
], DatasetLabelingWorkflowListPage.prototype, "workflows", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
state(),
|
|
277
|
+
__metadata("design:type", Boolean)
|
|
278
|
+
], DatasetLabelingWorkflowListPage.prototype, "loading", void 0);
|
|
279
|
+
DatasetLabelingWorkflowListPage = __decorate([
|
|
280
|
+
customElement('dataset-labeling-workflow-list-page')
|
|
281
|
+
], DatasetLabelingWorkflowListPage);
|
|
282
|
+
export { DatasetLabelingWorkflowListPage };
|
|
283
|
+
//# sourceMappingURL=dataset-labeling-workflow-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset-labeling-workflow-list.js","sourceRoot":"","sources":["../../client/pages/dataset-labeling-workflow-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B;;;;GAIG;AAEI,IAAM,+BAA+B,GAAr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+BAExD,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE;sBAC1D,QAAQ,CAAC,cAAc;gBACvB,CAAC,CAAC,qBAAqB,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,kBAAkB,EAAE,EAAE;gBAC/E,CAAC,CAAC,EAAE;;;eAGX,CACF;;KAER,CAAA;IACH,CAAC;;AA1KQ;IAAR,KAAK,EAAE;;kEAAsB;AACrB;IAAR,KAAK,EAAE;;gEAAwB;AAjGrB,+BAA+B;IAD3C,aAAa,CAAC,qCAAqC,CAAC;GACxC,+BAA+B,CA2Q3C","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'\n\n/**\n * Labeling Workflow List Page\n *\n * DataSet의 labeling workflow 목록을 보여주는 페이지\n */\n@customElement('dataset-labeling-workflow-list-page')\nexport class DatasetLabelingWorkflowListPage 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 h1 {\n font-size: 24px;\n margin-bottom: 20px;\n color: var(--md-sys-color-on-surface);\n }\n\n .toolbar {\n display: flex;\n gap: 10px;\n margin-bottom: 20px;\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 .workflow-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .workflow-item {\n padding: 15px;\n background-color: var(--md-sys-color-surface-variant);\n border-radius: 8px;\n cursor: pointer;\n transition: transform 0.2s;\n }\n\n .workflow-item:hover {\n transform: translateY(-2px);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n }\n\n .workflow-name {\n font-size: 18px;\n font-weight: bold;\n margin-bottom: 5px;\n }\n\n .workflow-info {\n font-size: 14px;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n .workflow-status {\n display: inline-block;\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n margin-left: 10px;\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 .loading {\n text-align: center;\n padding: 40px;\n color: var(--md-sys-color-on-surface-variant);\n }\n `\n ]\n\n @state() workflows: any[] = []\n @state() loading: boolean = true\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 {\n datasetLabelingWorkflows {\n id\n name\n description\n projectId\n status\n triggerType\n createdAt\n lastExecutedAt\n }\n }\n `\n })\n\n this.workflows = response.data.datasetLabelingWorkflows || []\n } catch (error) {\n console.error('Failed to load workflows:', error)\n } finally {\n this.loading = false\n }\n }\n\n async createAutoWorkflow() {\n const dataSetId = prompt('Enter DataSet ID:')\n const projectId = prompt('Enter Label Studio Project ID:')\n const workflowName = prompt('Enter Workflow Name:')\n\n if (!dataSetId || !projectId || !workflowName) return\n\n try {\n await client.mutate({\n mutation: gql`\n mutation CreateWorkflow($dataSetId: String!, $projectId: Int!, $workflowName: String!) {\n createDatasetLabelingWorkflow(\n dataSetId: $dataSetId\n projectId: $projectId\n workflowName: $workflowName\n autoStart: false\n ) {\n id\n name\n }\n }\n `,\n variables: { dataSetId, projectId: parseInt(projectId), workflowName }\n })\n\n alert('Workflow created successfully!')\n await this.loadWorkflows()\n } catch (error) {\n console.error('Failed to create workflow:', error)\n alert('Failed to create workflow')\n }\n }\n\n async createQuickWorkflow() {\n const dataSetId = prompt('Enter DataSet ID:')\n const projectId = prompt('Enter Label Studio Project ID:')\n const workflowName = prompt('Enter Workflow Name:')\n\n if (!dataSetId || !projectId || !workflowName) return\n\n try {\n await client.mutate({\n mutation: gql`\n mutation CreateQuickWorkflow($dataSetId: String!, $projectId: Int!, $workflowName: String!) {\n createQuickLabelingWorkflow(dataSetId: $dataSetId, projectId: $projectId, workflowName: $workflowName) {\n id\n name\n }\n }\n `,\n variables: { dataSetId, projectId: parseInt(projectId), workflowName }\n })\n\n alert('Quick workflow created successfully!')\n await this.loadWorkflows()\n } catch (error) {\n console.error('Failed to create quick workflow:', error)\n alert('Failed to create quick workflow')\n }\n }\n\n async executeWorkflow(workflowId: string) {\n if (!confirm('Execute this workflow?')) return\n\n try {\n await client.mutate({\n mutation: gql`\n mutation ExecuteWorkflow($workflowId: String!) {\n executeDatasetWorkflow(workflowId: $workflowId) {\n executionId\n status\n summary\n }\n }\n `,\n variables: { workflowId }\n })\n\n alert('Workflow execution started!')\n } catch (error) {\n console.error('Failed to execute workflow:', error)\n alert('Failed to execute 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 default:\n return ''\n }\n }\n\n render() {\n if (this.loading) {\n return html`<div class=\"loading\">Loading workflows...</div>`\n }\n\n return html`\n <h1>Labeling Workflows</h1>\n\n <div class=\"toolbar\">\n <button @click=${this.createAutoWorkflow}>Create Auto Workflow</button>\n <button @click=${this.createQuickWorkflow}>Create Quick Workflow</button>\n <button @click=${this.loadWorkflows}>Refresh</button>\n </div>\n\n <div class=\"workflow-list\">\n ${this.workflows.length === 0\n ? html`<div class=\"loading\">No workflows found</div>`\n : this.workflows.map(\n workflow => html`\n <div class=\"workflow-item\" @click=${() => this.executeWorkflow(workflow.id)}>\n <div class=\"workflow-name\">\n ${workflow.name}\n <span class=\"workflow-status ${this.getStatusClass(workflow.status)}\">${workflow.status}</span>\n </div>\n <div class=\"workflow-info\">Project ID: ${workflow.projectId} | Trigger: ${workflow.triggerType}</div>\n <div class=\"workflow-info\">${workflow.description || 'No description'}</div>\n <div class=\"workflow-info\">\n Created: ${new Date(workflow.createdAt).toLocaleDateString()}\n ${workflow.lastExecutedAt\n ? ` | Last executed: ${new Date(workflow.lastExecutedAt).toLocaleDateString()}`\n : ''}\n </div>\n </div>\n `\n )}\n </div>\n `\n }\n}\n"]}
|
package/dist-client/route.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function route(page: string): "/todo-list" | undefined;
|
|
1
|
+
export default function route(page: string): "dataset-labeling-workflows" | "/todo-list" | undefined;
|
package/dist-client/route.js
CHANGED
package/dist-client/route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,EAAE;YACL,OAAO,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,EAAE;YACL,OAAO,YAAY,CAAA;QAErB,KAAK,4BAA4B;YAC/B,MAAM,CAAC,2CAA2C,CAAC,CAAA;YACnD,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case '':\n return '/todo-list'\n\n case 'dataset-labeling-workflows':\n import('./pages/dataset-labeling-workflow-list.js')\n return page\n }\n}\n"]}
|