diff --git a/app/Client/Client.php b/app/Client/Client.php index 8eaaa47..0ce9b23 100644 --- a/app/Client/Client.php +++ b/app/Client/Client.php @@ -31,6 +31,7 @@ class Client /** @var int */ protected $timeConnected = 0; + public static $user = []; public static $subdomains = []; public function __construct(LoopInterface $loop, Configuration $configuration, CliRequestLogger $logger) @@ -119,6 +120,7 @@ class Client $this->logger->line(''); static::$subdomains[] = "{$httpProtocol}://{$data->subdomain}.{$host}"; + static::$user = $data->user; $deferred->resolve($data); }); diff --git a/app/Client/Http/Controllers/DashboardController.php b/app/Client/Http/Controllers/DashboardController.php index 1294323..cfe3982 100644 --- a/app/Client/Http/Controllers/DashboardController.php +++ b/app/Client/Http/Controllers/DashboardController.php @@ -12,6 +12,7 @@ class DashboardController extends Controller public function handle(Request $request, ConnectionInterface $httpConnection) { $httpConnection->send(respond_html($this->getView($httpConnection, 'client.dashboard', [ + 'user' => Client::$user, 'subdomains' => Client::$subdomains, 'max_logs'=> config()->get('expose.max_logged_requests', 10), ]))); diff --git a/app/Server/Http/Controllers/ControlMessageController.php b/app/Server/Http/Controllers/ControlMessageController.php index 8f426b6..4d33a58 100644 --- a/app/Server/Http/Controllers/ControlMessageController.php +++ b/app/Server/Http/Controllers/ControlMessageController.php @@ -173,6 +173,7 @@ class ControlMessageController implements MessageComponentInterface 'message' => config('expose.admin.messages.resolve_connection_message')($connectionInfo, $user), 'subdomain' => $connectionInfo->subdomain, 'server_host' => $connectionInfo->serverHost, + 'user' => $user, 'client_id' => $connectionInfo->client_id, ], ])); @@ -202,7 +203,8 @@ class ControlMessageController implements MessageComponentInterface $connection->send(json_encode([ 'event' => 'authenticated', 'data' => [ - 'message' => config('expose.admin.messages.message_of_the_day'), + 'message' => config('expose.admin.messages.resolve_connection_message')($connectionInfo, $user), + 'user' => $user, 'port' => $connectionInfo->port, 'shared_port' => $connectionInfo->shared_port, 'client_id' => $connectionInfo->client_id, diff --git a/resources/views/client/dashboard.twig b/resources/views/client/dashboard.twig index b2a3ac6..b8a955e 100644 --- a/resources/views/client/dashboard.twig +++ b/resources/views/client/dashboard.twig @@ -2,7 +2,7 @@ Expose Dashboard :: {{ subdomains|join(", ") }} - +