Compare commits
3 Commits
bur-54
...
743e3c52b7
| Author | SHA1 | Date | |
|---|---|---|---|
| 743e3c52b7 | |||
|
|
095df38e7e | ||
| 46cf3da755 |
@@ -3,6 +3,6 @@ import { cloudApiUrl } from '../../shared/config/env';
|
|||||||
import type { HistoryRequest, HistoryResponse } from './types';
|
import type { HistoryRequest, HistoryResponse } from './types';
|
||||||
|
|
||||||
/** Запрашивает исторический ряд с avg-линией и min/max-диапазоном для графика. */
|
/** Запрашивает исторический ряд с avg-линией и min/max-диапазоном для графика. */
|
||||||
export function getHistory(params: HistoryRequest): Promise<HistoryResponse> {
|
export function getHistory(params: HistoryRequest, signal?: AbortSignal): Promise<HistoryResponse> {
|
||||||
return getJson<HistoryResponse>(cloudApiUrl, '/history', params);
|
return getJson<HistoryResponse>(cloudApiUrl, '/history', params, { signal });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ export function ArchiveView({
|
|||||||
|
|
||||||
{selectedTags.length ? (
|
{selectedTags.length ? (
|
||||||
<HistoryChart
|
<HistoryChart
|
||||||
key={`${range.from}:${range.to}:${selectedTags.join(',')}`}
|
key={`${range.from}:${range.to}:${historyAxis.granulate}`}
|
||||||
edge={edgeId}
|
edge={edgeId}
|
||||||
from={fromIso}
|
from={fromIso}
|
||||||
to={toIso}
|
to={toIso}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export function useHistoryChartQueries({
|
|||||||
const queries = useQueries({
|
const queries = useQueries({
|
||||||
queries: tags.map((tag) => ({
|
queries: tags.map((tag) => ({
|
||||||
queryKey: ['history', edge, tag, from, to, granulate],
|
queryKey: ['history', edge, tag, from, to, granulate],
|
||||||
queryFn: () => getHistory({ edge, tag, from, to, granulate }),
|
queryFn: ({ signal }: { signal: AbortSignal }) => getHistory({ edge, tag, from, to, granulate }, signal),
|
||||||
enabled,
|
enabled,
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user