Skip to content

Commit

Permalink
Merge branch 'beta-4.52.4' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker authored Nov 17, 2023
2 parents 2c0f6e6 + 81878e7 commit 074349d
Show file tree
Hide file tree
Showing 33 changed files with 225 additions and 132 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="accessory-box" [ngClass]="{'switch-on': service.values.On}" appLongclick (longclick)="onLongClick()"
<div class="accessory-box" [ngClass]="{'light-on': service.values.On}" appLongclick (longclick)="onLongClick()"
(shortclick)="onClick()" tabindex="0">
<div class="d-flex flex-column h-100">
<div [inlineSVG]="'/assets/hap-icons/lightbulb.svg'" aria-label="Light Bulb" class="accessory-svg"></div>
Expand All @@ -8,4 +8,4 @@
</div>
<div class="accessory-label grey-text" *ngIf="service.values.Brightness">{{ service.values.Brightness }}%</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class LightbulbComponent implements OnInit {
onLongClick() {
if ('Brightness' in this.service.values) {
const ref = this.modalService.open(LightbulbManageComponent, {
size: 'sm',
size: 'md',
});
ref.componentInstance.service = this.service;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h5 class="modal-title" [innerText]="service.customName || service.serviceName">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center">
<div class="modal-body text-center p-5">

<h5>
<strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
font-size: 1.4rem;
text-transform: initial;
}
}
}

.st0 {
fill: #2ccff9 !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class WindowcoveringComponent implements OnInit {

onLongClick() {
const ref = this.modalService.open(WindowcoveringManageComponent, {
size: 'sm',
size: 'md',
});
ref.componentInstance.service = this.service;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h5 class="modal-title" [innerText]="service.customName || service.serviceName">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body text-center">
<div class="modal-body text-center p-5">

<h5>
<strong>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ 'platform.version.title_service_restart_required' | translate }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="activeModal.dismiss('Dismiss')">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body w-100 text-center">
<i class="fas fa-fw fa-power-off primary-text mb-4" style="font-size: 75px;"></i>
<p class="w-100">{{ 'plugins.manage.message_thanks_for_updating_restart' | translate }}</p>
</div>
<div class="modal-footer justify-content-between">
<div class="text-left">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.dismiss('Dismiss')">
{{ 'form.button_close' | translate }}
</button>
</div>
<div class="text-center"></div>
<div class="text-right">
<button type="button" class="btn btn-primary" (click)="onRestartHomebridgeClick()">
{{ 'plugins.manage.button_restart_now' | translate }}
</button>
</div>
</div>
</div>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';

@Component({
selector: 'app-confirm',
templateUrl: './restart-homebridge.component.html',
styleUrls: ['./restart-homebridge.component.scss'],
})
export class RestartHomebridgeComponent implements OnInit {
constructor(
public activeModal: NgbActiveModal,
private $router: Router,
) { }

ngOnInit() {}

public onRestartHomebridgeClick() {
this.$router.navigate(['/restart']);
this.activeModal.close();
}
}
2 changes: 2 additions & 0 deletions ui/src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ConvertTempPipe } from './pipes/convert-temp.pipe';
import { ExternalLinkIconPipe } from './pipes/external-link-icon.pipe';
import { ReplacePipe } from './pipes/replace.pipe';
import { InformationComponent } from '@/app/core/components/information/information.component';
import { RestartHomebridgeComponent } from '@/app/core/components/restart-homebridge/restart-homebridge.component';

@NgModule({
declarations: [
Expand All @@ -32,6 +33,7 @@ import { InformationComponent } from '@/app/core/components/information/informat
ScheduledBackupsComponent,
ConfirmComponent,
InformationComponent,
RestartHomebridgeComponent,
QrcodeComponent,
],
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ <h5 class="primary-text">
</div>
<div class="modal-footer justify-content-between">
<div class="text-left">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.close('Dismiss')"
*ngIf="configBlocks.length">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.close('Dismiss')">
{{ 'form.button_close' | translate }}
</button>
</div>
Expand All @@ -122,16 +121,15 @@ <h5 class="primary-text">
<i [ngClass]="plugin.links.homepage | externalLinkIcon"></i>
</a>
</div>
<div class="text-center" *ngIf="!configBlocks.length">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.close('Dismiss')">
{{ 'form.button_close' | translate }}
</button>
</div>
<div class="text-center" *ngIf="!configBlocks.length"></div>
<div class="text-right">
<button type="button" class="btn btn-primary" (click)="save()" [disabled]="saveInProgress"
*ngIf="configBlocks.length">
{{ 'form.button_save' | translate }} <i *ngIf="saveInProgress" class="fas fa-fw fa-spinner fa-pulse"></i>
</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" (click)="openPluginConfig()" *ngIf="!configBlocks.length">
{{ 'plugins.button_settings' | translate }}
</button>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Router } from '@angular/router';
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
import { ToastrService } from 'ngx-toastr';
import { ApiService } from '@/app/core/api.service';
import { NotificationService } from '@/app/core/notification.service';
import { RestartHomebridgeComponent } from '@/app/core/components/restart-homebridge/restart-homebridge.component';
import { ManagePluginsService } from '@/app/core/manage-plugins/manage-plugins.service';
import { SettingsService } from '@/app/core/settings.service';

@Component({
Expand All @@ -27,8 +29,10 @@ export class BridgePluginsModalComponent implements OnInit {
constructor(
public activeModal: NgbActiveModal,
public $settings: SettingsService,
private $notification: NotificationService,
private $api: ApiService,
private $modal: NgbModal,
private $plugins: ManagePluginsService,
private $router: Router,
private $toastr: ToastrService,
private $translate: TranslateService,
) { }
Expand Down Expand Up @@ -95,8 +99,8 @@ export class BridgePluginsModalComponent implements OnInit {

try {
await this.$api.post(`/config-editor/plugin/${encodeURIComponent(this.plugin.name)}`, this.configBlocks).toPromise();
this.$notification.configUpdated.next(undefined);
this.activeModal.close();
this.$modal.open(RestartHomebridgeComponent);
} catch (err) {
this.$toastr.error(
this.$translate.instant('config.toast_failed_to_save_config') + ': ' + err.error?.message,
Expand All @@ -107,6 +111,18 @@ export class BridgePluginsModalComponent implements OnInit {
}
}

openPluginConfig() {
// Close the existing modal
this.activeModal.close();

// Open the plugin config modal
this.$plugins.settings({
name: this.plugin.name,
settingsSchema: true,
links: {},
});
}

async restartChildBridge(username: string) {
this.restartInProgress[username] = true;
try {
Expand Down Expand Up @@ -144,4 +160,8 @@ export class BridgePluginsModalComponent implements OnInit {
return username;
}

openFullConfigEditor() {
this.$router.navigate(['/config']);
this.activeModal.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ <h5 class="modal-title">
[translate]="'plugins.manage.message_thanks_for_updating_restart_child_bridges'">
Please restart the plugin's child bridges for the changes to apply.
</p>
<div class="text-center">
<button type="button" class="btn btn-primary" *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(plugin.name) && childBridges.length > 0"
(click)="onRestartChildBridgeClick()">
{{ (childBridges.length === 1 ? 'plugins.manage.child_bridge_button_restart_now_one' : 'plugins.manage.child_bridge_button_restart_now') | translate }}
</button>
<button type="button" class="btn btn-primary"
*ngIf="['homebridge', 'homebridge-config-ui-x'].includes(plugin.name) || childBridges.length === 0" (click)="onRestartHomebridgeClick()"
[translate]="'plugins.manage.button_restart_now'">Restart Homebridge</button>
</div>
</div>

<div class="modal-body" style="min-height: 110px;" [hidden]="justSavedAndExited">
Expand Down Expand Up @@ -92,5 +83,22 @@ <h5 class="modal-title">
</button>
</div>
</div>
<div class="modal-footer" [hidden]="!justSavedAndExited"></div>
<div class="modal-footer justify-content-between" [hidden]="!justSavedAndExited">
<div class="text-left">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.close('Dismiss')">
{{ 'form.button_close' | translate }}
</button>
</div>
<div class="text-center"></div>
<div class="text-right">
<button type="button" class="btn btn-primary" *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(plugin.name) && childBridges.length > 0"
(click)="onRestartChildBridgeClick()">
{{ (childBridges.length === 1 ? 'plugins.manage.child_bridge_button_restart_now_one' : 'plugins.manage.child_bridge_button_restart_now') | translate }}
</button>
<button type="button" class="btn btn-primary"
*ngIf="['homebridge', 'homebridge-config-ui-x'].includes(plugin.name) || childBridges.length === 0" (click)="onRestartHomebridgeClick()">
{{ 'plugins.manage.button_restart_now' | translate }}
</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ <h3 class="text-center primary-text" [translate]="'platform.version.title_servic
[translate]="'plugins.manage.message_thanks_for_updating_restart_child_bridges'">
Please restart the plugin's child bridges for the changes to apply.
</p>
<div class="text-center">
<button type="button" class="btn btn-primary" *ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(pluginName) && childBridges.length > 0"
(click)="onRestartChildBridgeClick()">
{{ (childBridges.length === 1 ? 'plugins.manage.child_bridge_button_restart_now_one' : 'plugins.manage.child_bridge_button_restart_now') | translate }}
</button>
<button type="button" class="btn btn-primary"
*ngIf="['homebridge', 'homebridge-config-ui-x'].includes(pluginName) || childBridges.length === 0" (click)="onRestartHomebridgeClick()"
[translate]="'plugins.manage.button_restart_now'">Restart Homebridge</button>
</div>
<hr>
</div>
<div class="alert show alert-info pt-3 px-3 pb-0 mb-0">
<markdown class="plugin-md" [data]="changeLog"></markdown>
Expand All @@ -50,7 +40,6 @@ <h4 class="primary-text text-center" [translate]="'plugins.manage.label_manual_u
npm install -g {{ pluginName }}@{{targetVersion}}
hb-service start</pre>
</div>
<hr>
</div>
<div *ngIf="showReleaseNotes && !actionComplete" class="modal-body plugin-modal-body">
<h5 *ngIf="!updateToBeta">{{ 'plugins.manage.label_release_notes' | translate }} <span *ngIf="release.name">({{ release.name }})</span></h5>
Expand All @@ -61,19 +50,27 @@ <h5 *ngIf="updateToBeta">{{ 'plugins.manage.label_release_notes_beta' | translat
</div>
<div class="modal-footer justify-content-between" *ngIf="!onlineUpdateOk || actionComplete || showReleaseNotes || actionFailed">
<div class="text-left">
<button *ngIf="!justUpdatedPlugin && !actionFailed" type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.dismiss('Dismiss')">
<button *ngIf="!actionFailed" type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.dismiss('Dismiss')">
{{ 'form.button_close' | translate }}
</button>
</div>
<div class="text-center">
<button *ngIf="justUpdatedPlugin || actionFailed" type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.dismiss('Dismiss')">
<button *ngIf="actionFailed" type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.dismiss('Dismiss')">
{{ 'form.button_close' | translate }}
</button>
</div>
<div class="text-right">
<button *ngIf="onlineUpdateOk && showReleaseNotes" type="button" class="btn btn-primary" (click)="update()">
{{ 'plugins.button_update' | translate }}
</button>
<button type="button" class="btn btn-primary" *ngIf="justUpdatedPlugin && !['homebridge', 'homebridge-config-ui-x'].includes(pluginName) && childBridges.length > 0"
(click)="onRestartChildBridgeClick()">
{{ (childBridges.length === 1 ? 'plugins.manage.child_bridge_button_restart_now_one' : 'plugins.manage.child_bridge_button_restart_now') | translate }}
</button>
<button type="button" class="btn btn-primary" *ngIf="justUpdatedPlugin && (['homebridge', 'homebridge-config-ui-x'].includes(pluginName) || childBridges.length === 0)"
(click)="onRestartHomebridgeClick()">
{{ 'plugins.manage.button_restart_now' | translate }}
</button>
</div>
</div>
</div>
Loading

0 comments on commit 074349d

Please sign in to comment.