From af9cbc0dd92f8b2330f2f50a62b6032b02980223 Mon Sep 17 00:00:00 2001 From: sstidl Date: Sun, 29 Dec 2024 18:08:52 +0000 Subject: [PATCH] repair own url detection, switched to js --- docker/ui.php | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/docker/ui.php b/docker/ui.php index 0f68f2c69..4f2d6972d 100755 --- a/docker/ui.php +++ b/docker/ui.php @@ -13,38 +13,22 @@ function I(i){return document.getElementById(i);} $mode=getenv("MODE"); if($mode=="standalone" || $mode=="backend"){ ?> var SPEEDTEST_SERVERS=[]; - "This Server", - "server"=> $url."backend/", - "id"=> 1, - "dlURL"=> "garbage.php", - "ulURL"=> "empty.php", - "pingURL"=> "empty.php", - "getIpURL"=> "getIP.php" - ] - ); - ?> -var SPEEDTEST_SERVERS= ; var SPEEDTEST_SERVERS= ; + +// add own server in dual mode +SPEEDTEST_SERVERS.unshift({ + "name":"This Server", + "server":document.location.href+"backend/", + "id":1, + "dlURL":"garbage.php", + "ulURL":"empty.php", + "pingURL":"empty.php", + "getIpURL":"getIP.php", + "pingT":-1 +}) - //INITIALIZE SPEED TEST var s=new Speedtest(); //create speed test object