decompose structure

This commit is contained in:
Первов Артем
2026-06-20 00:51:18 +03:00
parent dbda8ee613
commit 31add10e56
77 changed files with 4112 additions and 3974 deletions

View File

@@ -0,0 +1,8 @@
import { getJson } from '../../shared/api/http';
import { cloudApiUrl } from '../../shared/config/env';
import type { HistoryRequest, HistoryResponse } from './types';
/** Запрашивает исторический ряд с avg-линией и min/max-диапазоном для графика. */
export function getHistory(params: HistoryRequest): Promise<HistoryResponse> {
return getJson<HistoryResponse>(cloudApiUrl, '/history', params);
}

View File

@@ -0,0 +1,30 @@
export type HistoryPoint = {
t: number;
min: number;
avg: number;
max: number;
count: number;
};
export type HistorySeries = {
edge: string;
tag: string;
points: HistoryPoint[];
};
export type HistoryResponse = {
edge: string;
tag: string;
granulate: string;
series: HistorySeries[];
from: string;
to: string;
};
export type HistoryRequest = {
edge: string;
tag: string;
from: string;
to: string;
granulate: string;
};