Dashboard UI updates, allow multiple expose servers, exclude subdomains

This commit is contained in:
Marcel Pociot
2021-05-19 20:21:19 +02:00
parent c1f7125f72
commit db57f83bdf
8 changed files with 150 additions and 99 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Commands;
use App\Logger\CliRequestLogger;
use Illuminate\Console\Parser;
use LaravelZero\Framework\Commands\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\ConsoleOutput;
abstract class ServerAwareCommand extends Command
{
public function __construct()
{
parent::__construct();
$inheritedSignature = '{--server=default} {--server-host=} {--server-port=}';
$this->getDefinition()->addOptions(Parser::parse($inheritedSignature)[2]);
$this->configureConnectionLogger();
}
protected function configureConnectionLogger()
{
app()->bind(CliRequestLogger::class, function () {
return new CliRequestLogger(new ConsoleOutput());
});
return $this;
}
protected function getServerHost()
{
return $this->option('server-host') ?? config('expose.servers.'.$this->option('server').'.host', 'localhost');
}
protected function getServerPort()
{
return $this->option('server-port') ?? config('expose.servers.'.$this->option('server').'.port', 8080);
}
}