Skip to content

Commit

Permalink
Merge branch 'beta-4.52.2' into patch-12
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker authored Nov 9, 2023
2 parents 578e362 + 9f9cf4b commit 44967c3
Show file tree
Hide file tree
Showing 40 changed files with 256 additions and 68 deletions.
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
],
"exec": "sleep 2 && UIX_INSECURE_MODE=1 UIX_SERVICE_MODE=1 HOMEBRIDGE_CONFIG_UI_TERMINAL=1 ts-node -r tsconfig-paths/register src/bin/hb-service.ts run --stdout",
"signal": "SIGTERM"
}
}
32 changes: 16 additions & 16 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
"@nestjs/passport": "10.0.2",
"@nestjs/platform-fastify": "10.2.8",
"@nestjs/platform-socket.io": "10.2.8",
"@nestjs/swagger": "7.1.14",
"@nestjs/swagger": "7.1.15",
"@nestjs/websockets": "10.2.8",
"@oznu/hap-client": "1.9.0",
"axios": "1.6.0",
"axios": "1.6.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.0",
"commander": "11.1.0",
Expand Down
6 changes: 3 additions & 3 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,6 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: 'app-confirm',
Expand All @@ -15,7 +14,6 @@ export class InformationComponent implements OnInit {

constructor(
public activeModal: NgbActiveModal,
private translate: TranslateService,
) { }

ngOnInit() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ <h5 class="modal-title">{{ presentTenseVerb }}: {{ pluginName }}</h5>
<h3 class="text-center primary-text" [translate]="'platform.version.title_service_restart_required'">
Restart Required
</h3>
<p class="text-center grey-text" translate="plugins.manage.message_thanks_for_updating" [translateParams]="{ pluginName: pluginName, targetVersion: targetVersion }"></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 class="text-center grey-text" translate="plugins.manage.message_thanks_for_updating"
[translateParams]="{ pluginName: pluginName, targetVersion: targetVersion }"></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>
<div class="text-center">
<button type="button" class="btn btn-primary"
*ngIf="!['homebridge', 'homebridge-config-ui-x'].includes(pluginName)"
(click)="onRestartChildBridgeClick(item._bridge?.username)"
[translate]="'plugins.manage.child_bridge_button_restart_now'">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>
Expand Down Expand Up @@ -53,4 +61,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
Expand Up @@ -41,10 +41,12 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {

public onlineUpdateOk: boolean;

public childBridges = [];

constructor(
public activeModal: NgbActiveModal,
public $toastr: ToastrService,
private translate: TranslateService,
private $translate: TranslateService,
private $settings: SettingsService,
private $api: ApiService,
private $ws: WsService,
Expand All @@ -63,20 +65,20 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
this.term.write(data);
});

this.toastSuccess = this.translate.instant('toast.title_success');
this.toastSuccess = this.$translate.instant('toast.title_success');

this.onlineUpdateOk = !(['homebridge', 'homebridge-config-ui-x'].includes(this.pluginName) && this.$settings.env.platform === 'win32');

switch (this.action) {
case 'Install':
this.install();
this.presentTenseVerb = this.translate.instant('plugins.manage.label_install');
this.pastTenseVerb = this.translate.instant('plugins.manage.label_installed');
this.presentTenseVerb = this.$translate.instant('plugins.manage.label_install');
this.pastTenseVerb = this.$translate.instant('plugins.manage.label_installed');
break;
case 'Uninstall':
this.uninstall();
this.presentTenseVerb = this.translate.instant('plugins.manage.label_uninstall');
this.pastTenseVerb = this.translate.instant('plugins.manage.label_uninstalled');
this.presentTenseVerb = this.$translate.instant('plugins.manage.label_uninstall');
this.pastTenseVerb = this.$translate.instant('plugins.manage.label_uninstalled');
break;
case 'Update':
switch (this.targetVersion) {
Expand All @@ -91,8 +93,8 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
default:
this.update();
}
this.presentTenseVerb = this.translate.instant('plugins.manage.label_update');
this.pastTenseVerb = this.translate.instant('plugins.manage.label_updated');
this.presentTenseVerb = this.$translate.instant('plugins.manage.label_update');
this.pastTenseVerb = this.$translate.instant('plugins.manage.label_updated');
break;
}
}
Expand Down Expand Up @@ -122,7 +124,7 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
(err) => {
this.actionFailed = true;
this.$router.navigate(['/plugins']);
this.$toastr.error(err.message, this.translate.instant('toast.title_error'));
this.$toastr.error(err.message, this.$translate.instant('toast.title_error'));
},
);
}
Expand All @@ -140,7 +142,7 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
},
(err) => {
this.actionFailed = true;
this.$toastr.error(err.message, this.translate.instant('toast.title_error'));
this.$toastr.error(err.message, this.$translate.instant('toast.title_error'));
},
);
}
Expand Down Expand Up @@ -173,7 +175,7 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
},
(err) => {
this.actionFailed = true;
this.$toastr.error(err.message, this.translate.instant('toast.title_error'));
this.$toastr.error(err.message, this.$translate.instant('toast.title_error'));
},
);
}
Expand All @@ -191,7 +193,7 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
},
(err) => {
this.actionFailed = true;
this.$toastr.error(err.message, this.translate.instant('toast.title_error'));
this.$toastr.error(err.message, this.$translate.instant('toast.title_error'));
},
);
}
Expand Down Expand Up @@ -231,6 +233,27 @@ export class ManagePluginsModalComponent implements OnInit, OnDestroy {
this.activeModal.close();
}

getChildBridgeMetadata() {
this.io.request('get-homebridge-child-bridge-status').subscribe((data) => {
this.childBridges = data;
});
}

public async onRestartChildBridgeClick(bridge) {
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();
}
}

ngOnDestroy() {
this.io.end();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ <h4 class="card-title mb-0">
<div class="dropdown-divider" *ngIf="plugin.links.homepage || plugin.links.npm"></div>
<a ngbDropdownItem target="_blank" rel="noopener noreferrer" class="text-decoration-none"
*ngIf="plugin.links.homepage || plugin.links.npm" [href]="plugin.links.homepage || plugin.links.npm">
<i class="{{ plugin.links.homepage.startsWith('https://github.com/') ? 'fab fa-fw fa-github' : 'fab fa-fw fa-npm' }}"></i> Plugin Homepage
<i class="{{ plugin.links.homepage.startsWith('https://github.com/') ? 'fab fa-fw fa-github' : 'fab fa-fw fa-npm' }}"></i> {{ 'plugins.button_homepage' | translate }}
</a>
</div>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
{{ 'menu.label_plugins' | translate }}
</a>
<br>
<span class="grey-text" *ngIf="homebridgePluginStatus.length">
<a routerLink="/plugins" class="primary-text" *ngIf="homebridgePluginStatus.length">
{{ homebridgePluginStatus.length }} {{ homebridgePluginStatus.length === 1 ? ('status.plugin_out_of_date' | translate) : ('status.plugins_out_of_date' | translate) }}
</span>
</a>
<span class="grey-text" *ngIf="!homebridgePluginStatus.length">
{{ 'status.homebridge.label_up_to_date' | translate }}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
<td>
<a href="https://homebridge.io/w/JTKEF" rel="noopener noreferrer" target="_blank" class="system-info-link"
ngbTooltip="{{ nodejsInfo.updateAvailable ? ('plugins.status_update_available' | translate) + ' - ' + nodejsInfo.latestVersion : ''}}">
<i *ngIf="nodejsInfo.showUpdateWarning" class="primary-text fas fa-fw fa-circle-up"></i> {{ serverInfo.nodeVersion }}
</a>
<i *ngIf="nodejsInfo.updateAvailable" class="primary-text fas fa-fw fa-circle-up"></i>
</a> {{ serverInfo.nodeVersion }}
</td>
</tr>
<tr>
Expand Down Expand Up @@ -87,10 +87,17 @@
</th>
<td class="text-nowrap" [translate]="'status.widget.systeminfo.label_yes'">Yes</td>
</tr>
<tr *ngIf="serverInfo.homebridgeServiceMode">
<tr>
<th scope="row" class="text-nowrap" [translate]="'status.widget.systeminfo.label_service_mode'">Service Mode
</th>
<td class="text-nowrap" [translate]="'status.widget.systeminfo.label_enabled'">Enabled</td>
<td class="text-nowrap" *ngIf="serverInfo.homebridgeServiceMode">
{{ 'status.widget.systeminfo.label_enabled' | translate }}
</td>
<td class="text-nowrap" *ngIf="!serverInfo.homebridgeServiceMode">
<a class="system-info-link" href="javascript:void(0)" (click)="serviceModeModal()">
<i class="primary-text fas fa-fw fa-exclamation-circle"></i>
</a> {{ 'status.widget.systeminfo.label_disabled' | translate }}
</td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { WsService } from '@/app/core/ws.service';
import { AuthService } from '@/app/core/auth/auth.service';
import { InformationComponent } from '@/app/core/components/information/information.component';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';

@Component({
selector: 'app-system-info-widget',
Expand All @@ -20,6 +21,7 @@ export class SystemInfoWidgetComponent implements OnInit {
private $ws: WsService,
public $auth: AuthService,
private $modal: NgbModal,
private $translate: TranslateService,
) { }

ngOnInit() {
Expand All @@ -41,14 +43,21 @@ export class SystemInfoWidgetComponent implements OnInit {
this.nodejsInfo = data;
});
}
//

glibcVersionModal() {
const ref = this.$modal.open(InformationComponent);
ref.componentInstance.title = 'OS Update';
ref.componentInstance.message = 'This message indicates that your operating system does not support newer versions of Node.js. ' +
'To resolve this and be able to install updated versions of Node.js in the future, ' +
'you will need to update your operating system to a more recent version.';
ref.componentInstance.ctaButtonLabel = 'More Info';
ref.componentInstance.title = this.$translate.instant('status.widget.systeminfo.modal_glibc_title');
ref.componentInstance.message = this.$translate.instant('status.widget.systeminfo.modal_glibc_message');
ref.componentInstance.ctaButtonLabel = this.$translate.instant('status.widget.systeminfo.modal_glibc_cta');
ref.componentInstance.ctaButtonLink = 'https://homebridge.io/w/JJSun';
}

serviceModeModal() {
const ref = this.$modal.open(InformationComponent);
ref.componentInstance.title = this.$translate.instant('status.widget.systeminfo.modal_servicemode_title');
ref.componentInstance.message = this.$translate.instant('status.widget.systeminfo.modal_servicemode_message');
ref.componentInstance.ctaButtonLabel = this.$translate.instant('status.widget.systeminfo.modal_servicemode_cta');
ref.componentInstance.ctaButtonLink
= 'https://github.com/homebridge/homebridge-config-ui-x/wiki/How-To-Swap-From-Standalone-Mode-to-Service-Mode';
}
}
8 changes: 8 additions & 0 deletions ui/src/app/shared/layout/layout.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@
font-size: 20px;
}

.navbar .dropdown-menu {
margin-top: 15px !important;
}

.dropdown-menu {
@media screen and (max-width: 600px) {
position: fixed !important;
top: 50px;
max-width: 70%
}
}

a:hover {
text-decoration: none !important;
}
Loading

0 comments on commit 44967c3

Please sign in to comment.