-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add UHL paired devices to the host connections
- Loading branch information
Showing
16 changed files
with
223 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
} | ||
} | ||
|
||
ble-pairing-panel, | ||
dongle-pairing-panel, | ||
firmware-upgrade-panel, | ||
app-update-available { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ages/uhk-web/src/app/components/device/ble-pairing-panel/ble-pairing-panel.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="ble-pairing-panel-wrapper" role="alert"> | ||
<span *ngIf="state.state === BlePairingStates.Idle"> | ||
<ng-container *ngIf="state.nrOfNewBleAddresses === 1"> | ||
A new Bluetooth device has been paired to this UHK. Let's <a routerLink="/device/host-connections" (click)="addNewPairedDevices.emit()">add it to connections</a> so that you can switch to it. | ||
</ng-container> | ||
|
||
<ng-container *ngIf="state.nrOfNewBleAddresses > 1"> | ||
New Bluetooth devices have been paired to this UHK. Let's <a routerLink="/device/host-connections" (click)="addNewPairedDevices.emit()">add them to connections</a> so that you can switch to them. | ||
</ng-container> | ||
</span> | ||
|
||
<span *ngIf="state.state === BlePairingStates.Adding || state.state === BlePairingStates.SavingToKeyboard"> | ||
Bluetooth device(s) adding... <fa-icon [icon]="faSpinner" animation="spin"></fa-icon> | ||
</span> | ||
|
||
<span *ngIf="state.state === BlePairingStates.AddingSuccess"> | ||
Bluetooth device(s) added. | ||
</span> | ||
|
||
<span *ngIf="state.state === BlePairingStates.TooMuchHostConnections"> | ||
Can't save the configuration because there are too many connections. You must delete {{ state.nrOfHostConnections - hostConnectionsMaxCount }} connections. | ||
</span> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
...ages/uhk-web/src/app/components/device/ble-pairing-panel/ble-pairing-panel.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@import '../../../../styles/variables'; | ||
|
||
.ble-pairing-panel-wrapper { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: $main-content-top-margin-on-update; | ||
margin: 0; | ||
padding-top: 5px; | ||
padding-bottom: 5px; | ||
|
||
background-color: var(--color-firmware-upgrade-panel-bg); | ||
color: var(--color-firmware-upgrade-panel-text); | ||
border-radius: 0; | ||
border-width: 0; | ||
|
||
a { | ||
color: var(--color-firmware-upgrade-panel-text); | ||
text-decoration: underline; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/uhk-web/src/app/components/device/ble-pairing-panel/ble-pairing-panel.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { faSpinner } from '@fortawesome/free-solid-svg-icons'; | ||
import { HOST_CONNECTION_COUNT_MAX } from 'uhk-common'; | ||
|
||
import { BleAddingState, BleAddingStates } from '../../../models'; | ||
|
||
@Component({ | ||
selector: 'ble-pairing-panel', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
templateUrl: './ble-pairing-panel.component.html', | ||
styleUrls: ['./ble-pairing-panel.component.scss'] | ||
}) | ||
export class BlePairingPanelComponent { | ||
@Input() state: BleAddingState; | ||
|
||
@Output() addNewPairedDevices = new EventEmitter<void>(); | ||
|
||
protected readonly BlePairingStates = BleAddingStates; | ||
protected readonly faSpinner = faSpinner; | ||
protected readonly hostConnectionsMaxCount = HOST_CONNECTION_COUNT_MAX; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export enum BleAddingStates { | ||
Idle = 'Idle', | ||
Adding = 'Adding', | ||
AddingSuccess = 'AddingSuccess', | ||
SavingToKeyboard = 'SavingToKeyboard', | ||
TooMuchHostConnections = 'TooMuchHostConnections', | ||
} | ||
|
||
export interface BleAddingState { | ||
showNewPairedDevicesPanel: boolean; | ||
nrOfNewBleAddresses: number; | ||
nrOfHostConnections: number; | ||
state: BleAddingStates; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.