From d6fd9d1cdad868a06760eee09bb344cd4a0c2188 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 12 May 2017 09:25:38 +0200 Subject: [PATCH] REL-0.9 Fix DNS vHost check --- .devilbox/www/htdocs/vhosts.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.devilbox/www/htdocs/vhosts.php b/.devilbox/www/htdocs/vhosts.php index 3c1c866e..4b34d06d 100644 --- a/.devilbox/www/htdocs/vhosts.php +++ b/.devilbox/www/htdocs/vhosts.php @@ -49,8 +49,9 @@

No projects here.

-

Simply create a folder in getEnv('HOST_PATH_HTTPD_DATADIR');?> (on your host computer - not inside the docker).

+

Simply create a directory in getEnv('HOST_PATH_HTTPD_DATADIR');?> on your host computer (or in /shared/httpd inside the php container).

Example:
getEnv('HOST_PATH_HTTPD_DATADIR');?>/my_project

+

It will then be available via http://my_project.getTldSuffix();?>

@@ -98,7 +99,7 @@ function checkDns(vhost) { var xhttp = new XMLHttpRequest(); // Timeout after 1 seconds and mark it invalid DNS - xhttp.timeout = getEnv('DNS_CHECK_TIMEOUT');?>000; + xhttp.timeout = getEnv('DNS_CHECK_TIMEOUT');?> * 100; var el_valid = document.getElementById('valid-' + vhost); var el_href = document.getElementById('href-' + vhost); @@ -106,7 +107,7 @@ xhttp.onreadystatechange = function(e) { if (this.readyState == 4 && this.status == 200) { - //clearTimeout(xmlHttpTimeout); + clearTimeout(xmlHttpTimeout); el_valid.className += ' bg-success'; el_valid.innerHTML = 'OK'; el_href.innerHTML = ''+vhost+'.getTldSuffix().$Docker->getPort();?>'; @@ -125,10 +126,10 @@ xhttp.open('GET', 'http://'+vhost+'.getTldSuffix();?>', true); xhttp.send(); // Timeout to abort in 1 second - //var xmlHttpTimeout=setTimeout(ajaxTimeout,20000); - //function ajaxTimeout(){ - // xhttp.abort(); - //} + var xmlHttpTimeout=setTimeout(ajaxTimeout, getEnv('DNS_CHECK_TIMEOUT');?>100); + function ajaxTimeout(){ + xhttp.ontimeout(); + } }