mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-03 04:59:27 +00:00
ui: Better layout for root team
This commit is contained in:
@@ -24,6 +24,16 @@
|
||||
|
||||
import { session } from '$app/stores';
|
||||
export let destinations: Prisma.DestinationDocker[];
|
||||
const ownDestinations = destinations.filter((destination) => {
|
||||
if (destination.teams[0].id === $session.teamId) {
|
||||
return destination;
|
||||
}
|
||||
});
|
||||
const otherDestinations = destinations.filter((destination) => {
|
||||
if (destination.teams[0].id !== $session.teamId) {
|
||||
return destination;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="flex space-x-1 p-6 font-bold">
|
||||
@@ -52,18 +62,40 @@
|
||||
<div class="text-center text-xl font-bold">No destination found</div>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="flex flex-wrap justify-center">
|
||||
{#each destinations as destination}
|
||||
<a href="/destinations/{destination.id}" class="no-underline p-2 w-96">
|
||||
<div class="box-selection hover:bg-sky-600">
|
||||
<div class="font-bold text-xl text-center truncate">{destination.name}</div>
|
||||
{#if $session.teamId === '0'}
|
||||
<div class="text-center truncate">Team {destination.teams[0].name}</div>
|
||||
{/if}
|
||||
<div class="text-center truncate">{destination.network}</div>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
<div class="flex flex-col">
|
||||
{#if $session.teamId === '0'}
|
||||
<div class="text-xl font-bold pb-5 -ml-10">Your Team's Destinations</div>
|
||||
{/if}
|
||||
<div class="flex flex-col md:flex-row">
|
||||
{#each ownDestinations as destination}
|
||||
<a href="/destinations/{destination.id}" class="no-underline p-2 w-96">
|
||||
<div class="box-selection hover:bg-sky-600">
|
||||
<div class="font-bold text-xl text-center truncate">{destination.name}</div>
|
||||
{#if $session.teamId === '0'}
|
||||
<div class="text-center truncate">Team {destination.teams[0].name}</div>
|
||||
{/if}
|
||||
<div class="text-center truncate">{destination.network}</div>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
{#if otherDestinations.length > 0 && $session.teamId === '0'}
|
||||
<div class="text-xl font-bold pb-5 pt-10 -ml-10">Other Team's Destinations</div>
|
||||
<div class="flex">
|
||||
{#each otherDestinations as destination}
|
||||
<a href="/destinations/{destination.id}" class="no-underline p-2 w-96">
|
||||
<div class="box-selection hover:bg-sky-600">
|
||||
<div class="font-bold text-xl text-center truncate">{destination.name}</div>
|
||||
{#if $session.teamId === '0'}
|
||||
<div class="text-center truncate">Team {destination.teams[0].name}</div>
|
||||
{/if}
|
||||
<div class="text-center truncate">{destination.network}</div>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user