wip livewire migration

This commit is contained in:
Andras Bacsai
2023-12-07 22:56:55 +01:00
parent 718603e37e
commit f934dfef33
64 changed files with 164 additions and 155 deletions

View File

@@ -19,7 +19,7 @@ class Delete extends Component
return;
}
$this->server->delete();
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
} catch (\Throwable $e) {
return handleError($e, $this);
}

View File

@@ -13,9 +13,9 @@ class Show extends Component
{
$this->parameters = get_route_parameters();
try {
$this->server = Server::ownedByCurrentTeam(['name', 'proxy'])->whereUuid(request()->server_uuid)->first();
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
}
} catch (\Throwable $e) {
return handleError($e, $this);

View File

@@ -44,7 +44,9 @@ class Form extends Component
{
$this->wildcard_domain = $this->server->settings->wildcard_domain;
$this->cleanup_after_percentage = $this->server->settings->cleanup_after_percentage;
$this->validateServer();
if (!$this->server->isFunctional()) {
$this->validateServer();
}
}
public function serverRefresh($install = true)
{

View File

@@ -41,9 +41,9 @@ class LogDrains extends Component
{
$this->parameters = get_route_parameters();
try {
$server = Server::ownedByCurrentTeam(['name', 'description', 'ip', 'port', 'user', 'proxy'])->whereUuid(request()->server_uuid)->first();
$server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($server)) {
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
}
$this->server = $server;
} catch (\Throwable $e) {

View File

@@ -79,7 +79,7 @@ class ByIp extends Component
$server->settings->is_swarm_manager = $this->is_swarm_manager;
$server->settings->save();
$server->addInitialNetwork();
return redirect()->route('server.show', $server->uuid);
return $this->redirectRoute('server.show', $server->uuid, navigate: true);
} catch (\Throwable $e) {
return handleError($e, $this);
}

View File

@@ -17,7 +17,7 @@ class Show extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
}
$this->privateKeys = PrivateKey::ownedByCurrentTeam()->get()->where('is_git_related', false);
} catch (\Throwable $e) {

View File

@@ -13,9 +13,9 @@ class Logs extends Component
{
$this->parameters = get_route_parameters();
try {
$this->server = Server::ownedByCurrentTeam(['name', 'proxy'])->whereUuid(request()->server_uuid)->first();
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
}
} catch (\Throwable $e) {
return handleError($e, $this);

View File

@@ -18,9 +18,9 @@ class Show extends Component
{
$this->parameters = get_route_parameters();
try {
$this->server = Server::ownedByCurrentTeam(['name', 'proxy'])->whereUuid(request()->server_uuid)->first();
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
}
} catch (\Throwable $e) {
return handleError($e, $this);

View File

@@ -15,9 +15,9 @@ class Show extends Component
{
$this->parameters = get_route_parameters();
try {
$this->server = Server::ownedByCurrentTeam(['name', 'description', 'ip', 'port', 'user', 'proxy'])->whereUuid(request()->server_uuid)->first();
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
return redirect()->route('server.all');
return $this->redirectRoute('server.all', navigate: true);
}
} catch (\Throwable $e) {