Switch CDN, update dependencies

This commit is contained in:
Piotr Rogowski 2022-02-23 22:59:53 +01:00
parent 881fe31793
commit 58773f4e0f
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
3 changed files with 7 additions and 12 deletions

View File

@ -37,7 +37,7 @@
"@sentry/tracing": "^6.17.9", "@sentry/tracing": "^6.17.9",
"@speedy-tuner/ini": "^0.3.0", "@speedy-tuner/ini": "^0.3.0",
"@speedy-tuner/types": "^0.3.0", "@speedy-tuner/types": "^0.3.0",
"antd": "^4.18.7", "antd": "^4.18.8",
"craco-less": "^2.0.0", "craco-less": "^2.0.0",
"firebase": "^9.6.7", "firebase": "^9.6.7",
"kbar": "^0.1.0-beta.27", "kbar": "^0.1.0-beta.27",
@ -57,7 +57,7 @@
"devDependencies": { "devDependencies": {
"@craco/craco": "^7.0.0-7.0.0-alpha.2.0", "@craco/craco": "^7.0.0-7.0.0-alpha.2.0",
"@speedy-tuner/eslint-config": "^0.1.3", "@speedy-tuner/eslint-config": "^0.1.3",
"@types/node": "^17.0.18", "@types/node": "^17.0.19",
"@types/pako": "^1.0.3", "@types/pako": "^1.0.3",
"@types/react": "^17.0.39", "@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11", "@types/react-dom": "^17.0.11",

View File

@ -12,7 +12,7 @@ import {
const PUBLIC_PATH = 'public'; const PUBLIC_PATH = 'public';
const USERS_PATH = `${PUBLIC_PATH}/users`; const USERS_PATH = `${PUBLIC_PATH}/users`;
const INI_PATH = `${PUBLIC_PATH}/ini`; const INI_PATH = `${PUBLIC_PATH}/ini`;
const CDN_URL = process.env.REACT_APP_CDN_URL; export const CDN_URL = process.env.REACT_APP_CDN_URL;
const storage = getStorage(); const storage = getStorage();

View File

@ -10,7 +10,7 @@ import {
} from './http'; } from './http';
import TuneParser from './tune/TuneParser'; import TuneParser from './tune/TuneParser';
import { TuneDbData } from '../types/dbData'; import { TuneDbData } from '../types/dbData';
import useServerStorage from '../hooks/useServerStorage'; import useServerStorage, { CDN_URL } from '../hooks/useServerStorage';
export const loadTune = async (tuneData: TuneDbData) => { export const loadTune = async (tuneData: TuneDbData) => {
// eslint-disable-next-line react-hooks/rules-of-hooks // eslint-disable-next-line react-hooks/rules-of-hooks
@ -51,26 +51,21 @@ export const loadTune = async (tuneData: TuneDbData) => {
export const loadLogs = (onProgress?: onProgressType, signal?: AbortSignal) => export const loadLogs = (onProgress?: onProgressType, signal?: AbortSignal) =>
fetchWithProgress( fetchWithProgress(
// 'https://speedytuner-cloud.s3.eu-west-2.amazonaws.com/logs/longest.mlg.gz', `${CDN_URL}/public/temp/long.mlg.gz`,
// 'https://d29mjpbgm6k6md.cloudfront.net/logs/longest.mlg.gz',
'https://d29mjpbgm6k6md.cloudfront.net/logs/middle.mlg.gz',
// 'https://d29mjpbgm6k6md.cloudfront.net/logs/markers.mlg.gz',
onProgress, onProgress,
signal, signal,
).then((response) => response); ).then((response) => response);
export const loadCompositeLogs = (onProgress?: onProgressType, signal?: AbortSignal) => export const loadCompositeLogs = (onProgress?: onProgressType, signal?: AbortSignal) =>
fetchWithProgress( fetchWithProgress(
'https://d29mjpbgm6k6md.cloudfront.net/trigger-logs/composite_1_2.csv.gz', `${CDN_URL}/public/temp/composite_1.csv.gz`,
// 'https://d29mjpbgm6k6md.cloudfront.net/trigger-logs/composite_miata.csv.gz',
// 'https://d29mjpbgm6k6md.cloudfront.net/trigger-logs/2.csv.gz',
onProgress, onProgress,
signal, signal,
).then((response) => response); ).then((response) => response);
export const loadToothLogs = (onProgress?: onProgressType, signal?: AbortSignal) => export const loadToothLogs = (onProgress?: onProgressType, signal?: AbortSignal) =>
fetchWithProgress( fetchWithProgress(
'https://d29mjpbgm6k6md.cloudfront.net/trigger-logs/tooth_3.csv.gz', `${CDN_URL}/public/temp/tooth_3.csv.gz`,
onProgress, onProgress,
signal, signal,
).then((response) => response); ).then((response) => response);