do not use hash routing for tabs
add empty project creation if local image is found, we only refresh the configuration
This commit is contained in:
@@ -1,29 +1,34 @@
|
||||
<x-layout>
|
||||
<h1>Configuration</h1>
|
||||
<x-applications.navbar :applicationId="$application->id" />
|
||||
<div x-data="{ tab: window.location.hash ? window.location.hash.substring(1) : 'general' }">
|
||||
<div x-data="{ activeTab: 'general' }">
|
||||
<div class="flex gap-4">
|
||||
<a @click.prevent="tab = 'general'; window.location.hash = 'general'" href="#">General</a>
|
||||
<a @click.prevent="tab = 'envs'; window.location.hash = 'envs'" href="#">Environment Variables</a>
|
||||
<a @click.prevent="tab = 'source'; window.location.hash = 'source'" href="#">Source</a>
|
||||
<a @click.prevent="tab = 'destination'; window.location.hash = 'destination'" href="#">Destination
|
||||
<a :class="activeTab === 'general' && 'text-green-500'" @click.prevent="activeTab = 'general'"
|
||||
href="#">General</a>
|
||||
<a :class="activeTab === 'envs' && 'text-green-500'" @click.prevent="activeTab = 'envs'"
|
||||
href="#">Environment Variables</a>
|
||||
<a :class="activeTab === 'source' && 'text-green-500'" @click.prevent="activeTab = 'source'"
|
||||
href="#">Source</a>
|
||||
<a :class="activeTab === 'destination' && 'text-green-500'" @click.prevent="activeTab = 'destination'"
|
||||
href="#">Destination
|
||||
</a>
|
||||
<a @click.prevent="tab = 'storages'; window.location.hash = 'storages'" href="#">Storage
|
||||
<a :class="activeTab === 'storages' && 'text-green-500'" @click.prevent="activeTab = 'storages'"
|
||||
href="#">Storage
|
||||
</a>
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'general'">
|
||||
<div x-cloak x-show="activeTab === 'general'">
|
||||
<livewire:project.application.general :applicationId="$application->id" />
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'envs'">
|
||||
<div x-cloak x-show="activeTab === 'envs'">
|
||||
<livewire:project.application.environment-variables />
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'source'">
|
||||
<div x-cloak x-show="activeTab === 'source'">
|
||||
<livewire:project.application.source :applicationId="$application->id" />
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'destination'">
|
||||
<div x-cloak x-show="activeTab === 'destination'">
|
||||
<livewire:project.application.destination :destination="$application->destination" />
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'storages'">
|
||||
<div x-cloak x-show="activeTab === 'storages'">
|
||||
<livewire:project.application.storages :storages="$application->persistentStorages" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,28 +4,22 @@
|
||||
@elseif ($type === 'resource')
|
||||
<h1>New Resource</h1>
|
||||
@endif
|
||||
<div x-data="{ tab: window.location.hash ? window.location.hash.substring(1) : 'choose' }">
|
||||
<div x-data="{ activeTab: 'choose' }">
|
||||
<div class="flex flex-col w-64 gap-2 mb-10">
|
||||
<button @click.prevent="tab = 'public-repo'; window.location.hash = 'public-repo'">Public Repository
|
||||
</button>
|
||||
<button @click.prevent="tab = 'github-private-repo'; window.location.hash = 'github-private-repo'">Private
|
||||
Repository (GitHub App)</button>
|
||||
<button @click.prevent="activeTab = 'public-repo'">Public Repository</button>
|
||||
<button @click.prevent="activeTab = 'github-private-repo'">Private Repository (GitHub App)</button>
|
||||
@if ($type === 'project')
|
||||
<button @click.prevent="tab = 'empty-project'; window.location.hash = 'empty-project'">Empty
|
||||
Project</button>
|
||||
<livewire:project.new.empty-project />
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div x-cloak x-show="tab === 'public-repo'">
|
||||
<div x-cloak x-show="activeTab === 'public-repo'">
|
||||
<livewire:project.new.public-git-repository :type="$type" />
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'github-private-repo'">
|
||||
<div x-cloak x-show="activeTab === 'github-private-repo'">
|
||||
github-private-repo
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'empty-project'">
|
||||
empty-project
|
||||
</div>
|
||||
<div x-cloak x-show="tab === 'choose'">
|
||||
<div x-cloak x-show="activeTab === 'choose'">
|
||||
Choose any option
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user