mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-17 04:15:02 +00:00
Merge remote-tracking branch 'origin/next' into v5-parallel-inertia-react
This commit is contained in:
commit
ee36124300
82 files changed
+8190
-463
No files matched your search
@@ -4,6 +4,8 @@ namespace App\Services\DeploymentConfiguration;
|
||||
|
||||
use App\Models\Application;
|
||||
use App\Models\EnvironmentVariable;
|
||||
use App\Models\LocalFileVolume;
|
||||
use App\Models\LocalPersistentVolume;
|
||||
use App\Services\DeploymentConfiguration\Concerns\SummarizesDiffText;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
@@ -47,6 +49,10 @@ class ApplicationConfigurationSnapshot
|
||||
'label' => 'Environment Variables',
|
||||
'items' => $this->environmentItems(),
|
||||
],
|
||||
'storage' => [
|
||||
'label' => 'Storage',
|
||||
'items' => $this->storageItems(),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -214,6 +220,40 @@ class ApplicationConfigurationSnapshot
|
||||
->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array<string, mixed>>
|
||||
*/
|
||||
private function storageItems(): array
|
||||
{
|
||||
$volumes = $this->application->persistentStorages()
|
||||
->orderBy('id')
|
||||
->get(['id', 'name', 'mount_path', 'host_path'])
|
||||
->map(function (LocalPersistentVolume $volume): array {
|
||||
$source = $volume->host_path ?: $volume->name;
|
||||
|
||||
return $this->item(
|
||||
key: 'volume_'.$volume->id,
|
||||
label: 'Volume mount',
|
||||
value: ['source' => $source, 'destination' => $volume->mount_path],
|
||||
impact: 'redeploy',
|
||||
displayValue: "{$source} → {$volume->mount_path}",
|
||||
);
|
||||
});
|
||||
|
||||
$fileMounts = $this->application->fileStorages()
|
||||
->orderBy('id')
|
||||
->get(['id', 'fs_path', 'mount_path', 'is_directory'])
|
||||
->map(fn (LocalFileVolume $file): array => $this->item(
|
||||
key: 'file_'.$file->id,
|
||||
label: $file->is_directory ? 'Directory mount' : 'File mount',
|
||||
value: ['source' => $file->fs_path, 'destination' => $file->mount_path],
|
||||
impact: 'redeploy',
|
||||
displayValue: "{$file->fs_path} → {$file->mount_path}",
|
||||
));
|
||||
|
||||
return collect($volumes->all())->merge($fileMounts->all())->values()->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array<string, mixed>>
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user