fix: Team switching moved to IAM menu

This commit is contained in:
Andras Bacsai
2022-04-28 14:12:19 +02:00
parent 48fa4ff245
commit 106aee31bd
2 changed files with 46 additions and 44 deletions

View File

@@ -25,7 +25,6 @@
if (res.ok) {
return {
props: {
selectedTeamId: session.teamId,
...(await res.json())
}
};
@@ -35,9 +34,6 @@
</script>
<script>
export let teams;
export let selectedTeamId;
import '../tailwind.css';
import { SvelteToast, toast } from '@zerodevx/svelte-toast';
import { page, session } from '$app/stores';
@@ -89,17 +85,6 @@
return errorNotification(error);
}
}
async function switchTeam() {
try {
await post(`/dashboard.json?from=${$page.url.pathname}`, {
cookie: 'teamId',
value: selectedTeamId
});
return window.location.reload();
} catch (error) {
return window.location.reload();
}
}
async function update() {
updateStatus.loading = true;
@@ -525,21 +510,10 @@
</div>
</nav>
{#if $session.whiteLabeled}
<span class="fixed bottom-0 left-[50px] z-50 m-2 px-4 text-xs text-stone-700"
<span class="fixed bottom-0 left-[50px] z-50 m-2 px-4 text-xs text-stone-700"
>Powered by <a href="https://coolify.io" target="_blank">Coolify</a></span
>
{/if}
<select
class="fixed right-0 bottom-0 z-50 m-2 w-64 bg-opacity-30 p-2 px-4 hover:bg-opacity-100"
bind:value={selectedTeamId}
on:change={switchTeam}
>
<option value="" disabled selected>Switch to a different team...</option>
{#each teams as team}
<option value={team.teamId}>{team.team.name} - {team.permission}</option>
{/each}
</select>
{/if}
<main>
<slot />