pull/516/head
Andrey Dolgolev 2022-01-12 10:50:53 +02:00
rodzic c1a5d607c9
commit 098c4de6e8
5 zmienionych plików z 21 dodań i 26 usunięć

Wyświetl plik

@ -156,7 +156,11 @@ async def status_handler(
presigned_urls_response[subscription.id][timescale] = {
"url": stats_presigned_url,
"headers": {"If-Modified-Since": object["LastModified"]},
"headers": {
"If-Modified-Since": (
object["LastModified"] + timedelta(seconds=1)
).strftime("%c")
},
}
except Exception as err:
logger.warning(

Wyświetl plik

@ -88,7 +88,7 @@ const Analytics = () => {
const plotMinW = "250px";
const referesh_charts = () => {
const refereshCharts = () => {
refreshDashboard.mutate({
dashboardId: dashboardCache.data.id,
timeRange: timeRange,
@ -164,7 +164,7 @@ const Analytics = () => {
colorScheme="green"
size="sm"
onClick={() => {
referesh_charts();
refereshCharts();
}}
/>
</Stack>

Wyświetl plik

@ -58,8 +58,7 @@ const SubscriptionReport = ({
[data]
);
if ((failureCount < 1 && (!data || isLoading)) || isFetching)
return <Spinner />;
if (failureCount < 1 && (!data || isLoading)) return <Spinner />;
if (failureCount >= 1 && (!data || isLoading)) {
return (
<Container
@ -105,9 +104,7 @@ const SubscriptionReport = ({
direction="column"
>
<Text fontSize="xs" textAlign="right">{`Latest block number: ${
data?.blocks_state?.latest_labelled_block != undefined
? data?.blocks_state?.latest_labelled_block
: "Not available"
data?.blocks_state?.latest_labelled_block ?? "Not available"
}`}</Text>
<Flex
bgColor="blue.50"

Wyświetl plik

@ -122,25 +122,19 @@ const useDashboard = (dashboardId) => {
const refreshDashboard = useMutation(DashboardService.refreshDashboard, {
onSuccess: (data) => {
let newData = {};
let oldData = queryClient.getQueryData([
"dashboardLinks",
{ dashboardId: dashboardId },
]);
newData = oldData;
Object.keys(data.data).map((subscription) => {
Object.keys(data.data[subscription]).map((timeScale) => {
newData.data[subscription][timeScale] =
data.data[subscription][timeScale];
});
});
queryClient.setQueryData(
["dashboardLinks", { dashboardId: dashboardId }],
newData
(oldData) => {
let newData = { ...oldData };
Object.keys(data.data).forEach((subscription) => {
Object.keys(data.data[subscription]).forEach((timeScale) => {
newData.data[subscription][timeScale] =
data.data[subscription][timeScale];
});
});
return newData;
}
);
},
onError: (error) => {

Wyświetl plik

@ -23,7 +23,7 @@ const usePresignedURL = ({
method: "GET",
};
if (headers != undefined) {
if (headers) {
Object.keys(headers).map((key) => {
request_parameters["headers"][key] = headers[key];
});