From 590a00ef8fdb6c89645b2f80a0898ebfbd0f6df9 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Fri, 4 Jun 2021 10:13:40 +0500 Subject: [PATCH] =?UTF-8?q?CF2-8:=20Hotfix.=20=D0=98=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20IP=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/pages/Report.jsx | 21 +++++++++++++++++++-- src/services/signalr/index.ts | 4 ++-- 3 files changed, 22 insertions(+), 5 deletions(-) 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() }