wip: coolify.json

This commit is contained in:
Andras Bacsai
2024-10-08 15:11:19 +02:00
parent 052fcd2520
commit 974b4b92c1
9 changed files with 195 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Livewire\Project\Application;
use App\Actions\Application\GenerateConfig;
use App\Models\Application;
use Illuminate\Support\Collection;
use Livewire\Component;
@@ -413,4 +414,16 @@ class General extends Component
$this->dispatch('configurationChanged');
}
}
public function downloadConfig()
{
$config = GenerateConfig::run($this->application, true);
$fileName = str($this->application->name)->slug()->append('_config.json');
return response()->streamDownload(function () use ($config) {
echo $config;
}, $fileName, [
'Content-Type' => 'application/json',
'Content-Disposition' => 'attachment; filename=' . $fileName,
]);
}
}