Add ability to navigate to web server running on device.

feature/add-device-navigation
Chris Veilleux 2022-07-20 14:15:13 -05:00
parent a41b8e2e93
commit d1f19d2b05
2 changed files with 9 additions and 1 deletions

View File

@ -43,7 +43,10 @@
</ng-container>
<account-device-info [device]="device"></account-device-info>
<mat-card-actions>
<button mat-flat-button color="primary" [routerLink]="['./', device.id]">
<button *ngIf="device.platform === 'mycroft_mark_2'" mat-flat-button color="primary" (click)="goToExternal()">
EDIT
</button>
<button *ngIf="device.platform != 'mycroft_mark_2'" mat-flat-button color="primary" [routerLink]="['./', device.id]">
EDIT
</button>
<button mat-flat-button color="warn" (click)="onRemove(device, i)">

View File

@ -97,4 +97,9 @@ export class DeviceListComponent implements OnInit {
const knownPlatform = this.platforms[device.platform];
return knownPlatform ? knownPlatform.icon : '../assets/generic-device-icon-blue.svg';
}
goToExternal() {
const url = 'http://192.168.4.103:8080';
window.open(url, '_blank');
}
}