rector: arrrrr

This commit is contained in:
Andras Bacsai
2025-01-07 14:52:08 +01:00
parent c702ebff6d
commit 16c0cd10d8
349 changed files with 4204 additions and 3712 deletions

View File

@@ -7,6 +7,7 @@ use App\Actions\Server\StopLogDrain;
use App\Models\Server;
use Livewire\Attributes\Validate;
use Livewire\Component;
use Throwable;
class LogDrains extends Component
{
@@ -44,9 +45,11 @@ class LogDrains extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid($server_uuid)->firstOrFail();
$this->syncData();
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function syncDataNewRelic(bool $toModel = false)
@@ -104,18 +107,16 @@ class LogDrains extends Component
$this->syncDataCustom($toModel);
}
$this->server->settings->save();
} elseif ($type === 'newrelic') {
$this->syncDataNewRelic($toModel);
} elseif ($type === 'axiom') {
$this->syncDataAxiom($toModel);
} elseif ($type === 'custom') {
$this->syncDataCustom($toModel);
} else {
if ($type === 'newrelic') {
$this->syncDataNewRelic($toModel);
} elseif ($type === 'axiom') {
$this->syncDataAxiom($toModel);
} elseif ($type === 'custom') {
$this->syncDataCustom($toModel);
} else {
$this->syncDataNewRelic($toModel);
$this->syncDataAxiom($toModel);
$this->syncDataCustom($toModel);
}
$this->syncDataNewRelic($toModel);
$this->syncDataAxiom($toModel);
$this->syncDataCustom($toModel);
}
}
@@ -127,7 +128,7 @@ class LogDrains extends Component
'logDrainNewRelicLicenseKey' => ['required'],
'logDrainNewRelicBaseUri' => ['required', 'url'],
]);
} catch (\Throwable $e) {
} catch (Throwable $e) {
$this->isLogDrainNewRelicEnabled = false;
throw $e;
@@ -138,7 +139,7 @@ class LogDrains extends Component
'logDrainAxiomDatasetName' => ['required'],
'logDrainAxiomApiKey' => ['required'],
]);
} catch (\Throwable $e) {
} catch (Throwable $e) {
$this->isLogDrainAxiomEnabled = false;
throw $e;
@@ -149,7 +150,7 @@ class LogDrains extends Component
'logDrainCustomConfig' => ['required'],
'logDrainCustomConfigParser' => ['string', 'nullable'],
]);
} catch (\Throwable $e) {
} catch (Throwable $e) {
$this->isLogDrainCustomEnabled = false;
throw $e;
@@ -168,9 +169,11 @@ class LogDrains extends Component
StopLogDrain::run($this->server);
$this->dispatch('success', 'Log drain service stopped.');
}
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function submit(string $type)
@@ -178,9 +181,11 @@ class LogDrains extends Component
try {
$this->syncData(true, $type);
$this->dispatch('success', 'Settings saved.');
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function render()