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 = () => ( const TheFooter = () => (
<CFooter fixed={false}> <CFooter fixed={false}>
<div> <div>
Version 0.0.2 Version 0.0.3
</div> </div>
<div className="mfs-auto"> <div className="mfs-auto">
<span className="mr-1">Powered by</span> <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 'react-widgets/styles.css';
import { getToken } from '../../utils/authHelper'; import { getToken } from '../../utils/authHelper';
import axiosInstance from '../../utils/axiosInstance'; import axiosInstance from '../../utils/axiosInstance';
import eventBus from '../../utils/EventBus';
const ActionModal = ({ show, toggleModal, title, directions, action }) => { const ActionModal = ({ show, toggleModal, title, directions, action }) => {
const [hadSuccess, setHadSuccess] = useState(false); const [hadSuccess, setHadSuccess] = useState(false);
@@ -104,6 +105,7 @@ const ActionModal = ({ show, toggleModal, title, directions, action }) => {
setDoingNow(false); setDoingNow(false);
setCheckingIfSure(false); setCheckingIfSure(false);
setWaiting(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 'react-widgets/styles.css';
import { getToken } from '../../utils/authHelper'; import { getToken } from '../../utils/authHelper';
import axiosInstance from '../../utils/axiosInstance'; import axiosInstance from '../../utils/axiosInstance';
import eventBus from '../../utils/EventBus';
const BlinkModal = ({ show, toggleModal }) => { const BlinkModal = ({ show, toggleModal }) => {
const [hadSuccess, setHadSuccess] = useState(false); const [hadSuccess, setHadSuccess] = useState(false);
@@ -101,6 +102,7 @@ const BlinkModal = ({ show, toggleModal }) => {
setDoingNow(false); setDoingNow(false);
setCheckingIfSure(false); setCheckingIfSure(false);
setWaiting(false); setWaiting(false);
eventBus.dispatch('actionCompleted', { message: 'An action has been completed' });
}); });
}; };

View File

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

View File

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