feat: lock environment variables

This commit is contained in:
Andras Bacsai
2023-10-24 15:41:21 +02:00
parent 6e73f7f2e4
commit 0232cf5b4c
6 changed files with 121 additions and 43 deletions

View File

@@ -28,8 +28,7 @@
@endif
@else
<form wire:submit.prevent='saveVariables(false)' class="flex flex-col gap-2">
<x-forms.textarea rows=25 class="whitespace-pre-wrap"
id="variables"></x-forms.textarea>
<x-forms.textarea rows=25 class="whitespace-pre-wrap" id="variables"></x-forms.textarea>
<x-forms.button type="submit" class="btn btn-primary">Save</x-forms.button>
</form>
@if ($showPreview)

View File

@@ -6,36 +6,54 @@
</x-slot:modalBody>
</x-modal>
<form wire:submit.prevent='submit' class="flex flex-col items-center gap-2 xl:flex-row">
@if ($isDisabled)
@if ($isLocked)
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path d="M5 13a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-6z" />
<path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-3-5V7a4 4 0 1 1 8 0v4" />
</g>
</svg>
<x-forms.input disabled id="env.key" />
<x-forms.input disabled type="password" id="env.value" />
@if ($type !== 'service')
<x-forms.checkbox instantSave id="env.is_build_time" label="Build Variable?" />
@endif
@else
<x-forms.input id="env.key" />
<x-forms.input type="password" id="env.value" />
@if ($type !== 'service')
<x-forms.checkbox instantSave id="env.is_build_time" label="Build Variable?" />
@if ($isDisabled)
<x-forms.input disabled id="env.key" />
<x-forms.input disabled type="password" id="env.value" />
@if ($type !== 'service')
<x-forms.checkbox instantSave id="env.is_build_time" label="Build Variable?" />
@endif
@else
<x-forms.input id="env.key" />
<x-forms.input type="password" id="env.value" />
@if ($type !== 'service')
<x-forms.checkbox instantSave id="env.is_build_time" label="Build Variable?" />
@endif
@endif
@endif
<div class="flex gap-2">
@if ($isDisabled)
<x-forms.button disabled type="submit">
Update
</x-forms.button>
<x-forms.button disabled isError isModal modalId="{{ $modalId }}">
Delete
</x-forms.button>
@else
<x-forms.button type="submit">
Update
</x-forms.button>
@if ($isLocked)
<x-forms.button isError isModal modalId="{{ $modalId }}">
Delete
</x-forms.button>
@else
@if ($isDisabled)
<x-forms.button disabled type="submit">
Update
</x-forms.button>
<x-forms.button disabled isError isModal modalId="{{ $modalId }}">
Delete
</x-forms.button>
@else
<x-forms.button type="submit">
Update
</x-forms.button>
<x-forms.button wire:click='lock'>
Lock
</x-forms.button>
<x-forms.button isError isModal modalId="{{ $modalId }}">
Delete
</x-forms.button>
@endif
@endif
</div>
</form>
</div>