Only show teams for root team

This commit is contained in:
Andras Bacsai 2022-04-06 20:44:24 +02:00
parent ae4942ba29
commit 9f2f5b40c3
5 changed files with 18 additions and 5 deletions

View File

@ -15,6 +15,7 @@
import Docker from '$lib/components/svg/applications/Docker.svelte'; import Docker from '$lib/components/svg/applications/Docker.svelte';
import Astro from '$lib/components/svg/applications/Astro.svelte'; import Astro from '$lib/components/svg/applications/Astro.svelte';
import Eleventy from '$lib/components/svg/applications/Eleventy.svelte'; import Eleventy from '$lib/components/svg/applications/Eleventy.svelte';
import { session } from '$app/stores';
const buildPack = application?.buildPack?.toLowerCase(); const buildPack = application?.buildPack?.toLowerCase();
</script> </script>
@ -54,7 +55,9 @@
{/if} {/if}
<div class="truncate text-center text-xl font-bold">{application.name}</div> <div class="truncate text-center text-xl font-bold">{application.name}</div>
<div class="truncate text-center">Team {application.teams[0].name}</div> {#if $session.teamId === '0'}
<div class="truncate text-center">Team {application.teams[0].name}</div>
{/if}
{#if application.fqdn} {#if application.fqdn}
<div class="truncate text-center">{application.fqdn}</div> <div class="truncate text-center">{application.fqdn}</div>
{/if} {/if}

View File

@ -8,6 +8,7 @@
import Redis from '$lib/components/svg/databases/Redis.svelte'; import Redis from '$lib/components/svg/databases/Redis.svelte';
import { post } from '$lib/api'; import { post } from '$lib/api';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { session } from '$app/stores';
async function newDatabase() { async function newDatabase() {
const { id } = await post('/databases/new', {}); const { id } = await post('/databases/new', {});
@ -59,7 +60,9 @@
<div class="font-bold text-xl text-center truncate"> <div class="font-bold text-xl text-center truncate">
{database.name} {database.name}
</div> </div>
<div class="text-center truncate">Team {database.teams[0].name}</div> {#if $session.teamId === '0'}
<div class="text-center truncate">Team {database.teams[0].name}</div>
{/if}
{#if !database.type} {#if !database.type}
<div class="font-bold text-center truncate text-red-500 group-hover:text-white"> <div class="font-bold text-center truncate text-red-500 group-hover:text-white">
Configuration missing Configuration missing

View File

@ -57,7 +57,9 @@
<a href="/destinations/{destination.id}" class="no-underline p-2 w-96"> <a href="/destinations/{destination.id}" class="no-underline p-2 w-96">
<div class="box-selection hover:bg-sky-600"> <div class="box-selection hover:bg-sky-600">
<div class="font-bold text-xl text-center truncate">{destination.name}</div> <div class="font-bold text-xl text-center truncate">{destination.name}</div>
<div class="text-center truncate">Team {destination.teams[0].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 class="text-center truncate">{destination.network}</div>
</div> </div>
</a> </a>

View File

@ -12,6 +12,7 @@
import UptimeKuma from '$lib/components/svg/services/UptimeKuma.svelte'; import UptimeKuma from '$lib/components/svg/services/UptimeKuma.svelte';
import Ghost from '$lib/components/svg/services/Ghost.svelte'; import Ghost from '$lib/components/svg/services/Ghost.svelte';
import MeiliSearch from '$lib/components/svg/services/MeiliSearch.svelte'; import MeiliSearch from '$lib/components/svg/services/MeiliSearch.svelte';
import { session } from '$app/stores';
export let services; export let services;
async function newService() { async function newService() {
@ -74,7 +75,9 @@
<div class="font-bold text-xl text-center truncate"> <div class="font-bold text-xl text-center truncate">
{service.name} {service.name}
</div> </div>
<div class="text-center truncate">Team {service.teams[0].name}</div> {#if $session.teamId === '0'}
<div class="text-center truncate">Team {service.teams[0].name}</div>
{/if}
{#if !service.type || !service.fqdn} {#if !service.type || !service.fqdn}
<div class="font-bold text-center truncate text-red-500 group-hover:text-white"> <div class="font-bold text-center truncate text-red-500 group-hover:text-white">
Configuration missing Configuration missing

View File

@ -60,7 +60,9 @@
class:border-l-4={source.gitlabApp && !source.gitlabAppId} class:border-l-4={source.gitlabApp && !source.gitlabAppId}
> >
<div class="font-bold text-xl text-center truncate">{source.name}</div> <div class="font-bold text-xl text-center truncate">{source.name}</div>
<div class="text-center truncate">Team {source.teams[0].name}</div> {#if $session.teamId === '0'}
<div class="text-center truncate">Team {source.teams[0].name}</div>
{/if}
{#if (source.type === 'gitlab' && !source.gitlabAppId) || (source.type === 'github' && !source.githubAppId && !source.githubApp?.installationId)} {#if (source.type === 'gitlab' && !source.gitlabAppId) || (source.type === 'github' && !source.githubAppId && !source.githubApp?.installationId)}
<div class="font-bold text-center truncate text-red-500 group-hover:text-white"> <div class="font-bold text-center truncate text-red-500 group-hover:text-white">
Configuration missing Configuration missing