Merge pull request #36 from stephb9959/main

Merge master into feature/32-statistics
This commit is contained in:
Charles
2021-05-29 11:56:06 -04:00
committed by GitHub
6 changed files with 10 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ import { CFooter } from '@coreui/react';
const TheFooter = () => (
<CFooter fixed={false}>
<div>
Version 0.0.2
Version 0.0.3
</div>
<div className="mfs-auto">
<span className="mr-1">Powered by</span>

View File

@@ -18,6 +18,7 @@ import { convertDateToUtc, convertDateFromUtc, dateToUnix } from '../../utils/he
import 'react-widgets/styles.css';
import { getToken } from '../../utils/authHelper';
import axiosInstance from '../../utils/axiosInstance';
import eventBus from '../../utils/EventBus';
const ActionModal = ({ show, toggleModal, title, directions, action }) => {
const [hadSuccess, setHadSuccess] = useState(false);
@@ -104,6 +105,7 @@ const ActionModal = ({ show, toggleModal, title, directions, action }) => {
setDoingNow(false);
setCheckingIfSure(false);
setWaiting(false);
eventBus.dispatch('actionCompleted', { message: 'An action has been completed' });
});
};

View File

@@ -21,6 +21,7 @@ import { convertDateFromUtc, convertDateToUtc, dateToUnix } from '../../utils/he
import 'react-widgets/styles.css';
import { getToken } from '../../utils/authHelper';
import axiosInstance from '../../utils/axiosInstance';
import eventBus from '../../utils/EventBus';
const BlinkModal = ({ show, toggleModal }) => {
const [hadSuccess, setHadSuccess] = useState(false);
@@ -101,6 +102,7 @@ const BlinkModal = ({ show, toggleModal }) => {
setDoingNow(false);
setCheckingIfSure(false);
setWaiting(false);
eventBus.dispatch('actionCompleted', { message: 'An action has been completed' });
});
};

View File

@@ -193,7 +193,7 @@ const DeviceCommands = ({ selectedDeviceId }) => {
}, [selectedDeviceId, start, end]);
useEffect(() => {
eventBus.on('actionCompleted', () => getCommands());
eventBus.on('actionCompleted', () => refreshCommands());
return () => {
eventBus.remove('actionCompleted');

View File

@@ -19,6 +19,7 @@ import { convertDateToUtc, convertDateFromUtc, dateToUnix } from '../../utils/he
import 'react-widgets/styles.css';
import { getToken } from '../../utils/authHelper';
import axiosInstance from '../../utils/axiosInstance';
import eventBus from '../../utils/EventBus';
const FirmwareUpgradeModal = ({ show, toggleModal }) => {
const [hadSuccess, setHadSuccess] = useState(false);
@@ -126,6 +127,7 @@ const FirmwareUpgradeModal = ({ show, toggleModal }) => {
setDoingNow(false);
setCheckingIfSure(false);
setWaiting(false);
eventBus.dispatch('actionCompleted', { message: 'An action has been completed' });
});
};

View File

@@ -20,6 +20,7 @@ import { convertDateToUtc, dateToUnix } from '../../utils/helper';
import 'react-widgets/styles.css';
import { getToken } from '../../utils/authHelper';
import axiosInstance from '../../utils/axiosInstance';
import eventBus from '../../utils/EventBus';
const TraceModal = ({ show, toggleModal }) => {
const [hadSuccess, setHadSuccess] = useState(false);
@@ -100,6 +101,7 @@ const TraceModal = ({ show, toggleModal }) => {
.finally(() => {
setCheckingIfSure(false);
setWaiting(false);
eventBus.dispatch('actionCompleted', { message: 'An action has been completed' });
});
};