From 9ed17c1305c4f5de9095be47c5ee51248742845c Mon Sep 17 00:00:00 2001 From: Nero Ignis Date: Thu, 26 Nov 2020 12:08:46 +0100 Subject: [PATCH] Connect to Device on page-load --- ADBService.php | 1 + execute.php | 3 +-- index.html => index.php | 11 +++++++++++ remote.css | 5 +++++ 4 files changed, 18 insertions(+), 2 deletions(-) rename index.html => index.php (93%) diff --git a/ADBService.php b/ADBService.php index c1e9e4d..b9fb6fc 100644 --- a/ADBService.php +++ b/ADBService.php @@ -4,6 +4,7 @@ include_once 'ADBKeyCodes.php'; class ADBService { + const DEFAULT_HOST = '192.168.1.132'; private $host; public function __construct($host) diff --git a/execute.php b/execute.php index 7ddb5e0..fecaa88 100644 --- a/execute.php +++ b/execute.php @@ -3,9 +3,8 @@ $axiosRequest = json_decode(file_get_contents('php://input')); include_once 'ADBService.php'; -const HOST = '192.168.1.132'; -$service = new ADBService(HOST); +$service = new ADBService(ADBService::DEFAULT_HOST); $service->connect(); echo json_encode([$service->sendKey($axiosRequest->keyCode)]); diff --git a/index.html b/index.php similarity index 93% rename from index.html rename to index.php index 5b19e6e..025b371 100644 --- a/index.html +++ b/index.php @@ -1,3 +1,10 @@ + + @@ -37,6 +44,10 @@ + +
+ connect()) ?> +
diff --git a/remote.css b/remote.css index ae2d242..964f07b 100644 --- a/remote.css +++ b/remote.css @@ -6,3 +6,8 @@ .fa-1c5x { font-size: 1.5em; } + +.connected-info { + width: 100%; + margin-top: 2em; +} \ No newline at end of file