This commit is contained in:
Marcel Pociot
2020-04-28 23:52:59 +02:00
parent 873207a655
commit c2084e6be6
4 changed files with 13 additions and 10 deletions

View File

@@ -101,12 +101,6 @@ class HttpClient
$response->buffer .= $chunk; $response->buffer .= $chunk;
$this->sendChunkToServer($chunk, $proxyConnection); $this->sendChunkToServer($chunk, $proxyConnection);
if ($chunk === "") {
$this->logResponse($response->buffer);
optional($proxyConnection)->close();
}
}); });
$body->on('close', function () use ($proxyConnection, $response) { $body->on('close', function () use ($proxyConnection, $response) {

View File

@@ -32,6 +32,7 @@ class CliRequestLogger extends Logger
public function logRequest(LoggedRequest $loggedRequest) public function logRequest(LoggedRequest $loggedRequest)
{ {
return;
if ($this->requests->has($loggedRequest->id())) { if ($this->requests->has($loggedRequest->id())) {
$this->requests[$loggedRequest->id()] = $loggedRequest; $this->requests[$loggedRequest->id()] = $loggedRequest;
} else { } else {

View File

@@ -4,6 +4,7 @@ namespace App\Server\Http\Controllers\Admin;
use App\Contracts\ConnectionManager; use App\Contracts\ConnectionManager;
use App\HttpServer\Controllers\PostController; use App\HttpServer\Controllers\PostController;
use App\Server\Configuration;
use Clue\React\SQLite\DatabaseInterface; use Clue\React\SQLite\DatabaseInterface;
use Clue\React\SQLite\Result; use Clue\React\SQLite\Result;
use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7\Response;
@@ -18,16 +19,23 @@ class ListSitesController extends PostController
{ {
/** @var ConnectionManager */ /** @var ConnectionManager */
protected $connectionManager; protected $connectionManager;
/** @var Configuration */
protected $configuration;
public function __construct(ConnectionManager $connectionManager) public function __construct(ConnectionManager $connectionManager, Configuration $configuration)
{ {
$this->connectionManager = $connectionManager; $this->connectionManager = $connectionManager;
$this->configuration = $configuration;
} }
public function handle(Request $request, ConnectionInterface $httpConnection) public function handle(Request $request, ConnectionInterface $httpConnection)
{ {
try { try {
$sites = $this->getView('server.sites.index', ['sites' => $this->connectionManager->getConnections()]); $sites = $this->getView('server.sites.index', [
'scheme' => $this->configuration->port() === 443 ? 'https' : 'http',
'configuration' => $this->configuration,
'sites' => $this->connectionManager->getConnections()
]);
} catch (\Exception $e) { } catch (\Exception $e) {
dump($e->getMessage()); dump($e->getMessage());
} }

View File

@@ -27,13 +27,13 @@
{{ site.host }} {{ site.host }}
</td> </td>
<td class="px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5 text-gray-500"> <td class="px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5 text-gray-500">
{{ site.subdomain }}.localhost:8080 {{ site.subdomain }}.{{ configuration.hostname()}}:{{ configuration.port() }}
</td> </td>
<td class="px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5 text-gray-500"> <td class="px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-sm leading-5 text-gray-500">
{{ site.shared_at }} {{ site.shared_at }}
</td> </td>
<td class="px-6 py-4 whitespace-no-wrap text-right border-b border-gray-200 text-sm leading-5 font-medium"> <td class="px-6 py-4 whitespace-no-wrap text-right border-b border-gray-200 text-sm leading-5 font-medium">
<a href="http://{{ site.subdomain }}.localhost:8080" target="_blank" <a href="{{ scheme }}://{{ site.subdomain }}.{{ configuration.hostname()}}:{{ configuration.port() }}" target="_blank"
class="text-indigo-600 hover:text-indigo-900">Visit</a> class="text-indigo-600 hover:text-indigo-900">Visit</a>
</td> </td>
</tr> </tr>