formatting
This commit is contained in:
@@ -55,10 +55,13 @@ class ScheduledTaskJob implements ShouldQueue
|
|||||||
private function getServerTimezone(): string
|
private function getServerTimezone(): string
|
||||||
{
|
{
|
||||||
if ($this->resource instanceof Application) {
|
if ($this->resource instanceof Application) {
|
||||||
return $this->resource->destination->server->settings->server_timezone;
|
$timezone = $this->resource->destination->server->settings->server_timezone;
|
||||||
|
return $timezone;
|
||||||
} elseif ($this->resource instanceof Service) {
|
} elseif ($this->resource instanceof Service) {
|
||||||
return $this->resource->server->settings->server_timezone;
|
$timezone = $this->resource->server->settings->server_timezone;
|
||||||
|
return $timezone;
|
||||||
}
|
}
|
||||||
|
return 'UTC';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function middleware(): array
|
public function middleware(): array
|
||||||
@@ -91,12 +94,12 @@ class ScheduledTaskJob implements ShouldQueue
|
|||||||
} elseif ($this->resource->type() == 'service') {
|
} elseif ($this->resource->type() == 'service') {
|
||||||
$this->resource->applications()->get()->each(function ($application) {
|
$this->resource->applications()->get()->each(function ($application) {
|
||||||
if (str(data_get($application, 'status'))->contains('running')) {
|
if (str(data_get($application, 'status'))->contains('running')) {
|
||||||
$this->containers[] = data_get($application, 'name').'-'.data_get($this->resource, 'uuid');
|
$this->containers[] = data_get($application, 'name') . '-' . data_get($this->resource, 'uuid');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$this->resource->databases()->get()->each(function ($database) {
|
$this->resource->databases()->get()->each(function ($database) {
|
||||||
if (str(data_get($database, 'status'))->contains('running')) {
|
if (str(data_get($database, 'status'))->contains('running')) {
|
||||||
$this->containers[] = data_get($database, 'name').'-'.data_get($this->resource, 'uuid');
|
$this->containers[] = data_get($database, 'name') . '-' . data_get($this->resource, 'uuid');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -109,8 +112,8 @@ class ScheduledTaskJob implements ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->containers as $containerName) {
|
foreach ($this->containers as $containerName) {
|
||||||
if (count($this->containers) == 1 || str_starts_with($containerName, $this->task->container.'-'.$this->resource->uuid)) {
|
if (count($this->containers) == 1 || str_starts_with($containerName, $this->task->container . '-' . $this->resource->uuid)) {
|
||||||
$cmd = "sh -c '".str_replace("'", "'\''", $this->task->command)."'";
|
$cmd = "sh -c '" . str_replace("'", "'\''", $this->task->command) . "'";
|
||||||
$exec = "docker exec {$containerName} {$cmd}";
|
$exec = "docker exec {$containerName} {$cmd}";
|
||||||
$this->task_output = instant_remote_process([$exec], $this->server, true);
|
$this->task_output = instant_remote_process([$exec], $this->server, true);
|
||||||
$this->task_log->update([
|
$this->task_log->update([
|
||||||
@@ -135,7 +138,6 @@ class ScheduledTaskJob implements ShouldQueue
|
|||||||
// send_internal_notification('ScheduledTaskJob failed with: ' . $e->getMessage());
|
// send_internal_notification('ScheduledTaskJob failed with: ' . $e->getMessage());
|
||||||
throw $e;
|
throw $e;
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,8 @@ class ScheduledTask extends BaseModel
|
|||||||
$server = $this->application->server;
|
$server = $this->application->server;
|
||||||
ray('Returning server from application: '.$server);
|
ray('Returning server from application: '.$server);
|
||||||
return $server;
|
return $server;
|
||||||
} elseif ($this->database) {
|
}
|
||||||
|
elseif ($this->database) {
|
||||||
ray('Returning server from database');
|
ray('Returning server from database');
|
||||||
$server = $this->database->server;
|
$server = $this->database->server;
|
||||||
ray('Returning server from database: '.$server);
|
ray('Returning server from database: '.$server);
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
@forelse($executions as $execution)
|
@forelse($executions as $execution)
|
||||||
<form wire:key="{{ data_get($execution, 'id') }}"
|
<form wire:key="{{ data_get($execution, 'id') }}"
|
||||||
class="relative flex flex-col p-4 bg-white box-without-bg dark:bg-coolgray-100"
|
class="relative flex flex-col p-4 bg-white box-without-bg dark:bg-coolgray-100"
|
||||||
@class([
|
@class([ 'border-green-500'=> data_get($execution, 'status') === 'success',
|
||||||
'border-green-500' => data_get($execution, 'status') === 'success',
|
|
||||||
'border-red-500' => data_get($execution, 'status') === 'failed',
|
'border-red-500' => data_get($execution, 'status') === 'failed',
|
||||||
])>
|
])>
|
||||||
@if (data_get($execution, 'status') === 'running')
|
@if (data_get($execution, 'status') === 'running')
|
||||||
|
|||||||
Reference in New Issue
Block a user