import { Component } from '@angular/core' ; import { ApiService } from '../api.service' ; import { ToastService } from '../toast.service' ; import { Router } from '@angular/router' ; @ Component ( { selector : 'app-home' , templateUrl : 'home.page.html' , styleUrls : [ 'home.page.scss' ] , } ) export class HomePage { public whidIP = '' ; public command = '' ; public selectedPlatform = 'Windows' ; constructor ( public api , public toast , public router ) { this . whidIP = api . getWHIDIP ( ) ; } async sendCommand ( command ) { this . api . runLivePayload ( command ) ; } async sendText ( ) { var newCommand = "Print:" + this . command ; this . sendCommand ( newCommand ) ; } async sendTextAndEnter ( ) { var newCommand = "PrintLine:" + this . command ; this . sendCommand ( newCommand ) ; } async redirect ( url ) { this . router . navigateByUrl ( url ) ; } }