Refactor Livewire server show view to remove redundant code
This commit is contained in:
parent
0a3b5cc4e3
commit
77a019405a
1 changed files with 5 additions and 8 deletions
|
|
@ -187,29 +187,26 @@ public function restartSentinel()
|
|||
|
||||
public function updatedIsSentinelDebugEnabled($value)
|
||||
{
|
||||
$this->server->settings->is_sentinel_debug_enabled = $value;
|
||||
$this->server->settings->save();
|
||||
$this->submit();
|
||||
$this->restartSentinel();
|
||||
}
|
||||
|
||||
public function updatedIsMetricsEnabled($value)
|
||||
{
|
||||
$this->server->settings->is_metrics_enabled = $value;
|
||||
$this->server->settings->save();
|
||||
$this->submit();
|
||||
$this->restartSentinel();
|
||||
}
|
||||
|
||||
public function updatedIsSentinelEnabled($value)
|
||||
{
|
||||
$this->server->settings->is_sentinel_enabled = $value;
|
||||
if ($value === true) {
|
||||
StartSentinel::run($this->server, true);
|
||||
} else {
|
||||
$this->server->settings->is_metrics_enabled = false;
|
||||
$this->server->settings->is_sentinel_debug_enabled = false;
|
||||
$this->isMetricsEnabled = false;
|
||||
$this->isSentinelDebugEnabled = false;
|
||||
StopSentinel::dispatch($this->server);
|
||||
}
|
||||
$this->server->settings->save();
|
||||
$this->submit();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue