From dcc2cd66e42a309c4768a550fe46fe6cd63d0253 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Tue, 27 Apr 2021 19:34:05 +0800 Subject: [PATCH] Fix #1171: Display camera error message in UI when testing connection (#1173) --- .../routes/integration/all/rtsp-camera/RtspCameraBox.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/front/src/routes/integration/all/rtsp-camera/RtspCameraBox.jsx b/front/src/routes/integration/all/rtsp-camera/RtspCameraBox.jsx index 3f5fb3ce99..eeec7fad15 100644 --- a/front/src/routes/integration/all/rtsp-camera/RtspCameraBox.jsx +++ b/front/src/routes/integration/all/rtsp-camera/RtspCameraBox.jsx @@ -46,11 +46,13 @@ class RtspCameraBox extends Component { try { await this.props.testConnection(this.props.cameraIndex); this.setState({ - testConnectionError: null + testConnectionError: null, + testConnectionErrorMessage: null }); } catch (e) { this.setState({ - testConnectionError: RequestStatus.Error + testConnectionError: RequestStatus.Error, + testConnectionErrorMessage: get(e, 'response.data.error') }); } this.setState({ @@ -72,7 +74,7 @@ class RtspCameraBox extends Component { }; componentWillMount() {} - render(props, { loading, saveError, testConnectionError }) { + render(props, { loading, saveError, testConnectionError, testConnectionErrorMessage }) { return (
@@ -97,6 +99,7 @@ class RtspCameraBox extends Component {
)} + {testConnectionErrorMessage &&
{testConnectionErrorMessage}
}