{#if $workspacesStore.length}
{#if isAdmin}
{#if isAdminUser()}
{#if $workspacesStore.length > 500} 500 / {/if} {$workspacesStore.length}
{/if}
{decodeTokenPayload(getMetadata(presentation.metadata.Token) ?? '').workspace ?? ''}
{/if}
{#each $workspacesStore .filter((it) => search === '' || (it.name?.includes(search) ?? false) || it.url.includes(search)) .slice(0, 500) as ws, i} {@const wsName = ws.name ?? ws.url} {@const _activeSession = activeSessions[ws.uuid]} {@const lastUsageDays = Math.round((Date.now() - (ws.lastVisit ?? 0)) / (1000 * 3600 * 24))}
{ await clickHandler(e, ws.url) }} >
0} class:hover={btns[i] === activeElement} on:mousemove={() => { focusTarget(btns[i]) }} >
{wsName} {#if isArchivingMode(ws.mode)} -
{/if} {#if ws.region != null && ws.region !== ''} - ({ws.region}) {/if} {#if isAdmin && ws.lastVisit != null && ws.lastVisit !== 0}
{#if ws.backupInfo != null} {@const sz = Math.max( ws.backupInfo.backupSize, ws.backupInfo.dataSize + ws.backupInfo.blobsSize )} {@const szGb = Math.round((sz * 100) / 1024) / 100} {#if szGb > 0} {Math.round((sz * 100) / 1024) / 100}Gb - {:else} {Math.round(sz)}Mb - {/if} {/if} ({lastUsageDays} days)
{/if}
{#if isAdmin && wsName !== ws.url}
({ws.url})
{/if} {#if isAdmin && (_activeSession?.length ?? 0) > 0}
{_activeSession?.length ?? 0}
{/if}
{#if $resolvedLocationStore.path[1] === ws.url}
{/if}
{/each}
{:else}
{/if}