This commit is contained in:
Andras Bacsai 2023-05-17 12:14:18 +02:00
parent 8e5adb47a0
commit 14d7e9e7f9
11 changed files with 62 additions and 54 deletions

View File

@ -6,7 +6,7 @@
use Livewire\Component;
use Illuminate\Support\Str;
class Revert extends Component
class Rollback extends Component
{
public Application $application;
public $images = [];

View File

@ -1,12 +1,12 @@
<form wire:submit.prevent='submit' class="flex items-end gap-2 px-2">
<x-inputs.input noLabel noDirty id="key" label="Name" required />
<x-inputs.input noLabel noDirty id="value" label="Value" required />
<div class="flex flex-col">
<div class="flex items-center gap-2">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<div class="flex gap-2">
<x-inputs.input noDirty id="key" label="Name" required />
<x-inputs.input noDirty id="value" label="Value" required />
<x-inputs.input noDirty type="checkbox" id="is_build_time" label="Build Variable?" />
</div>
</div>
<x-inputs.button type="submit">
<div class="pt-2">
<x-inputs.button isBold type="submit">
Add
</x-inputs.button>
</div>
</form>

View File

@ -1,9 +1,11 @@
<div class="flex flex-col gap-2">
<h3>Environment Variables</h3>
@foreach ($application->environment_variables as $env)
@forelse ($application->environment_variables as $env)
<livewire:project.application.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" />
@endforeach
@empty
<p>There are no environment variables added for this application.</p>
@endforelse
<div class="pt-10">
<livewire:project.application.environment-variable.add />
</div>

View File

@ -1,18 +1,18 @@
<div x-data="{ deleteEnvironment: false }">
<form wire:submit.prevent='submit' class="flex gap-2 px-2">
<x-inputs.input id="env.key" noLabel />
<x-inputs.input id="env.value" noLabel />
<div class="flex flex-col">
<div class="flex items-center gap-2">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<div class="flex gap-2">
<x-inputs.input label="Name" id="env.key" />
<x-inputs.input label="Value" id="env.value" />
<x-inputs.input type="checkbox" id="env.is_build_time" label="Build Variable?" />
</div>
</div>
<x-inputs.button type="submit">
<div class="pt-2">
<x-inputs.button isBold type="submit">
Update
</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteEnvironment = true" isWarning>
Delete
</x-inputs.button>
</div>
</form>
<x-naked-modal show="deleteEnvironment" message="Are you sure you want to delete {{ $env->key }}?" />
</div>

View File

@ -14,7 +14,7 @@
<x-inputs.input placeholder="0-2" label="CPU set to use" id="application.limits_cpuset" />
<x-inputs.input placeholder="1024" label="CPU Weight" id="application.limits_cpu_shares" />
<div class="pt-4">
<x-inputs.button>Save</x-inputs.button>
<x-inputs.button isBold>Save</x-inputs.button>
</div>
</form>
</div>

View File

@ -1,6 +1,7 @@
<div x-init="$wire.loadImages">
<h2>Revert</h2>
<div>
<x-inputs.button isBold wire:click='loadImages'>Refresh</x-inputs.button>
<x-inputs.button isBold wire:click='loadImages'>Refresh Images</x-inputs.button>
</div>
<div wire:loading wire:target='loadImages'>
<x-loading />

View File

@ -10,7 +10,7 @@
<x-inputs.input id="application.git_branch" label=" Branch" readonly />
<x-inputs.input id="application.git_commit_sha" placeholder="HEAD" label="Commit SHA" />
<div>
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button isBold type="submit">Save</x-inputs.button>
<a target="_blank" href="{{ $application->gitCommits }}">
Commits <img class="inline-flex w-4 h-4" src="{{ asset('svgs/external-link.svg') }}">
</a>

View File

@ -1,9 +1,12 @@
<form wire:submit.prevent='submit' class="flex items-end gap-2 px-2">
<form wire:submit.prevent='submit' class="flex flex-col px-2 pt-10 max-w-fit">
<div class="flex gap-2">
<x-inputs.input noDirty id="name" label="Name" required />
<x-inputs.input noDirty id="mount_path" label="Mount Path (in your app)" required />
<x-inputs.input noDirty id="host_path" label="Mount Path (host)" />
<x-inputs.button type="submit">
<x-inputs.input noDirty id="host_path" label="Source Path" />
<x-inputs.input noDirty id="mount_path" label="Destination Path" required />
</div>
<div class="pt-2">
<x-inputs.button isBold type="submit">
Add
</x-inputs.button>
</div>
</form>

View File

@ -3,8 +3,7 @@
@forelse ($application->persistentStorages as $storage)
<livewire:project.application.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage" />
@empty
<p>There are no persistent storage attached for this application.</p>
<p>There are no persistent storages attached for this application.</p>
@endforelse
<h4>Add new environment variable</h4>
<livewire:project.application.storages.add />
</div>

View File

@ -1,15 +1,18 @@
<div x-data="{ deleteStorage: false }">
<form wire:submit.prevent='submit' class="flex items-end gap-2 px-2">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<div class="flex gap-2">
<x-inputs.input id="storage.name" label="Name" required />
<x-inputs.input id="storage.mount_path" label="Mount Path (in your app)" required />
<x-inputs.input id="storage.host_path" label="Mount Path (host)" />
<x-inputs.button type="submit">
<x-inputs.input id="storage.host_path" label="Source Path" />
<x-inputs.input id="storage.mount_path" label="Destination Path" required />
</div>
<div class="pt-2">
<x-inputs.button isBold type="submit">
Update
</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteStorage = true" isWarning>
Delete
</x-inputs.button>
</div>
</form>
<x-naked-modal show="deleteStorage" message="Are you sure you want to delete {{ $storage->name }}?" />
</div>

View File

@ -18,8 +18,8 @@
<a :class="activeTab === 'storages' && 'text-white'"
@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'" href="#">Storages
</a>
<a :class="activeTab === 'revert' && 'text-white'"
@click.prevent="activeTab = 'revert'; window.location.hash = 'revert'" href="#">Revert
<a :class="activeTab === 'rollback' && 'text-white'"
@click.prevent="activeTab = 'rollback'; window.location.hash = 'rollback'" href="#">Rollback
</a>
<a :class="activeTab === 'resource-limits' && 'text-white'"
@click.prevent="activeTab = 'resource-limits'; window.location.hash = 'resource-limits'"
@ -45,8 +45,8 @@
<div x-cloak x-show="activeTab === 'storages'">
<livewire:project.application.storages.all :application="$application" />
</div>
<div x-cloak x-show="activeTab === 'revert'">
<livewire:project.application.revert :application="$application" />
<div x-cloak x-show="activeTab === 'rollback'">
<livewire:project.application.rollback :application="$application" />
</div>
<div x-cloak x-show="activeTab === 'resource-limits'">
<livewire:project.application.resource-limits :application="$application" />