@things-factory/integration-ui 9.0.0-beta.24 → 9.0.0-beta.27
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/package.json +6 -6
- package/dist-client/analysis/graph-data.d.ts +0 -36
- package/dist-client/analysis/graph-data.js +0 -2
- package/dist-client/analysis/graph-data.js.map +0 -1
- package/dist-client/analysis/graph-viewer-style.d.ts +0 -1
- package/dist-client/analysis/graph-viewer-style.js +0 -121
- package/dist-client/analysis/graph-viewer-style.js.map +0 -1
- package/dist-client/analysis/graph-viewer.d.ts +0 -36
- package/dist-client/analysis/graph-viewer.js +0 -294
- package/dist-client/analysis/graph-viewer.js.map +0 -1
- package/dist-client/analysis/node.d.ts +0 -4
- package/dist-client/analysis/node.js +0 -59
- package/dist-client/analysis/node.js.map +0 -1
- package/dist-client/analysis/relationship.d.ts +0 -4
- package/dist-client/analysis/relationship.js +0 -13
- package/dist-client/analysis/relationship.js.map +0 -1
- package/dist-client/analysis/utils.d.ts +0 -20
- package/dist-client/analysis/utils.js +0 -31
- package/dist-client/analysis/utils.js.map +0 -1
- package/dist-client/bootstrap.d.ts +0 -3
- package/dist-client/bootstrap.js +0 -30
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/editors/entity-editor.d.ts +0 -10
- package/dist-client/editors/entity-editor.js +0 -46
- package/dist-client/editors/entity-editor.js.map +0 -1
- package/dist-client/editors/entity-selector.d.ts +0 -31
- package/dist-client/editors/entity-selector.js +0 -301
- package/dist-client/editors/entity-selector.js.map +0 -1
- package/dist-client/editors/property-editor.d.ts +0 -30
- package/dist-client/editors/property-editor.js +0 -105
- package/dist-client/editors/property-editor.js.map +0 -1
- package/dist-client/editors/things-editor-db-procedure.d.ts +0 -52
- package/dist-client/editors/things-editor-db-procedure.js +0 -495
- package/dist-client/editors/things-editor-db-procedure.js.map +0 -1
- package/dist-client/editors/things-editor-entity-selector.d.ts +0 -15
- package/dist-client/editors/things-editor-entity-selector.js +0 -94
- package/dist-client/editors/things-editor-entity-selector.js.map +0 -1
- package/dist-client/editors/things-editor-http-body.d.ts +0 -22
- package/dist-client/editors/things-editor-http-body.js +0 -137
- package/dist-client/editors/things-editor-http-body.js.map +0 -1
- package/dist-client/editors/things-editor-http-headers.d.ts +0 -29
- package/dist-client/editors/things-editor-http-headers.js +0 -167
- package/dist-client/editors/things-editor-http-headers.js.map +0 -1
- package/dist-client/editors/things-editor-http-parameters.d.ts +0 -29
- package/dist-client/editors/things-editor-http-parameters.js +0 -167
- package/dist-client/editors/things-editor-http-parameters.js.map +0 -1
- package/dist-client/editors/things-editor-tag-scenarios.d.ts +0 -32
- package/dist-client/editors/things-editor-tag-scenarios.js +0 -226
- package/dist-client/editors/things-editor-tag-scenarios.js.map +0 -1
- package/dist-client/grist/connection-selector.d.ts +0 -4
- package/dist-client/grist/connection-selector.js +0 -30
- package/dist-client/grist/connection-selector.js.map +0 -1
- package/dist-client/grist/connector-selector.d.ts +0 -4
- package/dist-client/grist/connector-selector.js +0 -30
- package/dist-client/grist/connector-selector.js.map +0 -1
- package/dist-client/grist/dynamic-selector.d.ts +0 -10
- package/dist-client/grist/dynamic-selector.js +0 -32
- package/dist-client/grist/dynamic-selector.js.map +0 -1
- package/dist-client/grist/task-type-selector.d.ts +0 -7
- package/dist-client/grist/task-type-selector.js +0 -58
- package/dist-client/grist/task-type-selector.js.map +0 -1
- package/dist-client/index.d.ts +0 -2
- package/dist-client/index.js +0 -3
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/connection-importer.d.ts +0 -10
- package/dist-client/pages/connection-importer.js +0 -102
- package/dist-client/pages/connection-importer.js.map +0 -1
- package/dist-client/pages/connection.d.ts +0 -64
- package/dist-client/pages/connection.js +0 -478
- package/dist-client/pages/connection.js.map +0 -1
- package/dist-client/pages/integration-analysis.d.ts +0 -24
- package/dist-client/pages/integration-analysis.js +0 -238
- package/dist-client/pages/integration-analysis.js.map +0 -1
- package/dist-client/pages/integration-monitor.d.ts +0 -28
- package/dist-client/pages/integration-monitor.js +0 -343
- package/dist-client/pages/integration-monitor.js.map +0 -1
- package/dist-client/pages/scenario-detail.d.ts +0 -2
- package/dist-client/pages/scenario-detail.js +0 -298
- package/dist-client/pages/scenario-detail.js.map +0 -1
- package/dist-client/pages/scenario-importer.d.ts +0 -10
- package/dist-client/pages/scenario-importer.js +0 -108
- package/dist-client/pages/scenario-importer.js.map +0 -1
- package/dist-client/pages/scenario.d.ts +0 -69
- package/dist-client/pages/scenario.js +0 -632
- package/dist-client/pages/scenario.js.map +0 -1
- package/dist-client/pages/state-register.d.ts +0 -50
- package/dist-client/pages/state-register.js +0 -278
- package/dist-client/pages/state-register.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -20
- package/dist-client/route.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/viewparts/connections-monitor.d.ts +0 -10
- package/dist-client/viewparts/connections-monitor.js +0 -172
- package/dist-client/viewparts/connections-monitor.js.map +0 -1
- package/dist-client/viewparts/monitoring-summary.d.ts +0 -13
- package/dist-client/viewparts/monitoring-summary.js +0 -142
- package/dist-client/viewparts/monitoring-summary.js.map +0 -1
- package/dist-client/viewparts/pending-q-monitor.d.ts +0 -18
- package/dist-client/viewparts/pending-q-monitor.js +0 -248
- package/dist-client/viewparts/pending-q-monitor.js.map +0 -1
- package/dist-client/viewparts/scenario-instance-log-view.d.ts +0 -24
- package/dist-client/viewparts/scenario-instance-log-view.js +0 -141
- package/dist-client/viewparts/scenario-instance-log-view.js.map +0 -1
- package/dist-client/viewparts/scenario-instance-monitor.d.ts +0 -15
- package/dist-client/viewparts/scenario-instance-monitor.js +0 -173
- package/dist-client/viewparts/scenario-instance-monitor.js.map +0 -1
- package/dist-client/viewparts/scenario-instance-view.d.ts +0 -29
- package/dist-client/viewparts/scenario-instance-view.js +0 -263
- package/dist-client/viewparts/scenario-instance-view.js.map +0 -1
- package/dist-client/viewparts/scenario-monitor.d.ts +0 -16
- package/dist-client/viewparts/scenario-monitor.js +0 -285
- package/dist-client/viewparts/scenario-monitor.js.map +0 -1
- package/dist-client/viewparts/scenarios-monitor.d.ts +0 -16
- package/dist-client/viewparts/scenarios-monitor.js +0 -170
- package/dist-client/viewparts/scenarios-monitor.js.map +0 -1
- package/dist-server/index.d.ts +0 -0
- package/dist-server/index.js +0 -1
- package/dist-server/index.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
@@ -1,478 +0,0 @@
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
2
|
-
import '@operato/data-grist/ox-grist.js';
|
3
|
-
import './connection-importer.js';
|
4
|
-
import gql from 'graphql-tag';
|
5
|
-
import { css, html } from 'lit';
|
6
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
7
|
-
import { connect } from 'pwa-helpers/connect-mixin';
|
8
|
-
import { DataGrist } from '@operato/data-grist/ox-grist.js';
|
9
|
-
import { client } from '@operato/graphql';
|
10
|
-
import { HelpDecoratedRenderer } from '@operato/help/help-decorated-renderer.js';
|
11
|
-
import { notify, openPopup } from '@operato/layout';
|
12
|
-
import { i18next, localize } from '@operato/i18n';
|
13
|
-
import { PageView, store } from '@operato/shell';
|
14
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
15
|
-
import { isMobileDevice } from '@operato/utils';
|
16
|
-
import { p13n } from '@operato/p13n';
|
17
|
-
let Connection = class Connection extends connect(store)(p13n(localize(i18next)(PageView))) {
|
18
|
-
constructor() {
|
19
|
-
super(...arguments);
|
20
|
-
this.active = false;
|
21
|
-
}
|
22
|
-
get context() {
|
23
|
-
var _a;
|
24
|
-
return {
|
25
|
-
title: i18next.t('text.connection list'),
|
26
|
-
search: {
|
27
|
-
handler: search => {
|
28
|
-
this.grist.searchText = search;
|
29
|
-
},
|
30
|
-
value: ((_a = this.grist) === null || _a === void 0 ? void 0 : _a.searchText) || ''
|
31
|
-
},
|
32
|
-
// 필터가 설정되면, 아래 코멘트 해제
|
33
|
-
// filter: {
|
34
|
-
// handler: () => {
|
35
|
-
// const display = this.headroom.style.display
|
36
|
-
// this.headroom.style.display = display !== 'none' ? 'none' : 'flex'
|
37
|
-
// }
|
38
|
-
// },
|
39
|
-
help: 'integration/ui/connection',
|
40
|
-
actions: [
|
41
|
-
Object.assign({ title: i18next.t('button.save'), action: this._updateConnectionManager.bind(this) }, CommonButtonStyles.save),
|
42
|
-
Object.assign({ title: i18next.t('button.delete'), action: this._deleteConnections.bind(this) }, CommonButtonStyles.delete)
|
43
|
-
],
|
44
|
-
exportable: {
|
45
|
-
name: i18next.t('text.connection list'),
|
46
|
-
data: this.exportHandler.bind(this)
|
47
|
-
},
|
48
|
-
importable: {
|
49
|
-
handler: this.importHandler.bind(this)
|
50
|
-
}
|
51
|
-
};
|
52
|
-
}
|
53
|
-
render() {
|
54
|
-
return html `
|
55
|
-
<ox-grist
|
56
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
57
|
-
.config=${this.gristConfig}
|
58
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
59
|
-
.personalConfigProvider=${this.getPagePreferenceProvider('ox-grist')}
|
60
|
-
>
|
61
|
-
<ox-grist-personalizer slot="setting"></ox-grist-personalizer>
|
62
|
-
</ox-grist>
|
63
|
-
`;
|
64
|
-
}
|
65
|
-
async pageInitialized() {
|
66
|
-
this.fetchConnectors();
|
67
|
-
this.gristConfig = {
|
68
|
-
list: { fields: ['name', 'description', 'type', 'active'] },
|
69
|
-
columns: [
|
70
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
71
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
72
|
-
{
|
73
|
-
type: 'gutter',
|
74
|
-
gutterName: 'button',
|
75
|
-
name: 'state',
|
76
|
-
icon: record => (!record ? 'link' : !record.id ? '' : record.state == 'CONNECTED' ? 'link_off' : 'link'),
|
77
|
-
iconOnly: false,
|
78
|
-
title: record => !record
|
79
|
-
? i18next.t('button.connect')
|
80
|
-
: !record.id
|
81
|
-
? ''
|
82
|
-
: record.state == 'CONNECTED'
|
83
|
-
? i18next.t('button.disconnect')
|
84
|
-
: i18next.t('button.connect'),
|
85
|
-
width: 80,
|
86
|
-
handlers: {
|
87
|
-
click: (columns, data, column, record, rowIndex) => {
|
88
|
-
if (!record || !record.name || record.__dirty__ == '+') {
|
89
|
-
return;
|
90
|
-
}
|
91
|
-
if (record.state == 'CONNECTED') {
|
92
|
-
this.disconnect(record);
|
93
|
-
}
|
94
|
-
else {
|
95
|
-
this.connect(record);
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
},
|
100
|
-
{
|
101
|
-
type: 'object',
|
102
|
-
name: 'domain',
|
103
|
-
hidden: true
|
104
|
-
},
|
105
|
-
{
|
106
|
-
type: 'string',
|
107
|
-
name: 'name',
|
108
|
-
label: true,
|
109
|
-
header: i18next.t('field.name'),
|
110
|
-
record: {
|
111
|
-
editable: true,
|
112
|
-
mandatory: true
|
113
|
-
},
|
114
|
-
filter: 'search',
|
115
|
-
sortable: true,
|
116
|
-
width: 150,
|
117
|
-
validation: function (after, before, record, column) {
|
118
|
-
/* connected 상태에서는 이름을 바꿀 수 없다. */
|
119
|
-
if (record.state == 'CONNECTED') {
|
120
|
-
notify({
|
121
|
-
level: 'warn',
|
122
|
-
message: 'connection name cannot be changed during connected.'
|
123
|
-
});
|
124
|
-
return false;
|
125
|
-
}
|
126
|
-
return true;
|
127
|
-
}
|
128
|
-
},
|
129
|
-
{
|
130
|
-
type: 'string',
|
131
|
-
name: 'description',
|
132
|
-
label: true,
|
133
|
-
header: i18next.t('field.description'),
|
134
|
-
record: {
|
135
|
-
editable: true
|
136
|
-
},
|
137
|
-
filter: 'search',
|
138
|
-
width: 200
|
139
|
-
},
|
140
|
-
{
|
141
|
-
type: 'checkbox',
|
142
|
-
name: 'active',
|
143
|
-
label: true,
|
144
|
-
header: i18next.t('field.active'),
|
145
|
-
record: {
|
146
|
-
editable: true,
|
147
|
-
align: 'center'
|
148
|
-
},
|
149
|
-
sortable: true,
|
150
|
-
width: 60
|
151
|
-
},
|
152
|
-
{
|
153
|
-
type: 'connector',
|
154
|
-
name: 'type',
|
155
|
-
label: true,
|
156
|
-
header: i18next.t('field.type'),
|
157
|
-
record: {
|
158
|
-
renderer: HelpDecoratedRenderer,
|
159
|
-
editable: true,
|
160
|
-
help: value => { var _a, _b; return (_b = (_a = this.connectors) === null || _a === void 0 ? void 0 : _a[value]) === null || _b === void 0 ? void 0 : _b.help; },
|
161
|
-
mandatory: true
|
162
|
-
},
|
163
|
-
filter: 'search',
|
164
|
-
sortable: true,
|
165
|
-
width: 200
|
166
|
-
},
|
167
|
-
{
|
168
|
-
type: 'string',
|
169
|
-
name: 'endpoint',
|
170
|
-
header: i18next.t('field.endpoint'),
|
171
|
-
record: {
|
172
|
-
editable: true,
|
173
|
-
mandatory: true
|
174
|
-
},
|
175
|
-
filter: 'search',
|
176
|
-
sortable: true,
|
177
|
-
width: 200
|
178
|
-
},
|
179
|
-
{
|
180
|
-
type: 'parameters',
|
181
|
-
name: 'params',
|
182
|
-
header: i18next.t('field.params'),
|
183
|
-
record: {
|
184
|
-
editable: true,
|
185
|
-
options: async (value, column, record, row, field) => {
|
186
|
-
var _a;
|
187
|
-
const { name, help, parameterSpec: spec } = record.type ? (_a = this.connectors) === null || _a === void 0 ? void 0 : _a[record.type] : {};
|
188
|
-
const context = this.grist;
|
189
|
-
return { name, help, spec, context };
|
190
|
-
},
|
191
|
-
renderer: 'json5'
|
192
|
-
},
|
193
|
-
width: 100
|
194
|
-
},
|
195
|
-
{
|
196
|
-
type: 'resource-object',
|
197
|
-
name: 'edge',
|
198
|
-
header: i18next.t('field.edge-server'),
|
199
|
-
record: {
|
200
|
-
editable: true,
|
201
|
-
options: {
|
202
|
-
queryName: 'edges'
|
203
|
-
}
|
204
|
-
},
|
205
|
-
sortable: true,
|
206
|
-
width: 120
|
207
|
-
},
|
208
|
-
{
|
209
|
-
type: 'resource-object',
|
210
|
-
name: 'updater',
|
211
|
-
header: i18next.t('field.updater'),
|
212
|
-
record: {
|
213
|
-
editable: false
|
214
|
-
},
|
215
|
-
sortable: true,
|
216
|
-
width: 120
|
217
|
-
},
|
218
|
-
{
|
219
|
-
type: 'datetime',
|
220
|
-
name: 'updatedAt',
|
221
|
-
header: i18next.t('field.updated_at'),
|
222
|
-
record: {
|
223
|
-
editable: false
|
224
|
-
},
|
225
|
-
sortable: true,
|
226
|
-
width: 180
|
227
|
-
}
|
228
|
-
],
|
229
|
-
rows: {
|
230
|
-
selectable: {
|
231
|
-
multiple: true
|
232
|
-
}
|
233
|
-
},
|
234
|
-
sorters: [
|
235
|
-
{
|
236
|
-
name: 'name'
|
237
|
-
}
|
238
|
-
]
|
239
|
-
};
|
240
|
-
}
|
241
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
242
|
-
const response = await client.query({
|
243
|
-
query: gql `
|
244
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
245
|
-
responses: connections(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
246
|
-
items {
|
247
|
-
id
|
248
|
-
domain {
|
249
|
-
id
|
250
|
-
name
|
251
|
-
description
|
252
|
-
}
|
253
|
-
name
|
254
|
-
description
|
255
|
-
type
|
256
|
-
edge {
|
257
|
-
id
|
258
|
-
name
|
259
|
-
}
|
260
|
-
endpoint
|
261
|
-
active
|
262
|
-
state
|
263
|
-
params
|
264
|
-
updater {
|
265
|
-
id
|
266
|
-
name
|
267
|
-
description
|
268
|
-
}
|
269
|
-
updatedAt
|
270
|
-
}
|
271
|
-
total
|
272
|
-
}
|
273
|
-
}
|
274
|
-
`,
|
275
|
-
variables: {
|
276
|
-
filters,
|
277
|
-
pagination: { page, limit },
|
278
|
-
sortings
|
279
|
-
}
|
280
|
-
});
|
281
|
-
return {
|
282
|
-
total: response.data.responses.total || 0,
|
283
|
-
records: response.data.responses.items || []
|
284
|
-
};
|
285
|
-
}
|
286
|
-
async fetchConnectors() {
|
287
|
-
const response = await client.query({
|
288
|
-
query: gql `
|
289
|
-
query {
|
290
|
-
connectors {
|
291
|
-
items {
|
292
|
-
name
|
293
|
-
help
|
294
|
-
parameterSpec {
|
295
|
-
type
|
296
|
-
name
|
297
|
-
label
|
298
|
-
placeholder
|
299
|
-
property
|
300
|
-
styles
|
301
|
-
}
|
302
|
-
}
|
303
|
-
}
|
304
|
-
}
|
305
|
-
`
|
306
|
-
});
|
307
|
-
if (!response.errors) {
|
308
|
-
this.connectors = response.data.connectors.items.reduce((connectors, connector) => {
|
309
|
-
connectors[connector.name] = connector;
|
310
|
-
return connectors;
|
311
|
-
}, {});
|
312
|
-
}
|
313
|
-
else {
|
314
|
-
console.error('fetch connectors error');
|
315
|
-
}
|
316
|
-
}
|
317
|
-
async _deleteConnections(name) {
|
318
|
-
if (confirm(i18next.t('text.sure_to_x', {
|
319
|
-
x: i18next.t('text.delete')
|
320
|
-
}))) {
|
321
|
-
const names = this.grist.selected.map(record => record.name);
|
322
|
-
if (names && names.length > 0) {
|
323
|
-
const response = await client.mutate({
|
324
|
-
mutation: gql `
|
325
|
-
mutation ($names: [String!]!) {
|
326
|
-
deleteConnections(names: $names)
|
327
|
-
}
|
328
|
-
`,
|
329
|
-
variables: {
|
330
|
-
names
|
331
|
-
}
|
332
|
-
});
|
333
|
-
if (!response.errors) {
|
334
|
-
this.grist.fetch();
|
335
|
-
notify({
|
336
|
-
message: i18next.t('text.info_x_successfully', {
|
337
|
-
x: i18next.t('text.delete')
|
338
|
-
})
|
339
|
-
});
|
340
|
-
}
|
341
|
-
}
|
342
|
-
}
|
343
|
-
}
|
344
|
-
async _updateConnectionManager() {
|
345
|
-
var patches = this.grist.dirtyRecords;
|
346
|
-
if (patches && patches.length) {
|
347
|
-
patches = patches.map(connection => {
|
348
|
-
let patchField = connection.id ? { id: connection.id } : {};
|
349
|
-
const dirtyFields = connection.__dirtyfields__;
|
350
|
-
for (let key in dirtyFields) {
|
351
|
-
patchField[key] = dirtyFields[key].after;
|
352
|
-
}
|
353
|
-
patchField.cuFlag = connection.__dirty__;
|
354
|
-
return patchField;
|
355
|
-
});
|
356
|
-
const response = await client.mutate({
|
357
|
-
mutation: gql `
|
358
|
-
mutation ($patches: [ConnectionPatch!]!) {
|
359
|
-
updateMultipleConnection(patches: $patches) {
|
360
|
-
name
|
361
|
-
}
|
362
|
-
}
|
363
|
-
`,
|
364
|
-
variables: {
|
365
|
-
patches
|
366
|
-
}
|
367
|
-
});
|
368
|
-
if (!response.errors)
|
369
|
-
this.grist.fetch();
|
370
|
-
}
|
371
|
-
}
|
372
|
-
async connect(record) {
|
373
|
-
var response = await client.mutate({
|
374
|
-
mutation: gql `
|
375
|
-
mutation ($name: String!) {
|
376
|
-
connectConnection(name: $name) {
|
377
|
-
state
|
378
|
-
}
|
379
|
-
}
|
380
|
-
`,
|
381
|
-
variables: {
|
382
|
-
name: record.name
|
383
|
-
}
|
384
|
-
});
|
385
|
-
var state = response.data.connectConnection.state;
|
386
|
-
record.state = state;
|
387
|
-
this.grist.refresh();
|
388
|
-
notify({
|
389
|
-
level: 'info',
|
390
|
-
message: `${state == 'CONNECTED' ? 'success' : 'fail'} to connect : ${record.name}`
|
391
|
-
});
|
392
|
-
}
|
393
|
-
async disconnect(record) {
|
394
|
-
var response = await client.mutate({
|
395
|
-
mutation: gql `
|
396
|
-
mutation ($name: String!) {
|
397
|
-
disconnectConnection(name: $name) {
|
398
|
-
state
|
399
|
-
}
|
400
|
-
}
|
401
|
-
`,
|
402
|
-
variables: {
|
403
|
-
name: record.name
|
404
|
-
}
|
405
|
-
});
|
406
|
-
var state = response.data.disconnectConnection.state;
|
407
|
-
record.state = state;
|
408
|
-
this.grist.refresh();
|
409
|
-
notify({
|
410
|
-
level: 'info',
|
411
|
-
message: `${state == 'CONNECTED' ? 'fail' : 'success'} to disconnect : ${record.name}`
|
412
|
-
});
|
413
|
-
}
|
414
|
-
async exportHandler() {
|
415
|
-
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
|
416
|
-
const targetFieldSet = new Set(['id', 'name', 'type', 'description', 'endpoint', 'params']);
|
417
|
-
return exportTargets.map(connection => {
|
418
|
-
let tempObj = {};
|
419
|
-
for (const field of targetFieldSet) {
|
420
|
-
tempObj[field] = connection[field];
|
421
|
-
}
|
422
|
-
return tempObj;
|
423
|
-
});
|
424
|
-
}
|
425
|
-
async importHandler(records) {
|
426
|
-
openPopup(html `
|
427
|
-
<connection-importer
|
428
|
-
.connections=${records}
|
429
|
-
@imported=${() => {
|
430
|
-
history.back();
|
431
|
-
this.grist.fetch();
|
432
|
-
}}
|
433
|
-
></connection-importer>
|
434
|
-
`, {
|
435
|
-
backdrop: true,
|
436
|
-
size: 'large',
|
437
|
-
title: i18next.t('title.import connection')
|
438
|
-
});
|
439
|
-
}
|
440
|
-
};
|
441
|
-
Connection.styles = [
|
442
|
-
CommonGristStyles,
|
443
|
-
ScrollbarStyles,
|
444
|
-
css `
|
445
|
-
:host {
|
446
|
-
display: flex;
|
447
|
-
flex-direction: column;
|
448
|
-
|
449
|
-
overflow: hidden;
|
450
|
-
}
|
451
|
-
|
452
|
-
ox-grist {
|
453
|
-
overflow-y: auto;
|
454
|
-
flex: 1;
|
455
|
-
}
|
456
|
-
`
|
457
|
-
];
|
458
|
-
__decorate([
|
459
|
-
property({ type: Boolean }),
|
460
|
-
__metadata("design:type", Boolean)
|
461
|
-
], Connection.prototype, "active", void 0);
|
462
|
-
__decorate([
|
463
|
-
property({ type: Object }),
|
464
|
-
__metadata("design:type", Object)
|
465
|
-
], Connection.prototype, "gristConfig", void 0);
|
466
|
-
__decorate([
|
467
|
-
property({ type: Object }),
|
468
|
-
__metadata("design:type", Object)
|
469
|
-
], Connection.prototype, "connectors", void 0);
|
470
|
-
__decorate([
|
471
|
-
query('ox-grist'),
|
472
|
-
__metadata("design:type", DataGrist)
|
473
|
-
], Connection.prototype, "grist", void 0);
|
474
|
-
Connection = __decorate([
|
475
|
-
customElement('connection-page')
|
476
|
-
], Connection);
|
477
|
-
export { Connection };
|
478
|
-
//# sourceMappingURL=connection.js.map
|
@@ -1 +0,0 @@
|
|
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;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAG7B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;IAA1E;;QAmBwB,WAAM,GAAY,KAAK,CAAA;IAgdtD,CAAC;IA1cC,IAAI,OAAO;;QACT,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,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ACd,iBAAiB;IACjB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;KAYF;CACF,AAhBY,CAgBZ;AAE4B;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;AAvBzB,UAAU;IADtB,aAAa,CAAC,iBAAiB,CAAC;GACpB,UAAU,CAmetB","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'\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.active'),\n record: {\n editable: true,\n align: 'center'\n },\n sortable: true,\n width: 60\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: 200\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 return { name, help, spec, context }\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 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 }\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,24 +0,0 @@
|
|
1
|
-
import '../analysis/graph-viewer.js';
|
2
|
-
import { PageView } from '@operato/shell';
|
3
|
-
declare const IntegrationAnalysis_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
4
|
-
export declare class IntegrationAnalysis extends IntegrationAnalysis_base {
|
5
|
-
static styles: import("lit").CSSResult[];
|
6
|
-
private graphViewer?;
|
7
|
-
private analysis?;
|
8
|
-
private info?;
|
9
|
-
container: HTMLDivElement;
|
10
|
-
nodeInfo: HTMLAnchorElement;
|
11
|
-
get context(): {
|
12
|
-
title: string;
|
13
|
-
search: {
|
14
|
-
handler: (search: any) => Promise<void>;
|
15
|
-
};
|
16
|
-
help: string;
|
17
|
-
};
|
18
|
-
render(): import("lit-html").TemplateResult<1>;
|
19
|
-
updated(changes: any): void;
|
20
|
-
pageUpdated(changes: any): Promise<void>;
|
21
|
-
fetchIntegrationAnalysis(): Promise<void>;
|
22
|
-
onSearch(search: string): Promise<void>;
|
23
|
-
}
|
24
|
-
export {};
|