@things-factory/integration-ui 9.1.18 → 10.0.0-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/client/pages/connection.ts +209 -326
- package/client/pages/scenario.ts +260 -408
- package/client/pages/state-register.ts +117 -181
- package/client/viewparts/scenario-instance-log-view.ts +1 -4
- package/client/viewparts/scenario-instance-view.ts +5 -9
- package/dist-client/pages/connection.d.ts +0 -6
- package/dist-client/pages/connection.js +91 -172
- package/dist-client/pages/connection.js.map +1 -1
- package/dist-client/pages/scenario.d.ts +0 -6
- package/dist-client/pages/scenario.js +113 -212
- package/dist-client/pages/scenario.js.map +1 -1
- package/dist-client/pages/state-register.d.ts +0 -6
- package/dist-client/pages/state-register.js +55 -105
- package/dist-client/pages/state-register.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/scenario-instance-log-view.d.ts +1 -9
- package/dist-client/viewparts/scenario-instance-log-view.js +1 -3
- package/dist-client/viewparts/scenario-instance-log-view.js.map +1 -1
- package/dist-client/viewparts/scenario-instance-view.d.ts +2 -11
- package/dist-client/viewparts/scenario-instance-view.js +7 -11
- package/dist-client/viewparts/scenario-instance-view.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
|
@@ -4,13 +4,12 @@ import './connection-importer.js';
|
|
|
4
4
|
import gql from 'graphql-tag';
|
|
5
5
|
import { css, html } from 'lit';
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
7
|
-
import { connect } from 'pwa-helpers/connect-mixin';
|
|
8
7
|
import { DataGrist } from '@operato/data-grist/ox-grist.js';
|
|
9
8
|
import { client } from '@operato/graphql';
|
|
10
9
|
import { HelpDecoratedRenderer } from '@operato/help/help-decorated-renderer.js';
|
|
11
10
|
import { notify, openPopup } from '@operato/layout';
|
|
12
11
|
import { i18next, localize } from '@operato/i18n';
|
|
13
|
-
import { PageView
|
|
12
|
+
import { PageView } from '@operato/shell';
|
|
14
13
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
15
14
|
import { isMobileDevice } from '@operato/utils';
|
|
16
15
|
import { p13n } from '@operato/p13n';
|
|
@@ -18,8 +17,7 @@ async function copyToClipboard(text) {
|
|
|
18
17
|
try {
|
|
19
18
|
await navigator.clipboard.writeText(text);
|
|
20
19
|
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
// fallback: old way
|
|
20
|
+
catch (err) { // fallback: old way
|
|
23
21
|
const textArea = document.createElement('textarea');
|
|
24
22
|
textArea.value = text;
|
|
25
23
|
document.body.appendChild(textArea);
|
|
@@ -53,7 +51,7 @@ function createActionInjector(connectionName) {
|
|
|
53
51
|
return copyIcon;
|
|
54
52
|
};
|
|
55
53
|
}
|
|
56
|
-
let Connection = class Connection extends
|
|
54
|
+
let Connection = class Connection extends p13n(localize(i18next)(PageView)) {
|
|
57
55
|
constructor() {
|
|
58
56
|
super(...arguments);
|
|
59
57
|
this.active = false;
|
|
@@ -62,54 +60,44 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
62
60
|
CommonGristStyles,
|
|
63
61
|
ScrollbarStyles,
|
|
64
62
|
css `
|
|
65
|
-
:host {
|
|
66
|
-
display: flex;
|
|
63
|
+
:host { display: flex;
|
|
67
64
|
flex-direction: column;
|
|
68
65
|
|
|
69
66
|
overflow: hidden;
|
|
70
|
-
|
|
67
|
+
}
|
|
71
68
|
|
|
72
|
-
ox-grist {
|
|
73
|
-
overflow-y: auto;
|
|
69
|
+
ox-grist { overflow-y: auto;
|
|
74
70
|
flex: 1;
|
|
75
|
-
|
|
71
|
+
}
|
|
76
72
|
`
|
|
77
73
|
]; }
|
|
78
74
|
get context() {
|
|
79
|
-
return {
|
|
80
|
-
|
|
81
|
-
search: {
|
|
82
|
-
handler: search => {
|
|
75
|
+
return { title: i18next.t('text.connection list'),
|
|
76
|
+
search: { handler: search => {
|
|
83
77
|
this.grist.searchText = search;
|
|
84
78
|
},
|
|
85
79
|
value: this.grist?.searchText || ''
|
|
86
80
|
},
|
|
87
81
|
// 필터가 설정되면, 아래 코멘트 해제
|
|
88
|
-
// filter: {
|
|
89
|
-
// handler: () => {
|
|
90
|
-
// const display = this.headroom.style.display
|
|
82
|
+
// filter: { // handler: () => { // const display = this.headroom.style.display
|
|
91
83
|
// this.headroom.style.display = display !== 'none' ? 'none' : 'flex'
|
|
92
|
-
//
|
|
84
|
+
// }
|
|
93
85
|
// },
|
|
94
86
|
help: 'integration/ui/connection',
|
|
95
87
|
actions: [
|
|
96
|
-
{
|
|
97
|
-
title: i18next.t('button.save'),
|
|
88
|
+
{ title: i18next.t('button.save'),
|
|
98
89
|
action: this._updateConnectionManager.bind(this),
|
|
99
90
|
...CommonButtonStyles.save
|
|
100
91
|
},
|
|
101
|
-
{
|
|
102
|
-
title: i18next.t('button.delete'),
|
|
92
|
+
{ title: i18next.t('button.delete'),
|
|
103
93
|
action: this._deleteConnections.bind(this),
|
|
104
94
|
...CommonButtonStyles.delete
|
|
105
95
|
}
|
|
106
96
|
],
|
|
107
|
-
exportable: {
|
|
108
|
-
name: i18next.t('text.connection list'),
|
|
97
|
+
exportable: { name: i18next.t('text.connection list'),
|
|
109
98
|
data: this.exportHandler.bind(this)
|
|
110
99
|
},
|
|
111
|
-
importable: {
|
|
112
|
-
handler: this.importHandler.bind(this)
|
|
100
|
+
importable: { handler: this.importHandler.bind(this)
|
|
113
101
|
}
|
|
114
102
|
};
|
|
115
103
|
}
|
|
@@ -127,13 +115,11 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
127
115
|
}
|
|
128
116
|
async pageInitialized() {
|
|
129
117
|
this.fetchConnectors();
|
|
130
|
-
this.gristConfig = {
|
|
131
|
-
list: { fields: ['name', 'description', 'type', 'active'] },
|
|
118
|
+
this.gristConfig = { list: { fields: ['name', 'description', 'type', 'active'] },
|
|
132
119
|
columns: [
|
|
133
120
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
134
121
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
135
|
-
{
|
|
136
|
-
type: 'gutter',
|
|
122
|
+
{ type: 'gutter',
|
|
137
123
|
gutterName: 'button',
|
|
138
124
|
name: 'state',
|
|
139
125
|
icon: record => (!record ? 'link' : !record.id ? '' : record.state == 'CONNECTED' ? 'link_off' : 'link'),
|
|
@@ -146,8 +132,7 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
146
132
|
? i18next.t('button.disconnect')
|
|
147
133
|
: i18next.t('button.connect'),
|
|
148
134
|
width: 80,
|
|
149
|
-
handlers: {
|
|
150
|
-
click: (columns, data, column, record, rowIndex) => {
|
|
135
|
+
handlers: { click: (columns, data, column, record, rowIndex) => {
|
|
151
136
|
if (!record || !record.name || record.__dirty__ == '+') {
|
|
152
137
|
return;
|
|
153
138
|
}
|
|
@@ -160,28 +145,23 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
160
145
|
}
|
|
161
146
|
}
|
|
162
147
|
},
|
|
163
|
-
{
|
|
164
|
-
type: 'object',
|
|
148
|
+
{ type: 'object',
|
|
165
149
|
name: 'domain',
|
|
166
150
|
hidden: true
|
|
167
151
|
},
|
|
168
|
-
{
|
|
169
|
-
type: 'string',
|
|
152
|
+
{ type: 'string',
|
|
170
153
|
name: 'name',
|
|
171
154
|
label: true,
|
|
172
155
|
header: i18next.t('field.name'),
|
|
173
|
-
record: {
|
|
174
|
-
editable: true,
|
|
156
|
+
record: { editable: true,
|
|
175
157
|
mandatory: true
|
|
176
158
|
},
|
|
177
159
|
filter: 'search',
|
|
178
160
|
sortable: true,
|
|
179
161
|
width: 150,
|
|
180
162
|
validation: function (after, before, record, column) {
|
|
181
|
-
/* connected 상태에서는 이름을 바꿀 수 없다. */
|
|
182
163
|
if (record.state == 'CONNECTED') {
|
|
183
|
-
notify({
|
|
184
|
-
level: 'warn',
|
|
164
|
+
notify({ level: 'warn',
|
|
185
165
|
message: 'connection name cannot be changed during connected.'
|
|
186
166
|
});
|
|
187
167
|
return false;
|
|
@@ -189,46 +169,38 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
189
169
|
return true;
|
|
190
170
|
}
|
|
191
171
|
},
|
|
192
|
-
{
|
|
193
|
-
type: 'string',
|
|
172
|
+
{ type: 'string',
|
|
194
173
|
name: 'description',
|
|
195
174
|
label: true,
|
|
196
175
|
header: i18next.t('field.description'),
|
|
197
|
-
record: {
|
|
198
|
-
editable: true
|
|
176
|
+
record: { editable: true
|
|
199
177
|
},
|
|
200
178
|
filter: 'search',
|
|
201
179
|
width: 200
|
|
202
180
|
},
|
|
203
|
-
{
|
|
204
|
-
type: 'checkbox',
|
|
181
|
+
{ type: 'checkbox',
|
|
205
182
|
name: 'active',
|
|
206
183
|
label: true,
|
|
207
184
|
header: i18next.t('field.startup-connect'),
|
|
208
|
-
record: {
|
|
209
|
-
editable: true,
|
|
185
|
+
record: { editable: true,
|
|
210
186
|
align: 'center'
|
|
211
187
|
},
|
|
212
188
|
sortable: true,
|
|
213
189
|
width: 60
|
|
214
190
|
},
|
|
215
|
-
{
|
|
216
|
-
type: 'checkbox',
|
|
191
|
+
{ type: 'checkbox',
|
|
217
192
|
name: 'onDemand',
|
|
218
193
|
label: true,
|
|
219
194
|
header: i18next.t('field.on-demand'),
|
|
220
|
-
record: {
|
|
221
|
-
editable: true
|
|
195
|
+
record: { editable: true
|
|
222
196
|
},
|
|
223
197
|
width: 120
|
|
224
198
|
},
|
|
225
|
-
{
|
|
226
|
-
type: 'connector',
|
|
199
|
+
{ type: 'connector',
|
|
227
200
|
name: 'type',
|
|
228
201
|
label: true,
|
|
229
202
|
header: i18next.t('field.type'),
|
|
230
|
-
record: {
|
|
231
|
-
renderer: HelpDecoratedRenderer,
|
|
203
|
+
record: { renderer: HelpDecoratedRenderer,
|
|
232
204
|
editable: true,
|
|
233
205
|
help: value => this.connectors?.[value]?.help,
|
|
234
206
|
mandatory: true
|
|
@@ -237,29 +209,24 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
237
209
|
sortable: true,
|
|
238
210
|
width: 200
|
|
239
211
|
},
|
|
240
|
-
{
|
|
241
|
-
type: 'string',
|
|
212
|
+
{ type: 'string',
|
|
242
213
|
name: 'endpoint',
|
|
243
214
|
header: i18next.t('field.endpoint'),
|
|
244
|
-
record: {
|
|
245
|
-
editable: true,
|
|
215
|
+
record: { editable: true,
|
|
246
216
|
mandatory: true
|
|
247
217
|
},
|
|
248
218
|
filter: 'search',
|
|
249
219
|
sortable: true,
|
|
250
220
|
width: 280
|
|
251
221
|
},
|
|
252
|
-
{
|
|
253
|
-
type: 'parameters',
|
|
222
|
+
{ type: 'parameters',
|
|
254
223
|
name: 'params',
|
|
255
224
|
header: i18next.t('field.params'),
|
|
256
|
-
record: {
|
|
257
|
-
editable: true,
|
|
225
|
+
record: { editable: true,
|
|
258
226
|
options: async (value, column, record, row, field) => {
|
|
259
227
|
const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : {};
|
|
260
228
|
const context = this.grist;
|
|
261
|
-
return {
|
|
262
|
-
name,
|
|
229
|
+
return { name,
|
|
263
230
|
help,
|
|
264
231
|
spec,
|
|
265
232
|
context,
|
|
@@ -267,122 +234,95 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
267
234
|
actionInjector: createActionInjector(record.name)
|
|
268
235
|
};
|
|
269
236
|
},
|
|
270
|
-
renderer: 'json5'
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
type: 'resource-object',
|
|
237
|
+
renderer: 'json5' },
|
|
238
|
+
width: 100 },
|
|
239
|
+
{ type: 'resource-object',
|
|
276
240
|
name: 'edge',
|
|
277
241
|
header: i18next.t('field.edge-server'),
|
|
278
|
-
record: {
|
|
279
|
-
|
|
280
|
-
options: {
|
|
281
|
-
queryName: 'edges'
|
|
242
|
+
record: { editable: true,
|
|
243
|
+
options: { queryName: 'edges'
|
|
282
244
|
}
|
|
283
245
|
},
|
|
284
246
|
sortable: true,
|
|
285
247
|
width: 120
|
|
286
248
|
},
|
|
287
|
-
{
|
|
288
|
-
type: 'resource-object',
|
|
249
|
+
{ type: 'resource-object',
|
|
289
250
|
name: 'updater',
|
|
290
251
|
header: i18next.t('field.updater'),
|
|
291
|
-
record: {
|
|
292
|
-
editable: false
|
|
252
|
+
record: { editable: false
|
|
293
253
|
},
|
|
294
254
|
sortable: true,
|
|
295
255
|
width: 120
|
|
296
256
|
},
|
|
297
|
-
{
|
|
298
|
-
type: 'datetime',
|
|
257
|
+
{ type: 'datetime',
|
|
299
258
|
name: 'updatedAt',
|
|
300
259
|
header: i18next.t('field.updated_at'),
|
|
301
|
-
record: {
|
|
302
|
-
editable: false
|
|
260
|
+
record: { editable: false
|
|
303
261
|
},
|
|
304
262
|
sortable: true,
|
|
305
263
|
width: 180
|
|
306
264
|
}
|
|
307
265
|
],
|
|
308
|
-
rows: {
|
|
309
|
-
selectable: {
|
|
310
|
-
multiple: true
|
|
266
|
+
rows: { selectable: { multiple: true
|
|
311
267
|
}
|
|
312
268
|
},
|
|
313
269
|
sorters: [
|
|
314
|
-
{
|
|
315
|
-
name: 'name'
|
|
270
|
+
{ name: 'name'
|
|
316
271
|
}
|
|
317
|
-
]
|
|
318
|
-
};
|
|
272
|
+
] };
|
|
319
273
|
}
|
|
320
274
|
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
321
|
-
const response = await client.query({
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
325
|
-
items {
|
|
326
|
-
id
|
|
327
|
-
domain {
|
|
328
|
-
id
|
|
275
|
+
const response = await client.query({ query: gql `
|
|
276
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id
|
|
277
|
+
domain { id
|
|
329
278
|
name
|
|
330
279
|
description
|
|
331
|
-
|
|
280
|
+
}
|
|
332
281
|
name
|
|
333
282
|
description
|
|
334
283
|
type
|
|
335
|
-
edge {
|
|
336
|
-
id
|
|
284
|
+
edge { id
|
|
337
285
|
name
|
|
338
|
-
|
|
286
|
+
}
|
|
339
287
|
endpoint
|
|
340
288
|
active
|
|
341
289
|
onDemand
|
|
342
290
|
state
|
|
343
291
|
params
|
|
344
|
-
updater {
|
|
345
|
-
id
|
|
292
|
+
updater { id
|
|
346
293
|
name
|
|
347
294
|
description
|
|
348
|
-
|
|
295
|
+
}
|
|
349
296
|
updatedAt
|
|
350
|
-
|
|
297
|
+
}
|
|
351
298
|
total
|
|
352
|
-
|
|
353
|
-
|
|
299
|
+
}
|
|
300
|
+
}
|
|
354
301
|
`,
|
|
355
|
-
variables: {
|
|
356
|
-
filters,
|
|
302
|
+
variables: { filters,
|
|
357
303
|
pagination: { page, limit },
|
|
358
304
|
sortings
|
|
359
305
|
}
|
|
360
306
|
});
|
|
361
|
-
return {
|
|
362
|
-
total: response.data.responses.total || 0,
|
|
307
|
+
return { total: response.data.responses.total || 0,
|
|
363
308
|
records: response.data.responses.items || []
|
|
364
309
|
};
|
|
365
310
|
}
|
|
366
311
|
async fetchConnectors() {
|
|
367
|
-
const response = await client.query({
|
|
368
|
-
|
|
369
|
-
query {
|
|
370
|
-
connectors {
|
|
371
|
-
items {
|
|
372
|
-
name
|
|
312
|
+
const response = await client.query({ query: gql `
|
|
313
|
+
query { connectors { items { name
|
|
373
314
|
help
|
|
374
|
-
parameterSpec {
|
|
375
|
-
type
|
|
315
|
+
parameterSpec { type
|
|
376
316
|
name
|
|
377
317
|
label
|
|
378
318
|
placeholder
|
|
379
319
|
property
|
|
380
320
|
styles
|
|
381
321
|
useDomainAttribute
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
386
326
|
`
|
|
387
327
|
});
|
|
388
328
|
if (!response.errors) {
|
|
@@ -396,26 +336,20 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
396
336
|
}
|
|
397
337
|
}
|
|
398
338
|
async _deleteConnections(name) {
|
|
399
|
-
if (confirm(i18next.t('text.sure_to_x', {
|
|
400
|
-
x: i18next.t('text.delete')
|
|
339
|
+
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete')
|
|
401
340
|
}))) {
|
|
402
341
|
const names = this.grist.selected.map(record => record.name);
|
|
403
342
|
if (names && names.length > 0) {
|
|
404
|
-
const response = await client.mutate({
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
deleteConnections(names: $names)
|
|
408
|
-
}
|
|
343
|
+
const response = await client.mutate({ mutation: gql `
|
|
344
|
+
mutation ($names: [String!]!) { deleteConnections(names: $names)
|
|
345
|
+
}
|
|
409
346
|
`,
|
|
410
|
-
variables: {
|
|
411
|
-
names
|
|
347
|
+
variables: { names
|
|
412
348
|
}
|
|
413
349
|
});
|
|
414
350
|
if (!response.errors) {
|
|
415
351
|
this.grist.fetch();
|
|
416
|
-
notify({
|
|
417
|
-
message: i18next.t('text.info_x_successfully', {
|
|
418
|
-
x: i18next.t('text.delete')
|
|
352
|
+
notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete')
|
|
419
353
|
})
|
|
420
354
|
});
|
|
421
355
|
}
|
|
@@ -434,16 +368,12 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
434
368
|
patchField.cuFlag = connection.__dirty__;
|
|
435
369
|
return patchField;
|
|
436
370
|
});
|
|
437
|
-
const response = await client.mutate({
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
name
|
|
442
|
-
}
|
|
443
|
-
}
|
|
371
|
+
const response = await client.mutate({ mutation: gql `
|
|
372
|
+
mutation ($patches: [ConnectionPatch!]!) { updateMultipleConnection(patches: $patches) { name
|
|
373
|
+
}
|
|
374
|
+
}
|
|
444
375
|
`,
|
|
445
|
-
variables: {
|
|
446
|
-
patches
|
|
376
|
+
variables: { patches
|
|
447
377
|
}
|
|
448
378
|
});
|
|
449
379
|
if (!response.errors)
|
|
@@ -451,44 +381,34 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
451
381
|
}
|
|
452
382
|
}
|
|
453
383
|
async connect(record) {
|
|
454
|
-
var response = await client.mutate({
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
state
|
|
459
|
-
}
|
|
460
|
-
}
|
|
384
|
+
var response = await client.mutate({ mutation: gql `
|
|
385
|
+
mutation ($name: String!) { connectConnection(name: $name) { state
|
|
386
|
+
}
|
|
387
|
+
}
|
|
461
388
|
`,
|
|
462
|
-
variables: {
|
|
463
|
-
name: record.name
|
|
389
|
+
variables: { name: record.name
|
|
464
390
|
}
|
|
465
391
|
});
|
|
466
392
|
var state = response.data.connectConnection.state;
|
|
467
393
|
record.state = state;
|
|
468
394
|
this.grist.refresh();
|
|
469
|
-
notify({
|
|
470
|
-
level: 'info',
|
|
395
|
+
notify({ level: 'info',
|
|
471
396
|
message: `${state == 'CONNECTED' ? 'success' : 'fail'} to connect : ${record.name}`
|
|
472
397
|
});
|
|
473
398
|
}
|
|
474
399
|
async disconnect(record) {
|
|
475
|
-
var response = await client.mutate({
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
state
|
|
480
|
-
}
|
|
481
|
-
}
|
|
400
|
+
var response = await client.mutate({ mutation: gql `
|
|
401
|
+
mutation ($name: String!) { disconnectConnection(name: $name) { state
|
|
402
|
+
}
|
|
403
|
+
}
|
|
482
404
|
`,
|
|
483
|
-
variables: {
|
|
484
|
-
name: record.name
|
|
405
|
+
variables: { name: record.name
|
|
485
406
|
}
|
|
486
407
|
});
|
|
487
408
|
var state = response.data.disconnectConnection.state;
|
|
488
409
|
record.state = state;
|
|
489
410
|
this.grist.refresh();
|
|
490
|
-
notify({
|
|
491
|
-
level: 'info',
|
|
411
|
+
notify({ level: 'info',
|
|
492
412
|
message: `${state == 'CONNECTED' ? 'fail' : 'success'} to disconnect : ${record.name}`
|
|
493
413
|
});
|
|
494
414
|
}
|
|
@@ -512,8 +432,7 @@ let Connection = class Connection extends connect(store)(p13n(localize(i18next)(
|
|
|
512
432
|
this.grist.fetch();
|
|
513
433
|
}}
|
|
514
434
|
></connection-importer>
|
|
515
|
-
`, {
|
|
516
|
-
backdrop: true,
|
|
435
|
+
`, { backdrop: true,
|
|
517
436
|
size: 'large',
|
|
518
437
|
title: i18next.t('title.import connection')
|
|
519
438
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../client/pages/connection.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;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AAA;AAvBzB,UAAU;IADtB,aAAa,CAAC,iBAAiB,CAAC;GACpB,UAAU,CAuftB","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport './connection-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { DataGrist } from '@operato/data-grist/ox-grist.js'\nimport { client } from '@operato/graphql'\nimport { HelpDecoratedRenderer } from '@operato/help/help-decorated-renderer.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { FetchOption } from '@operato/data-grist'\nimport { p13n } from '@operato/p13n'\nimport { PropertySpec } from '../types.js'\n\nasync function copyToClipboard(text: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(text)\n } catch (err) {\n // fallback: old way\n const textArea = document.createElement('textarea')\n textArea.value = text\n document.body.appendChild(textArea)\n textArea.select()\n document.execCommand('copy')\n document.body.removeChild(textArea)\n }\n}\n\nfunction createActionInjector(\n connectionName: string\n): (propName: string, propSpec: PropertySpec) => HTMLElement | null {\n return (propName: string, propSpec: PropertySpec): HTMLElement | null => {\n if (!propSpec.useDomainAttribute) {\n return null\n }\n\n const attributeName = `Connection::${connectionName}::${propName}`\n\n const copyIcon = document.createElement('md-icon')\n copyIcon.textContent = 'dictionary'\n copyIcon.style.cssText =\n 'cursor: pointer; color: var(--md-sys-color-primary); font-size: 16px; --md-icon-size: 16px;'\n copyIcon.title = `Copy ${attributeName}`\n\n copyIcon.addEventListener('click', () => {\n copyToClipboard(attributeName)\n\n // 복사 성공 피드백\n const originalText = copyIcon.textContent\n copyIcon.textContent = 'check'\n copyIcon.style.color = 'var(--md-sys-color-tertiary)'\n\n setTimeout(() => {\n copyIcon.textContent = originalText\n copyIcon.style.color = 'var(--md-sys-color-primary)'\n }, 1000)\n })\n\n return copyIcon\n }\n}\n\n@customElement('connection-page')\nexport class Connection extends connect(store)(p13n(localize(i18next)(PageView))) {\n static styles = [\n CommonGristStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) gristConfig: any\n @property({ type: Object }) connectors: any\n\n @query('ox-grist') grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('text.connection list'),\n search: {\n handler: search => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n // 필터가 설정되면, 아래 코멘트 해제\n // filter: {\n // handler: () => {\n // const display = this.headroom.style.display\n // this.headroom.style.display = display !== 'none' ? 'none' : 'flex'\n // }\n // },\n help: 'integration/ui/connection',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateConnectionManager.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteConnections.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('text.connection list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n `\n }\n\n async pageInitialized() {\n this.fetchConnectors()\n\n this.gristConfig = {\n list: { fields: ['name', 'description', 'type', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'state',\n icon: record => (!record ? 'link' : !record.id ? '' : record.state == 'CONNECTED' ? 'link_off' : 'link'),\n iconOnly: false,\n title: record =>\n !record\n ? i18next.t('button.connect')\n : !record.id\n ? ''\n : record.state == 'CONNECTED'\n ? i18next.t('button.disconnect')\n : i18next.t('button.connect'),\n width: 80,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record || !record.name || record.__dirty__ == '+') {\n return\n }\n if (record.state == 'CONNECTED') {\n this.disconnect(record)\n } else {\n this.connect(record)\n }\n }\n }\n },\n {\n type: 'object',\n name: 'domain',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n label: true,\n header: i18next.t('field.name'),\n record: {\n editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 150,\n validation: function (after, before, record, column) {\n /* connected 상태에서는 이름을 바꿀 수 없다. */\n if (record.state == 'CONNECTED') {\n notify({\n level: 'warn',\n message: 'connection name cannot be changed during connected.'\n })\n return false\n }\n return true\n }\n },\n {\n type: 'string',\n name: 'description',\n label: true,\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.startup-connect'),\n record: {\n editable: true,\n align: 'center'\n },\n sortable: true,\n width: 60\n },\n {\n type: 'checkbox',\n name: 'onDemand',\n label: true,\n header: i18next.t('field.on-demand'),\n record: {\n editable: true\n },\n width: 120\n },\n {\n type: 'connector',\n name: 'type',\n label: true,\n header: i18next.t('field.type'),\n record: {\n renderer: HelpDecoratedRenderer,\n editable: true,\n help: value => this.connectors?.[value]?.help,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n {\n type: 'string',\n name: 'endpoint',\n header: i18next.t('field.endpoint'),\n record: {\n editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 280\n },\n {\n type: 'parameters',\n name: 'params',\n header: i18next.t('field.params'),\n record: {\n editable: true,\n options: async (value, column, record, row, field) => {\n const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : ({} as any)\n const context = this.grist\n\n return {\n name,\n help,\n spec,\n context,\n objectified: true,\n actionInjector: createActionInjector(record.name)\n }\n },\n renderer: 'json5'\n },\n width: 100\n },\n {\n type: 'resource-object',\n name: 'edge',\n header: i18next.t('field.edge-server'),\n record: {\n editable: true,\n options: {\n queryName: 'edges'\n }\n },\n sortable: true,\n width: 120\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n domain {\n id\n name\n description\n }\n name\n description\n type\n edge {\n id\n name\n }\n endpoint\n active\n onDemand\n state\n params\n updater {\n id\n name\n description\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async fetchConnectors() {\n const response = await client.query({\n query: gql`\n query {\n connectors {\n items {\n name\n help\n parameterSpec {\n type\n name\n label\n placeholder\n property\n styles\n useDomainAttribute\n }\n }\n }\n }\n `\n })\n\n if (!response.errors) {\n this.connectors = response.data.connectors.items.reduce((connectors, connector) => {\n connectors[connector.name] = connector\n return connectors\n }, {})\n } else {\n console.error('fetch connectors error')\n }\n }\n\n async _deleteConnections(name) {\n if (\n confirm(\n i18next.t('text.sure_to_x', {\n x: i18next.t('text.delete')\n })\n )\n ) {\n const names = this.grist.selected.map(record => record.name)\n if (names && names.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($names: [String!]!) {\n deleteConnections(names: $names)\n }\n `,\n variables: {\n names\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n\n notify({\n message: i18next.t('text.info_x_successfully', {\n x: i18next.t('text.delete')\n })\n })\n }\n }\n }\n }\n\n async _updateConnectionManager() {\n var patches = this.grist.dirtyRecords\n\n if (patches && patches.length) {\n patches = patches.map(connection => {\n let patchField: any = connection.id ? { id: connection.id } : {}\n const dirtyFields = connection.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = connection.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [ConnectionPatch!]!) {\n updateMultipleConnection(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) this.grist.fetch()\n }\n }\n\n async connect(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n connectConnection(name: $name) {\n state\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n var state = response.data.connectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({\n level: 'info',\n message: `${state == 'CONNECTED' ? 'success' : 'fail'} to connect : ${record.name}`\n })\n }\n\n async disconnect(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($name: String!) {\n disconnectConnection(name: $name) {\n state\n }\n }\n `,\n variables: {\n name: record.name\n }\n })\n\n var state = response.data.disconnectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({\n level: 'info',\n message: `${state == 'CONNECTED' ? 'fail' : 'success'} to disconnect : ${record.name}`\n })\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'type', 'description', 'endpoint', 'params'])\n\n return exportTargets.map(connection => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = connection[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n openPopup(\n html`\n <connection-importer\n .connections=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></connection-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import connection')\n }\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../client/pages/connection.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAGpC,KAAK,UAAU,eAAe,CAAC,IAAY;IAAqB,IAAI,CAAC;QAAK,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAClH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC,CAAK,oBAAoB;QACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;QACnD,QAA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AAE,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;QAE3F,OAAO,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAAS,IAAI,OAAO,GAAG,EAAE,CAAA;YAC7D,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;gBAAS,OAAO,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;YACrF,CAAC;YAEI,OAAO,OAAO,CAAA;QACnB,CAAC,CAAC,CAAA;IACF,CAAC;IAEA,KAAK,CAAC,aAAa,CAAC,OAAO;QAAQ,SAAS,CACxC,IAAI,CAAA;;yBAEe,OAAO;sBACV,GAAG,EAAE;YAAe,OAAO,CAAC,IAAI,EAAE,CAAA;YAC5C,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAC7B,CAAC;;OAEK,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC;SACjD,CACG,CAAA;IACJ,CAAC;;AA3X6B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;0CAAwB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAgB;AAExB;IAAlB,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;yCAAA;AApBzB,UAAU;IADtB,aAAa,CAAC,iBAAiB,CAAC;GACpB,UAAU,CA4YtB","sourcesContent":["import '@operato/data-grist/ox-grist.js'\nimport './connection-importer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist/ox-grist.js'\nimport { client } from '@operato/graphql'\nimport { HelpDecoratedRenderer } from '@operato/help/help-decorated-renderer.js'\nimport { notify, openPopup } from '@operato/layout'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice } from '@operato/utils'\nimport { FetchOption } from '@operato/data-grist'\nimport { p13n } from '@operato/p13n'\nimport { PropertySpec } from '../types.js'\n\nasync function copyToClipboard(text: string): Promise<void> { try { await navigator.clipboard.writeText(text)\n } catch (err) { // fallback: old way\n const textArea = document.createElement('textarea')\n textArea.value = text\n document.body.appendChild(textArea)\n textArea.select()\n document.execCommand('copy')\n document.body.removeChild(textArea)\n }\n}\n\nfunction createActionInjector(\n connectionName: string\n): (propName: string, propSpec: PropertySpec) => HTMLElement | null { return (propName: string, propSpec: PropertySpec): HTMLElement | null => { if (!propSpec.useDomainAttribute) { return null\n }\n\n const attributeName = `Connection::${connectionName}::${propName}`\n\n const copyIcon = document.createElement('md-icon')\n copyIcon.textContent = 'dictionary'\n copyIcon.style.cssText =\n 'cursor: pointer; color: var(--md-sys-color-primary); font-size: 16px; --md-icon-size: 16px;'\n copyIcon.title = `Copy ${attributeName}`\n\n copyIcon.addEventListener('click', () => { copyToClipboard(attributeName)\n\n // 복사 성공 피드백\n const originalText = copyIcon.textContent\n copyIcon.textContent = 'check'\n copyIcon.style.color = 'var(--md-sys-color-tertiary)'\n\n setTimeout(() => { copyIcon.textContent = originalText\n copyIcon.style.color = 'var(--md-sys-color-primary)'\n }, 1000)\n })\n\n return copyIcon\n }\n}\n\n@customElement('connection-page')\nexport class Connection extends p13n(localize(i18next)(PageView)) { static styles = [\n CommonGristStyles,\n ScrollbarStyles,\n css`\n :host { display: flex;\n flex-direction: column;\n\n overflow: hidden;\n }\n\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @property({ type: Boolean }) active: boolean = false\n @property({ type: Object }) gristConfig: any\n @property({ type: Object }) connectors: any\n\n @query('ox-grist') grist!: DataGrist\n\n get context() { return { title: i18next.t('text.connection list'),\n search: { handler: search => { this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n // 필터가 설정되면, 아래 코멘트 해제\n // filter: { // handler: () => { // const display = this.headroom.style.display\n // this.headroom.style.display = display !== 'none' ? 'none' : 'flex'\n // }\n // },\n help: 'integration/ui/connection',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateConnectionManager.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteConnections.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('text.connection list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')!}\n >\n <ox-grist-personalizer slot=\"setting\"></ox-grist-personalizer>\n </ox-grist>\n `\n }\n\n async pageInitialized() { this.fetchConnectors()\n\n this.gristConfig = { list: { fields: ['name', 'description', 'type', 'active'] },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter',\n gutterName: 'button',\n name: 'state',\n icon: record => (!record ? 'link' : !record.id ? '' : record.state == 'CONNECTED' ? 'link_off' : 'link'),\n iconOnly: false,\n title: record =>\n !record\n ? i18next.t('button.connect')\n : !record.id\n ? ''\n : record.state == 'CONNECTED'\n ? i18next.t('button.disconnect')\n : i18next.t('button.connect'),\n width: 80,\n handlers: { click: (columns, data, column, record, rowIndex) => { if (!record || !record.name || record.__dirty__ == '+') { return\n }\n if (record.state == 'CONNECTED') { this.disconnect(record)\n } else { this.connect(record)\n }\n }\n }\n },\n { type: 'object',\n name: 'domain',\n hidden: true\n },\n { type: 'string',\n name: 'name',\n label: true,\n header: i18next.t('field.name'),\n record: { editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 150,\n validation: function (after, before, record, column) { /* connected 상태에서는 이름을 바꿀 수 없다. */\n if (record.state == 'CONNECTED') { notify({ level: 'warn',\n message: 'connection name cannot be changed during connected.'\n })\n return false\n }\n return true\n }\n },\n { type: 'string',\n name: 'description',\n label: true,\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.startup-connect'),\n record: { editable: true,\n align: 'center'\n },\n sortable: true,\n width: 60\n },\n { type: 'checkbox',\n name: 'onDemand',\n label: true,\n header: i18next.t('field.on-demand'),\n record: { editable: true\n },\n width: 120\n },\n { type: 'connector',\n name: 'type',\n label: true,\n header: i18next.t('field.type'),\n record: { renderer: HelpDecoratedRenderer,\n editable: true,\n help: value => this.connectors?.[value]?.help,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 200\n },\n { type: 'string',\n name: 'endpoint',\n header: i18next.t('field.endpoint'),\n record: { editable: true,\n mandatory: true\n },\n filter: 'search',\n sortable: true,\n width: 280\n },\n { type: 'parameters',\n name: 'params',\n header: i18next.t('field.params'),\n record: { editable: true,\n options: async (value, column, record, row, field) => { const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : ({} as any)\n const context = this.grist\n\n return { name,\n help,\n spec,\n context,\n objectified: true,\n actionInjector: createActionInjector(record.name)\n }\n },\n renderer: 'json5'\n },\n width: 100\n },\n { type: 'resource-object',\n name: 'edge',\n header: i18next.t('field.edge-server'),\n record: { editable: true,\n options: { queryName: 'edges'\n }\n },\n sortable: true,\n width: 120\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n domain { id\n name\n description\n }\n name\n description\n type\n edge { id\n name\n }\n endpoint\n active\n onDemand\n state\n params\n updater { id\n name\n description\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async fetchConnectors() { const response = await client.query({ query: gql`\n query { connectors { items { name\n help\n parameterSpec { type\n name\n label\n placeholder\n property\n styles\n useDomainAttribute\n }\n }\n }\n }\n `\n })\n\n if (!response.errors) { this.connectors = response.data.connectors.items.reduce((connectors, connector) => { connectors[connector.name] = connector\n return connectors\n }, {})\n } else { console.error('fetch connectors error')\n }\n }\n\n async _deleteConnections(name) { if (\n confirm(\n i18next.t('text.sure_to_x', { x: i18next.t('text.delete')\n })\n )\n ) { const names = this.grist.selected.map(record => record.name)\n if (names && names.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($names: [String!]!) { deleteConnections(names: $names)\n }\n `,\n variables: { names\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete')\n })\n })\n }\n }\n }\n }\n\n async _updateConnectionManager() { var patches = this.grist.dirtyRecords\n\n if (patches && patches.length) { patches = patches.map(connection => { let patchField: any = connection.id ? { id: connection.id } : {}\n const dirtyFields = connection.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = connection.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({ mutation: gql`\n mutation ($patches: [ConnectionPatch!]!) { updateMultipleConnection(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n })\n\n if (!response.errors) this.grist.fetch()\n }\n }\n\n async connect(record) { var response = await client.mutate({ mutation: gql`\n mutation ($name: String!) { connectConnection(name: $name) { state\n }\n }\n `,\n variables: { name: record.name\n }\n })\n\n var state = response.data.connectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({ level: 'info',\n message: `${state == 'CONNECTED' ? 'success' : 'fail'} to connect : ${record.name}`\n })\n }\n\n async disconnect(record) { var response = await client.mutate({ mutation: gql`\n mutation ($name: String!) { disconnectConnection(name: $name) { state\n }\n }\n `,\n variables: { name: record.name\n }\n })\n\n var state = response.data.disconnectConnection.state\n\n record.state = state\n\n this.grist.refresh()\n\n notify({ level: 'info',\n message: `${state == 'CONNECTED' ? 'fail' : 'success'} to disconnect : ${record.name}`\n })\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'type', 'description', 'endpoint', 'params'])\n\n return exportTargets.map(connection => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = connection[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { openPopup(\n html`\n <connection-importer\n .connections=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></connection-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import connection')\n }\n )\n }\n}\n"]}
|