format muhahaha

This commit is contained in:
Andras Bacsai
2023-08-11 20:48:52 +02:00
parent c762195c8a
commit 82a01b4483
109 changed files with 295 additions and 244 deletions

View File

@@ -8,8 +8,8 @@ function format_docker_command_output_to_json($rawOutput): Collection
$outputLines = explode(PHP_EOL, $rawOutput);
return collect($outputLines)
->reject(fn($line) => empty($line))
->map(fn($outputLine) => json_decode($outputLine, true, flags: JSON_THROW_ON_ERROR));
->reject(fn ($line) => empty($line))
->map(fn ($outputLine) => json_decode($outputLine, true, flags: JSON_THROW_ON_ERROR));
}
function format_docker_labels_to_json($rawOutput): Collection
@@ -17,7 +17,7 @@ function format_docker_labels_to_json($rawOutput): Collection
$outputLines = explode(PHP_EOL, $rawOutput);
return collect($outputLines)
->reject(fn($line) => empty($line))
->reject(fn ($line) => empty($line))
->map(function ($outputLine) {
$outputArray = explode(',', $outputLine);
return collect($outputArray)

View File

@@ -104,52 +104,52 @@ function setup_default_redirect_404(string|null $redirect_url, Server $server)
} else {
$traefik_dynamic_conf = [
'http' =>
[
'routers' =>
[
'routers' =>
[
'catchall' =>
[
'entryPoints' => [
0 => 'http',
1 => 'https',
],
'service' => 'noop',
'rule' => "HostRegexp(`{catchall:.*}`)",
'priority' => 1,
'middlewares' => [
0 => 'redirect-regexp@file',
],
],
'catchall' =>
[
'entryPoints' => [
0 => 'http',
1 => 'https',
],
'services' =>
[
'noop' =>
[
'loadBalancer' =>
[
'servers' =>
[
0 =>
[
'url' => '',
],
],
],
],
],
'middlewares' =>
[
'redirect-regexp' =>
[
'redirectRegex' =>
[
'regex' => '(.*)',
'replacement' => $redirect_url,
'permanent' => false,
],
],
'service' => 'noop',
'rule' => "HostRegexp(`{catchall:.*}`)",
'priority' => 1,
'middlewares' => [
0 => 'redirect-regexp@file',
],
],
],
'services' =>
[
'noop' =>
[
'loadBalancer' =>
[
'servers' =>
[
0 =>
[
'url' => '',
],
],
],
],
],
'middlewares' =>
[
'redirect-regexp' =>
[
'redirectRegex' =>
[
'regex' => '(.*)',
'replacement' => $redirect_url,
'permanent' => false,
],
],
],
],
];
$yaml = Yaml::dump($traefik_dynamic_conf, 12, 2);
$yaml =

View File

@@ -27,8 +27,7 @@ function remote_process(
?string $type_uuid = null,
?Model $model = null,
bool $ignore_errors = false,
): Activity
{
): Activity {
$command_string = implode("\n", $command);
if (auth()->user()) {
@@ -141,10 +140,10 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
}
$formatted = collect($decoded);
if (!$is_debug_enabled) {
$formatted = $formatted->filter(fn($i) => $i['hidden'] === false ?? false);
$formatted = $formatted->filter(fn ($i) => $i['hidden'] === false ?? false);
}
$formatted = $formatted
->sortBy(fn($i) => $i['order'])
->sortBy(fn ($i) => $i['order'])
->map(function ($i) {
$i['timestamp'] = Carbon::parse($i['timestamp'])->format('Y-M-d H:i:s.u');
return $i;

View File

@@ -178,5 +178,3 @@ function validate_cron_expression($expression_to_validate): bool
}
return $isValid;
}