verteilen-core 1.2.19 → 1.2.21

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.
@@ -191,21 +191,25 @@ class ServerDetail {
191
191
  };
192
192
  shell_open = (socket, uuid) => {
193
193
  this.websocket_manager.shell_open(uuid);
194
- if (this.shellBind.has(uuid)) {
195
- this.shellBind.get(uuid).push(this.feedback.socket);
196
- }
197
- else {
198
- this.shellBind.set(uuid, [this.feedback.socket]);
194
+ if (this.feedback.socket) {
195
+ if (this.shellBind.has(uuid)) {
196
+ this.shellBind.get(uuid).push(this.feedback.socket);
197
+ }
198
+ else {
199
+ this.shellBind.set(uuid, [this.feedback.socket]);
200
+ }
199
201
  }
200
202
  };
201
203
  shell_close = (socket, uuid) => {
202
204
  this.websocket_manager.shell_close(uuid);
203
- if (this.shellBind.has(uuid)) {
204
- const p = this.shellBind.get(uuid);
205
- const index = p.findIndex(x => x == this.feedback.socket);
206
- if (index != -1)
207
- p.splice(index, 1);
208
- this.shellBind.set(uuid, p);
205
+ if (this.feedback.socket) {
206
+ if (this.shellBind.has(uuid)) {
207
+ const p = this.shellBind.get(uuid);
208
+ const index = p.findIndex(x => x == this.feedback.socket);
209
+ if (index != -1)
210
+ p.splice(index, 1);
211
+ this.shellBind.set(uuid, p);
212
+ }
209
213
  }
210
214
  };
211
215
  shell_folder = (socket, uuid, path) => {
@@ -213,33 +217,33 @@ class ServerDetail {
213
217
  };
214
218
  node_list = (socket) => {
215
219
  const p = this.websocket_manager?.targets;
216
- if (socket != undefined) {
220
+ if (this.feedback.socket != undefined) {
217
221
  const h = {
218
222
  name: "node_list-feedback",
219
223
  data: this.websocket_manager?.targets
220
224
  };
221
- socket.send(JSON.stringify(h));
225
+ this.feedback.socket(JSON.stringify(h));
222
226
  }
223
227
  return p;
224
228
  };
225
229
  node_add = (socket, url, id) => {
226
230
  const p = this.websocket_manager.server_start(url, id);
227
- if (socket != undefined) {
231
+ if (this.feedback.socket != undefined) {
228
232
  const h = {
229
233
  name: "node_add-feedback",
230
234
  data: p
231
235
  };
232
- socket.send(JSON.stringify(h));
236
+ this.feedback.socket(JSON.stringify(h));
233
237
  }
234
238
  };
235
239
  node_update = (socket) => {
236
240
  const p = this.websocket_manager?.server_update();
237
- if (socket != undefined) {
241
+ if (this.feedback.socket != undefined) {
238
242
  const h = {
239
243
  name: "node_update-feedback",
240
244
  data: [p]
241
245
  };
242
- socket.send(JSON.stringify(h));
246
+ this.feedback.socket(JSON.stringify(h));
243
247
  }
244
248
  return p;
245
249
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verteilen-core",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
4
4
  "license": "MIT",
5
5
  "homepage": "https://verteilen.github.io/wiki/",
6
6
  "author": "Elly",
@@ -278,19 +278,23 @@ export class ServerDetail {
278
278
  }
279
279
  shell_open = (socket:any, uuid: string) => {
280
280
  this.websocket_manager!.shell_open(uuid)
281
- if(this.shellBind.has(uuid)){
282
- this.shellBind.get(uuid).push(this.feedback.socket)
283
- }else{
284
- this.shellBind.set(uuid, [this.feedback.socket])
281
+ if(this.feedback.socket){
282
+ if(this.shellBind.has(uuid)){
283
+ this.shellBind.get(uuid).push(this.feedback.socket)
284
+ }else{
285
+ this.shellBind.set(uuid, [this.feedback.socket])
286
+ }
285
287
  }
286
288
  }
287
289
  shell_close = (socket:any, uuid: string) => {
288
290
  this.websocket_manager!.shell_close(uuid)
289
- if(this.shellBind.has(uuid)){
290
- const p:Array<any> = this.shellBind.get(uuid)
291
- const index = p.findIndex(x => x == this.feedback.socket)
292
- if(index != -1) p.splice(index, 1)
293
- this.shellBind.set(uuid, p)
291
+ if(this.feedback.socket){
292
+ if(this.shellBind.has(uuid)){
293
+ const p:Array<any> = this.shellBind.get(uuid)
294
+ const index = p.findIndex(x => x == this.feedback.socket)
295
+ if(index != -1) p.splice(index, 1)
296
+ this.shellBind.set(uuid, p)
297
+ }
294
298
  }
295
299
  }
296
300
  shell_folder = (socket:any, uuid: string, path:string) => {
@@ -299,33 +303,33 @@ export class ServerDetail {
299
303
 
300
304
  node_list = (socket:any) => {
301
305
  const p = this.websocket_manager?.targets
302
- if(socket != undefined){
306
+ if(this.feedback.socket != undefined){
303
307
  const h:Header = {
304
308
  name: "node_list-feedback",
305
309
  data: this.websocket_manager?.targets
306
310
  }
307
- socket.send(JSON.stringify(h))
311
+ this.feedback.socket(JSON.stringify(h))
308
312
  }
309
313
  return p
310
314
  }
311
315
  node_add = (socket:any, url:string, id:string) => {
312
316
  const p = this.websocket_manager!.server_start(url, id)
313
- if(socket != undefined){
317
+ if(this.feedback.socket != undefined){
314
318
  const h:Header = {
315
319
  name: "node_add-feedback",
316
320
  data: p
317
321
  }
318
- socket.send(JSON.stringify(h))
322
+ this.feedback.socket(JSON.stringify(h))
319
323
  }
320
324
  }
321
325
  node_update = (socket:any) => {
322
326
  const p = this.websocket_manager?.server_update()
323
- if(socket != undefined){
327
+ if(this.feedback.socket != undefined){
324
328
  const h:Header = {
325
329
  name: "node_update-feedback",
326
330
  data: [p]
327
331
  }
328
- socket.send(JSON.stringify(h))
332
+ this.feedback.socket(JSON.stringify(h))
329
333
  }
330
334
  return p
331
335
  }