{#each byService.keys() as s}
Service: {s}
{#each byService.get(s) ?? [] as act}
{@const wsInstance = $workspacesStore.find((it) => it.workspaceId === act.wsId)}
{@const totalFind = act.sessions.reduce((it, itm) => itm.total.find + it, 0)}
{@const totalTx = act.sessions.reduce((it, itm) => itm.total.tx + it, 0)}
{@const currentFind = act.sessions.reduce((it, itm) => itm.current.find + it, 0)}
{@const currentTx = act.sessions.reduce((it, itm) => itm.current.tx + it, 0)}
{@const employeeGroups = Array.from(new Set(act.sessions.map((it) => it.userId))).filter(
(it) => systemAccountEmail !== it || !realUsers
)}
{@const realGroup = Array.from(new Set(act.sessions.map((it) => it.userId))).filter(
(it) => systemAccountEmail !== it
)}
{#if employeeGroups.length > 0}
Workspace: {wsInstance?.workspaceName ?? act.wsId}: {employeeGroups.length} current 5 mins => {currentFind}/{currentTx},
total => {totalFind}/{totalTx}
{#if isAdminUser()}
{
void fetch(endpoint + `/api/v1/manage?token=${token}&operation=force-close&wsId=${act.wsId}`, {
method: 'PUT'
})
}}
/>
{/if}
{#each employeeGroups as employeeId}
{@const employee = employees.get(employeeId)}
{@const connections = act.sessions.filter((it) => it.userId === employeeId)}
{@const find = connections.reduce((it, itm) => itm.current.find + it, 0)}
{@const txes = connections.reduce((it, itm) => itm.current.tx + it, 0)}
{#if employee}
{:else}
{employeeId}
{/if}
: {connections.length}
{#each connections as user, i}
#{i}
{user.userId}
Total: {user.total.find} rx/{user.total.tx} tx
Previous 5 mins: {user.mins5.find} rx/{user.mins5.tx} tx
Current 5 mins: {user.current.find} tx/{user.current.tx} tx
{#each Object.entries(user.data ?? {}) as [k, v]}
{k}: {JSON.stringify(v)}
{/each}
{/each}
{/each}
{/if}
{/each}
{/each}