mirror of
https://github.com/ershisan99/coolify.git
synced 2026-02-03 12:34:46 +00:00
refactor routes
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
<form class="flex flex-col gap-2" wire:submit='submit'>
|
||||
<x-forms.input autofocus id="name" label="Name" required />
|
||||
<x-forms.input id="description" label="Description" />
|
||||
<x-forms.button type="submit">
|
||||
Save Team
|
||||
</x-forms.button>
|
||||
</form>
|
||||
<div>
|
||||
<h1>New Team</h1>
|
||||
<div class="subtitle">Add a new team</div>
|
||||
<form class="flex flex-col gap-2" wire:submit='submit'>
|
||||
<x-forms.input autofocus id="name" label="Name" required />
|
||||
<x-forms.input id="description" label="Description" />
|
||||
<x-forms.button type="submit">
|
||||
Save Team
|
||||
</x-forms.button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<div>
|
||||
<x-modal yesOrNo modalId="deleteTeam" modalTitle="Delete Team">
|
||||
<x-slot:modalBody>
|
||||
<p>This team be deleted. It is not reversible. <br>Please think again.</p>
|
||||
</x-slot:modalBody>
|
||||
</x-modal>
|
||||
<h2>Danger Zone</h2>
|
||||
<div class="pb-4">Woah. I hope you know what are you doing.</div>
|
||||
<h4 class="pb-4">Delete Team</h4>
|
||||
@if (session('currentTeam.id') === 0)
|
||||
<div>This is the default team. You can't delete it.</div>
|
||||
@elseif(auth()->user()->teams()->get()->count() === 1)
|
||||
<div>You can't delete your last team.</div>
|
||||
@elseif(currentTeam()->subscription && currentTeam()->subscription?->lemon_status !== 'cancelled')
|
||||
<div>Please cancel your subscription before delete this team (Manage My Subscription).</div>
|
||||
@else
|
||||
@if (currentTeam()->isEmpty())
|
||||
<div class="pb-4">This will delete your team. Beware! There is no coming back!</div>
|
||||
<x-forms.button isError isModal modalId="deleteTeam">
|
||||
Delete
|
||||
</x-forms.button>
|
||||
@else
|
||||
<div>
|
||||
<div class="pb-4">You need to delete the following resources to be able to delete the team:</div>
|
||||
@if (currentTeam()->projects()->count() > 0)
|
||||
<h4 class="pb-4">Projects:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->projects as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@if (currentTeam()->servers()->count() > 0)
|
||||
<h4 class="py-4">Servers:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->servers as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@if (currentTeam()->privateKeys()->count() > 0)
|
||||
<h4 class="py-4">Private Keys:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->privateKeys as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@if (currentTeam()->sources()->count() > 0)
|
||||
<h4 class="py-4">Sources:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->sources() as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -1,12 +0,0 @@
|
||||
<form class="flex flex-col gap-2 pb-6" wire:submit='submit'>
|
||||
<div class="flex items-end gap-2">
|
||||
<h2>General</h2>
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
</x-forms.button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<x-forms.input id="team.name" label="Name" required />
|
||||
<x-forms.input id="team.description" label="Description" />
|
||||
</div>
|
||||
</form>
|
||||
89
resources/views/livewire/team/index.blade.php
Normal file
89
resources/views/livewire/team/index.blade.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<div>
|
||||
<x-team.navbar />
|
||||
|
||||
<form class="flex flex-col gap-2 pb-6" wire:submit='submit'>
|
||||
<div class="flex items-end gap-2">
|
||||
<h2>General</h2>
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
</x-forms.button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<x-forms.input id="team.name" label="Name" required />
|
||||
<x-forms.input id="team.description" label="Description" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@if (isCloud())
|
||||
<div class="pb-8">
|
||||
<h2>Subscription</h2>
|
||||
@if (data_get(currentTeam(), 'subscription'))
|
||||
<livewire:subscription.actions />
|
||||
@else
|
||||
<x-forms.button class="mt-4"><a class="text-white hover:no-underline"
|
||||
href="{{ route('subscription.index') }}">Subscribe Now</a>
|
||||
</x-forms.button>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<x-modal yesOrNo modalId="deleteTeam" modalTitle="Delete Team">
|
||||
<x-slot:modalBody>
|
||||
<p>This team be deleted. It is not reversible. <br>Please think again.</p>
|
||||
</x-slot:modalBody>
|
||||
</x-modal>
|
||||
<h2>Danger Zone</h2>
|
||||
<div class="pb-4">Woah. I hope you know what are you doing.</div>
|
||||
<h4 class="pb-4">Delete Team</h4>
|
||||
@if (session('currentTeam.id') === 0)
|
||||
<div>This is the default team. You can't delete it.</div>
|
||||
@elseif(auth()->user()->teams()->get()->count() === 1)
|
||||
<div>You can't delete your last team.</div>
|
||||
@elseif(currentTeam()->subscription && currentTeam()->subscription?->lemon_status !== 'cancelled')
|
||||
<div>Please cancel your subscription before delete this team (Manage My Subscription).</div>
|
||||
@else
|
||||
@if (currentTeam()->isEmpty())
|
||||
<div class="pb-4">This will delete your team. Beware! There is no coming back!</div>
|
||||
<x-forms.button isError isModal modalId="deleteTeam">
|
||||
Delete
|
||||
</x-forms.button>
|
||||
@else
|
||||
<div>
|
||||
<div class="pb-4">You need to delete the following resources to be able to delete the team:</div>
|
||||
@if (currentTeam()->projects()->count() > 0)
|
||||
<h4 class="pb-4">Projects:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->projects as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@if (currentTeam()->servers()->count() > 0)
|
||||
<h4 class="py-4">Servers:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->servers as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@if (currentTeam()->privateKeys()->count() > 0)
|
||||
<h4 class="py-4">Private Keys:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->privateKeys as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@if (currentTeam()->sources()->count() > 0)
|
||||
<h4 class="py-4">Sources:</h4>
|
||||
<ul class="pl-8 list-disc">
|
||||
@foreach (currentTeam()->sources() as $resource)
|
||||
<li>{{ $resource->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
44
resources/views/livewire/team/member/index.blade.php
Normal file
44
resources/views/livewire/team/member/index.blade.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<div>
|
||||
<x-team.navbar />
|
||||
<h2>Members</h2>
|
||||
<div class="pt-4 overflow-hidden">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Role</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (currentTeam()->members->sortBy('name') as $member)
|
||||
<livewire:team.member :member="$member" :wire:key="$member->id" />
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if (auth()->user()->isAdminFromSession())
|
||||
<div class="py-4">
|
||||
@if (is_transactional_emails_active())
|
||||
<h3 class="pb-4">Invite a new member</h3>
|
||||
@else
|
||||
<h3>Invite a new member</h3>
|
||||
@if (isInstanceAdmin())
|
||||
<div class="pb-4 text-xs text-warning">You need to configure (as root team) <a href="/settings#smtp"
|
||||
class="underline text-warning">Transactional
|
||||
Emails</a>
|
||||
before
|
||||
you can invite a
|
||||
new
|
||||
member
|
||||
via
|
||||
email.
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
<livewire:team.invite-link />
|
||||
</div>
|
||||
<livewire:team.invitations :invitations="$invitations" />
|
||||
@endif
|
||||
</div>
|
||||
24
resources/views/livewire/team/notification/index.blade.php
Normal file
24
resources/views/livewire/team/notification/index.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<div>
|
||||
<x-team.navbar />
|
||||
<h2 class="pb-4">Notifications</h2>
|
||||
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'email' }" class="flex h-full">
|
||||
<div class="flex flex-col gap-4 min-w-fit">
|
||||
<a :class="activeTab === 'email' && 'text-white'"
|
||||
@click.prevent="activeTab = 'email'; window.location.hash = 'email'" href="#">Email</a>
|
||||
<a :class="activeTab === 'Telegram' && 'text-white'"
|
||||
@click.prevent="activeTab = 'telegram'; window.location.hash = 'telegram'" href="#">Telegram</a>
|
||||
<a :class="activeTab === 'discord' && 'text-white'"
|
||||
@click.prevent="activeTab = 'discord'; window.location.hash = 'discord'" href="#">Discord</a>
|
||||
</div>
|
||||
<div class="w-full pl-8">
|
||||
<div x-cloak x-show="activeTab === 'email'" class="h-full">
|
||||
<livewire:notifications.email-settings />
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'telegram'" class="h-full">
|
||||
<livewire:notifications.telegram-settings />
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'discord'">
|
||||
<livewire:notifications.discord-settings />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
33
resources/views/livewire/team/storage/index.blade.php
Normal file
33
resources/views/livewire/team/storage/index.blade.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<div>
|
||||
<x-team.navbar :team="auth()
|
||||
->user()
|
||||
->currentTeam()" />
|
||||
<div class="flex items-start gap-2">
|
||||
<h2 class="pb-4">S3 Storages</h2>
|
||||
<a class="text-white hover:no-underline" href="/team/storages/new"> <x-forms.button class="btn">+ Add
|
||||
</x-forms.button></a>
|
||||
</div>
|
||||
<div class="grid gap-2 lg:grid-cols-2">
|
||||
@forelse ($s3 as $storage)
|
||||
<div x-data x-on:click="goto('{{ $storage->uuid }}')" @class(['gap-2 border cursor-pointer box group border-transparent'])>
|
||||
<div class="flex flex-col mx-6">
|
||||
<div class=" group-hover:text-white">
|
||||
{{ $storage->name }}
|
||||
</div>
|
||||
<div class="text-xs group-hover:text-white">
|
||||
{{ $storage->description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div>
|
||||
<div>No storage found.</div>
|
||||
<x-use-magic-bar link="/team/storages/new" />
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
<script>
|
||||
function goto(uuid) {
|
||||
window.location.href = '/team/storages/' + uuid;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
6
resources/views/livewire/team/storage/show.blade.php
Normal file
6
resources/views/livewire/team/storage/show.blade.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<div>
|
||||
<x-team.navbar :team="auth()
|
||||
->user()
|
||||
->currentTeam()" />
|
||||
<livewire:team.storage.form :storage="$storage" />
|
||||
</div>
|
||||
3
resources/views/livewire/team/storages/create.blade.php
Normal file
3
resources/views/livewire/team/storages/create.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
{{-- If you look to others for fulfillment, you will never truly be fulfilled. --}}
|
||||
</div>
|
||||
Reference in New Issue
Block a user