feat(statistics): добавить BI-разрез и сводную матрицу
Docker images / prepare-release (push) Successful in 10s
Docker images / backend-test (push) Successful in 2m23s
Docker images / frontend-image (push) Successful in 3m30s
Docker images / updater-image (push) Successful in 52s
Docker images / backend-image (push) Successful in 3m8s
Docker images / notify-webhook (push) Skipped
Docker images / publish-release (push) Successful in 14s
Docker images / prepare-release (push) Successful in 10s
Docker images / backend-test (push) Successful in 2m23s
Docker images / frontend-image (push) Successful in 3m30s
Docker images / updater-image (push) Successful in 52s
Docker images / backend-image (push) Successful in 3m8s
Docker images / notify-webhook (push) Skipped
Docker images / publish-release (push) Successful in 14s
Сопоставить клиентов с ifIndex как на карте трафика, чтобы KPI пользователей не обнулялся. На экране — разрез остальных измерений и сводная матрица. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import type { StatisticsDto, StatisticsQuery } from "@mmapp/contracts/statistics"
|
||||
import type {
|
||||
StatisticsDto,
|
||||
StatisticsPivotDto,
|
||||
StatisticsPivotQuery,
|
||||
StatisticsQuery,
|
||||
} from "@mmapp/contracts/statistics"
|
||||
import { requestJson } from "@/shared/api/http-client"
|
||||
|
||||
export type { StatisticsDto, StatisticsQuery }
|
||||
export type { StatisticsDto, StatisticsQuery, StatisticsPivotDto, StatisticsPivotQuery }
|
||||
export { STATISTICS_UNBOUND_USER_ID } from "@mmapp/contracts/statistics"
|
||||
|
||||
export async function getStatistics(
|
||||
baseUrl: string,
|
||||
@@ -18,3 +24,22 @@ export async function getStatistics(
|
||||
if (query.asn != null) params.set("asn", String(query.asn))
|
||||
return requestJson<StatisticsDto>(baseUrl, `/api/statistics?${params.toString()}`)
|
||||
}
|
||||
|
||||
export async function getStatisticsPivot(
|
||||
baseUrl: string,
|
||||
query: StatisticsPivotQuery,
|
||||
): Promise<StatisticsPivotDto> {
|
||||
const params = new URLSearchParams()
|
||||
params.set("from", query.from)
|
||||
params.set("to", query.to)
|
||||
params.set("row", query.row)
|
||||
params.set("col", query.col)
|
||||
params.set("metric", query.metric)
|
||||
if (query.serverId != null) params.set("serverId", String(query.serverId))
|
||||
if (query.userId) params.set("userId", query.userId)
|
||||
if (query.iface) params.set("iface", query.iface)
|
||||
if (query.country) params.set("country", query.country)
|
||||
if (query.service) params.set("service", query.service)
|
||||
if (query.asn != null) params.set("asn", String(query.asn))
|
||||
return requestJson<StatisticsPivotDto>(baseUrl, `/api/statistics/pivot?${params.toString()}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user