do not show servers to non admins

This commit is contained in:
Andras Bacsai
2022-09-08 15:23:01 +02:00
parent 18e899d15e
commit aa6c56b63d
2 changed files with 32 additions and 26 deletions

View File

@@ -159,6 +159,7 @@
<path d="M16 15c-2.21 1.333 -5.792 1.333 -8 0" /> <path d="M16 15c-2.21 1.333 -5.792 1.333 -8 0" />
</svg> </svg>
</a> </a>
{#if $appSession.teamId === '0'}
<a <a
id="servers" id="servers"
sveltekit:prefetch sveltekit:prefetch
@@ -185,6 +186,7 @@
<line x1="7" y1="16" x2="7" y2="16.01" /> <line x1="7" y1="16" x2="7" y2="16.01" />
</svg> </svg>
</a> </a>
{/if}
</div> </div>
<Tooltip triggeredBy="#dashboard" placement="right">Dashboard</Tooltip> <Tooltip triggeredBy="#dashboard" placement="right">Dashboard</Tooltip>
<Tooltip triggeredBy="#servers" placement="right">Servers</Tooltip> <Tooltip triggeredBy="#servers" placement="right">Servers</Tooltip>

View File

@@ -23,6 +23,10 @@
<script lang="ts"> <script lang="ts">
export let servers: any; export let servers: any;
import { appSession } from '$lib/store'; import { appSession } from '$lib/store';
import { goto } from '$app/navigation';
if ($appSession.teamId !== '0') {
goto('/');
}
</script> </script>
<div class="flex space-x-1 p-6 font-bold"> <div class="flex space-x-1 p-6 font-bold">
@@ -42,7 +46,7 @@
{/each} {/each}
</div> </div>
{:else} {:else}
<h1 class="">Nothing here.</h1> <h1 class="text-center text-xs">Nothing here.</h1>
{/if} {/if}
</div> </div>
<div class="text-xs text-center">Remote servers will be here soon</div> <div class="text-xs text-center">Remote servers will be here soon</div>