Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "add childbridge restart"
Browse files Browse the repository at this point in the history
This reverts commit d4a6442.
donavanbecker committed Nov 2, 2023
1 parent d4a6442 commit bf30d77
Showing 2 changed files with 4 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -11,24 +11,13 @@ <h3 class="text-center primary-text" [translate]="'platform.version.title_servic
<p class="text-center grey-text" [translate]="'plugins.manage.message_thanks_for_updating'">
Thanks for installing the latest version of {{ pluginName }}.
</p>
<p *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(pluginName)" class="text-center grey-text"
[translate]="'plugins.manage.message_thanks_for_updating_restart'">
Please restart Homebridge for the changes to apply. Alternatively, if you have this plugin running in child
bridges, you can close this modal and restart these instead.
<p *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(pluginName)" class="text-center grey-text" [translate]="'plugins.manage.message_thanks_for_updating_restart'">
Please restart Homebridge for the changes to apply. Alternatively, if you have this plugin running in child bridges, you can close this modal and restart these instead.
</p>
<div class="text-center">
<button *ngIf="$settings.env.serviceMode" class="btn btn-primary waves-effect mr-0"
[disabled]="restartInProgress[item._bridge?.username]" ngbTooltip="{{'menu.tooltip_restart' | translate}}"
container="body" openDelay="150" (click)="restartChildBridge(item._bridge?.username)">
<i class="fas fa-fw nav-menu-icon" [ngClass]="{
'fa-power-off': !restartInProgress[item._bridge?.username],
'fa-spinner fa-pulse': restartInProgress[item._bridge?.username]
}"></i>
Restart Child Bridge Now</button>
<button type="button" class="btn btn-primary" (click)="onRestartHomebridgeClick()"
[translate]="'plugins.manage.button_restart_now'">Restart Homebridge Now</button>
<button *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(pluginName)" type="button"
class="btn btn-primary" data-dismiss="modal" (click)="activeModal.dismiss('Cross click')"
<button *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(pluginName)" type="button" class="btn btn-primary" data-dismiss="modal" (click)="activeModal.dismiss('Cross click')"
[translate]="'form.button_close'">Close</button>
</div>
<hr>
@@ -66,4 +55,4 @@ <h5>{{ release.name }}</h5>
<button *ngIf="onlineUpdateOk && showReleaseNotes" type="button" class="btn btn-primary" (click)="update()"
[translate]="'plugins.button_update'">Update</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
public showReleaseNotes = false;
public justUpdatedPlugin = false;
public updateToBeta = false;
public restartInProgress: Record<string, boolean> = {};
public changeLog: string;
public release;

@@ -46,7 +45,6 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
public activeModal: NgbActiveModal,
public $toastr: ToastrService,
private translate: TranslateService,
private $translate: TranslateService,
private $settings: SettingsService,
private $api: ApiService,
private $ws: WsService,
@@ -180,27 +178,6 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
);
}

async restartChildBridge(username: string) {
this.restartInProgress[username] = true;
try {
await this.$api.put(`/server/restart/${username.replace(/:/g, '')}`, {}).toPromise();
this.$toastr.success(
this.$translate.instant('child_bridge.toast_restart_requested'),
this.$translate.instant('toast.title_success'),
);
} catch (err) {
this.$toastr.error(
'Failed to restart bridge: ' + err.error?.message,
this.$translate.instant('toast.title_error'),
);
this.restartInProgress[username] = false;
} finally {
setTimeout(() => {
this.restartInProgress[username] = false;
}, 12000);
}
}

upgradeHomebridge() {
this.io.request('homebridge-update', {
version: this.targetVersion,

0 comments on commit bf30d77

Please sign in to comment.