Skip to content

Commit

Permalink
bridge settings modal
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Nov 14, 2023
1 parent cdea755 commit f23bc0e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 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 @@ -56,7 +56,7 @@
"@fastify/multipart": "8.0.0",
"@fastify/static": "6.12.0",
"@fastify/swagger": "8.12.0",
"@homebridge/node-pty-prebuilt-multiarch": "^0.11.11",
"@homebridge/node-pty-prebuilt-multiarch": "0.11.11",
"@nestjs/axios": "3.0.1",
"@nestjs/common": "10.2.8",
"@nestjs/core": "10.2.8",
Expand All @@ -72,7 +72,7 @@
"class-validator": "0.14.0",
"commander": "11.1.0",
"dayjs": "1.11.10",
"emoji-js": "^3.8.0",
"emoji-js": "3.8.0",
"fastify": "4.24.3",
"fs-extra": "11.1.1",
"node-cache": "5.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ <h5 class="modal-title">
</button>
</div>
<div class="modal-body">

<p>
{{ 'child_bridge.message_about' | translate }}
<a href="https://github.com/homebridge/homebridge/wiki/Child-Bridges" target="_blank" rel="noopener noreferrer" class="primary-text">
{{ 'child_bridge.message_wiki_link' | translate }}
<i class='fas fa-fw fa-external-link-alt'></i>
</a>
</p>

<div *ngIf="configBlocks.length">
Expand Down Expand Up @@ -100,29 +103,26 @@ <h5 class="primary-text">
</div>
</div>

<p>
<a href="https://github.com/homebridge/homebridge/wiki/Child-Bridges" target="_blank" rel="noopener noreferrer"
class="primary-text">
{{ 'child_bridge.message_wiki_link' | translate }}
<i class='fas fa-fw fa-external-link-alt'></i>
</a>
</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.close('Dismiss')">
<button type="button" class="btn btn-elegant" data-dismiss="modal" (click)="activeModal.close('Dismiss')" *ngIf="configBlocks.length">
{{ 'form.button_close' | translate }}
</button>
</div>
<div class="d-none d-lg-block text-center">
<div class="d-none d-lg-block text-center" *ngIf="configBlocks.length">
<a *ngIf="plugin.links.npm" [href]="plugin.links.npm" target="_blank" rel="noopener noreferrer"
class="pr-3 manage-plugin-config-external-icons dark-mode-highlight"><i class="fab fa-fw fa-npm"></i></a>
<a *ngIf="plugin.links.homepage" [href]="plugin.links.homepage" target="_blank" rel="noopener noreferrer"
class="manage-plugin-config-external-icons dark-mode-highlight">
<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-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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h4 class="card-title mb-0">
placement="top" ngbTooltip="{{'plugins.status_update_available' | translate:plugin }}" container="body" [openDelay]="150">
<i class="fas fa-fw fa-arrow-alt-circle-up primary-text"></i>
</a>
<a href="javascript:void(0);" class="card-link ml-3" *ngIf="!hasChildBridges && !plugin.disabled && recommendChildBridge && childBridgesLoaded"
<a href="javascript:void(0);" class="card-link ml-3" *ngIf="!hasChildBridges && !plugin.disabled && recommendChildBridge"
ngbTooltip="{{'child_bridge.label_bridge_setup_child_bridges' | translate}}" placement="top" container="body"
[openDelay]="150" (click)="$plugin.bridgeSettings(plugin)">
<i class="fa-fw icon-button fas fa-fw fa-circle-exclamation primary-text"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { DonateModalComponent } from '@/app/modules/plugins/donate-modal/donate-
})
export class PluginCardComponent implements OnInit {
@Input() plugin: any;
@Input() childBridgesLoaded: boolean;

private io = this.$ws.getExistingNamespace('child-bridges');

Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/modules/plugins/plugins.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

<div class="d-flex flex-wrap justify-content-between">
<div class="hb-plugin-space-between" *ngFor="let plugin of installedPlugins">
<app-plugin-card [plugin]="plugin" [childBridges]="getPluginChildBridges(plugin)" [childBridgesLoaded]="childBridgesLoaded"></app-plugin-card>
<app-plugin-card [plugin]="plugin" [childBridges]="getPluginChildBridges(plugin)"></app-plugin-card>
</div>
</div>
2 changes: 0 additions & 2 deletions ui/src/app/modules/plugins/plugins.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class PluginsComponent implements OnInit, OnDestroy {

public installedPlugins: any = [];
public childBridges = [];
public childBridgesLoaded = false;

public form = new FormGroup({
query: new FormControl('', [Validators.required]),
Expand Down Expand Up @@ -110,7 +109,6 @@ export class PluginsComponent implements OnInit, OnDestroy {
getChildBridgeMetadata() {
this.io.request('get-homebridge-child-bridge-status').subscribe((data) => {
this.childBridges = data;
this.childBridgesLoaded = true;
});
}

Expand Down

0 comments on commit f23bc0e

Please sign in to comment.