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