From 92073322c085f79671862b82295db3ced02d1733 Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Fri, 10 Nov 2023 02:53:34 +0000 Subject: [PATCH] try restart child bridge --- .../manage-plugins-modal.component.ts | 26 ++++++++++--------- .../app/modules/plugins/plugins.component.ts | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts b/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts index 896f817b4..044839def 100644 --- a/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts +++ b/ui/src/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component.ts @@ -250,18 +250,20 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy { } public async onRestartChildBridgeClick() { - // bridge.restartInProgress = true; - // try { - // await this.io.request('restart-child-bridge', bridge.username).toPromise(); - // } catch (err) { - // this.$toastr.error( - // 'Failed to restart bridge: ' + err.error?.message, - // this.$translate.instant('toast.title_error'), - // ); - // bridge.restartInProgress = false; - // } finally { - // this.activeModal.close(); - // } + const io = this.$ws.connectToNamespace('child-bridges'); + try { + for (const bridge of this.childBridges) { + await io.request('restart-child-bridge', bridge.username).toPromise(); + } + } catch (err) { + this.$toastr.error( + 'Failed to restart child bridge: ' + err.error?.message, + this.$translate.instant('toast.title_error'), + ); + } finally { + io.end(); + this.activeModal.close(); + } } ngOnDestroy() { diff --git a/ui/src/app/modules/plugins/plugins.component.ts b/ui/src/app/modules/plugins/plugins.component.ts index 47573d21b..3da041589 100644 --- a/ui/src/app/modules/plugins/plugins.component.ts +++ b/ui/src/app/modules/plugins/plugins.component.ts @@ -57,7 +57,7 @@ export class PluginsComponent implements OnInit, OnDestroy { }); this.navigationSubscription = this.$router.events.subscribe((e: any) => { - // If it is a NavigationEnd event re-initalise the component + // If it is a NavigationEnd event re-initialise the component if (e instanceof NavigationEnd) { this.loadInstalledPlugins(); }