diff --git a/package.json b/package.json index e4bff7c..fcc367b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react_test": "react-scripts test", "eject": "react-scripts eject" }, - "proxy": "http://0.0.0.0:5000", + "proxy": "http://192.168.1.70:5000", "eslintConfig": { "extends": [ "react-app", diff --git a/src/pages/Report.jsx b/src/pages/Report.jsx index dfd8efb..bc3e481 100644 --- a/src/pages/Report.jsx +++ b/src/pages/Report.jsx @@ -111,7 +111,24 @@ export default function Report(props) { try { let approxPagesResponse = await ReportService.getReportSize(wellId, step, format, begin, end) setPagesCount(approxPagesResponse) + } catch(error) { + notify(`Не удалось получить предварительный размер отчета c + ${rangeDate[0].format("DD.MM.YYYY hh:mm:ss")} по + ${rangeDate[1].format("DD.MM.YYYY hh:mm:ss")}`, 'error') + console.error(error) + } finally { + setLoader(false) + } + } + getRepostSizeAsync() + },[rangeDate, step, format]) + + useEffect(()=>{ + async function getSuitableReportsAsync() { + let begin = rangeDate[0].toISOString() + let end = rangeDate[1].toISOString() + try { setLoader(true) let suitableReportsResponse = await ReportService.getSuitableReportsNames(wellId, step, format, begin, end) let suitableReports = suitableReportsResponse.map(value => { @@ -127,7 +144,7 @@ export default function Report(props) { }) setSuitableReports(suitableReports) } catch(error) { - notify(`Не удалось загрузить данные по скважине (${wellId}) c + notify(`Не удалось получить подходящие по параметрам отчеты c ${rangeDate[0].format("DD.MM.YYYY hh:mm:ss")} по ${rangeDate[1].format("DD.MM.YYYY hh:mm:ss")}`, 'error') console.error(error) @@ -136,7 +153,7 @@ export default function Report(props) { } } - getRepostSizeAsync() + getSuitableReportsAsync() },[rangeDate, step, format]) useEffect(()=>{ diff --git a/src/services/signalr/index.ts b/src/services/signalr/index.ts index 1e4a66a..02aad65 100644 --- a/src/services/signalr/index.ts +++ b/src/services/signalr/index.ts @@ -14,12 +14,12 @@ type ConnectionsDict = { const Connections: ConnectionsDict = { 'hubs/telemetry': new HubConnectionBuilder() - .withUrl(`http://localhost:5000/hubs/telemetry`, ConnectionOptions) + .withUrl(`http://192.168.1.70:5000/hubs/telemetry`, ConnectionOptions) .withAutomaticReconnect() .build(), 'hubs/reports': new HubConnectionBuilder() - .withUrl(`http://localhost:5000/hubs/reports`, ConnectionOptions) + .withUrl(`http://192.168.1.70:5000/hubs/reports`, ConnectionOptions) .withAutomaticReconnect() .build() }