Permalink
Browse files

Merge pull request #14 from LKaemmerling/master

Add optional server variable
  • Loading branch information...
mpociot committed Dec 5, 2018
2 parents 76e091d + 5245ba8 commit f03acd10a489b1f3ef3d0863c35e43c8c2dd1139
Showing with 15 additions and 1 deletion.
  1. +1 −1 resources/views/dashboard.blade.php
  2. +10 −0 src/Apps/App.php
  3. +4 −0 src/Apps/ConfigAppProvider.php
@@ -113,7 +113,7 @@
methods: {
connect() {
this.pusher = new Pusher(this.app.key, {
wsHost: window.location.hostname,
wsHost: this.app.host === null ? window.location.hostname : this.app.host,
wsPort: this.port,
wssPort: this.port,
disableStats: true,
@@ -18,6 +18,9 @@ class App
/** @var string|null */
public $name;
/** @var string|null */
public $host;
/** @var bool */
public $clientMessagesEnabled = false;
@@ -63,6 +66,13 @@ public function setName(string $appName)
return $this;
}
public function setHost(string $host)
{
$this->host = $host;
return $this;
}
public function enableClientMessages(bool $enabled = true)
{
$this->clientMessagesEnabled = $enabled;
@@ -67,6 +67,10 @@ protected function instanciate(?array $appAttributes): ?App
$app->setName($appAttributes['name']);
}
if (isset($appAttributes['host'])) {
$app->setHost($appAttributes['host']);
}
$app
->enableClientMessages($appAttributes['enable_client_messages'])
->enableStatistics($appAttributes['enable_statistics']);

0 comments on commit f03acd1

Please sign in to comment.