mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 05:55:09 +02:00
UBERF-6042: Fix front service (#4991)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
import Expandable from '@hcengineering/ui/src/components/Expandable.svelte'
|
||||
import { ObjectPresenter } from '@hcengineering/view-resources'
|
||||
import { onDestroy } from 'svelte'
|
||||
import MetricsInfo from './statistics/MetricsInfo.svelte'
|
||||
import { workspacesStore } from '../utils'
|
||||
import MetricsInfo from './statistics/MetricsInfo.svelte'
|
||||
|
||||
const _endpoint: string = fetchMetadataLocalStorage(login.metadata.LoginEndpoint) ?? ''
|
||||
const token: string = getMetadata(presentation.metadata.Token) ?? ''
|
||||
@@ -30,6 +30,7 @@
|
||||
}
|
||||
|
||||
let data: any
|
||||
let dataFront: any
|
||||
let admin = false
|
||||
onDestroy(
|
||||
ticker.subscribe(() => {
|
||||
@@ -41,6 +42,14 @@
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
|
||||
void fetch(`/api/v1/statistics?token=${token}`, {})
|
||||
.then(async (json) => {
|
||||
dataFront = await json.json()
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
})
|
||||
)
|
||||
const tabs: TabItem[] = [
|
||||
@@ -50,7 +59,11 @@
|
||||
},
|
||||
{
|
||||
id: 'statistics',
|
||||
labelIntl: getEmbeddedLabel('Statistics')
|
||||
labelIntl: getEmbeddedLabel('Server')
|
||||
},
|
||||
{
|
||||
id: 'statistics-front',
|
||||
labelIntl: getEmbeddedLabel('Front')
|
||||
},
|
||||
{
|
||||
id: 'users',
|
||||
@@ -91,6 +104,8 @@
|
||||
|
||||
$: metricsData = data?.metrics as Metrics | undefined
|
||||
|
||||
$: metricsDataFront = dataFront?.metrics as Metrics | undefined
|
||||
|
||||
$: totalStats = Array.from(Object.entries(activeSessions).values()).reduce(
|
||||
(cur, it) => {
|
||||
const totalFind = it[1].reduce((it, itm) => itm.current.find + it, 0)
|
||||
@@ -240,6 +255,12 @@
|
||||
<MetricsInfo metrics={metricsData} />
|
||||
{/if}
|
||||
</div>
|
||||
{:else if selectedTab === 'statistics-front'}
|
||||
<div class="flex-column p-3 h-full" style:overflow="auto">
|
||||
{#if metricsDataFront !== undefined}
|
||||
<MetricsInfo metrics={metricsDataFront} />
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{:else}
|
||||
<Loading />
|
||||
|
||||
Reference in New Issue
Block a user