feat: add comment field to environment variables

- Add comment field to EnvironmentVariable model and database
- Update parseEnvFormatToArray to extract inline comments from env files
- Update Livewire components to handle comment field
- Add UI for displaying and editing comments
- Add tests for comment parsing functionality
This commit is contained in:
Andras Bacsai
2025-12-27 15:24:09 +01:00
parent 083d745d70
commit e33558488e
12 changed files with 623 additions and 103 deletions
+7 -2
View File
@@ -63,10 +63,15 @@ class DockerCompose extends Component
]);
$variables = parseEnvFormatToArray($this->envFile);
foreach ($variables as $key => $variable) {
foreach ($variables as $key => $data) {
// Extract value and comment from parsed data
$value = $data['value'] ?? $data;
$comment = $data['comment'] ?? null;
EnvironmentVariable::create([
'key' => $key,
'value' => $variable,
'value' => $value,
'comment' => $comment,
'is_preview' => false,
'resourceable_id' => $service->id,
'resourceable_type' => $service->getMorphClass(),