+ {state === STATES.INITIAL && (
+
+
Loading...
+
+ )}
+
+ {state === STATES.EMPTY && (
+
+
No diagnostics available
+
Run diagnostics to generate a report
+
+ )}
+
+ {state === STATES.RUNNING && (
+
+
Running Diagnostics...
+
This page should refresh automatically
+
+ )}
+
+ {state === STATES.FAILURE && (
+
+
Failed to run diagnostics
+
Please try again. If the problem persists, contact support.
+
+ )}
+
+ {state === STATES.FILLED && (
+
+
+
+
Scan
+

+
+
+
Front
+

+
+
+
+
+
Diagnostics executed at: {timestamp}
+
+
+ )}
+
+
+
+
+
+ )
+}
+
+export default DiagnosticsModal
diff --git a/new-lamassu-admin/src/components/machineActions/MachineActions.js b/new-lamassu-admin/src/components/machineActions/MachineActions.js
index 65cc73a1..d9ede4f1 100644
--- a/new-lamassu-admin/src/components/machineActions/MachineActions.js
+++ b/new-lamassu-admin/src/components/machineActions/MachineActions.js
@@ -15,6 +15,7 @@ import { ReactComponent as ShutdownIcon } from 'src/styling/icons/button/shut do
import { ReactComponent as UnpairReversedIcon } from 'src/styling/icons/button/unpair/white.svg'
import { ReactComponent as UnpairIcon } from 'src/styling/icons/button/unpair/zodiac.svg'
+import DiagnosticsModal from './DiagnosticsModal'
import { machineActionsStyles } from './MachineActions.styles'
const useStyles = makeStyles(machineActionsStyles)
@@ -66,6 +67,7 @@ const getState = machineEventsLazy =>
const MachineActions = memo(({ machine, onActionSuccess }) => {
const [action, setAction] = useState({ command: null })
const [preflightOptions, setPreflightOptions] = useState({})
+ const [showModal, setShowModal] = useState(false)
const [errorMessage, setErrorMessage] = useState(null)
const classes = useStyles()
@@ -81,6 +83,8 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {
preflightOptions
)
+ const [simpleMachineAction] = useMutation(MACHINE_ACTION)
+
const [machineAction, { loading }] = useMutation(MACHINE_ACTION, {
onError: ({ message }) => {
const errorMessage = message ?? 'An error ocurred'
@@ -188,7 +192,7 @@ const MachineActions = memo(({ machine, onActionSuccess }) => {
{machine.model === 'aveiro' && (