From 35e71b95369eb3948245fea7731589ac5d675c24 Mon Sep 17 00:00:00 2001 From: Cesar <26280794+csrapr@users.noreply.github.com> Date: Wed, 25 Nov 2020 19:00:50 +0000 Subject: [PATCH] feat: Add restart services button in machine admin actions --- .../pages/Maintenance/MachineDetailsCard.js | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.js b/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.js index d04dc8fa..f755dd3f 100644 --- a/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.js +++ b/new-lamassu-admin/src/pages/Maintenance/MachineDetailsCard.js @@ -128,19 +128,19 @@ const MachineDetailsRow = ({ it: machine, onActionSuccess }) => { /> { setErrorMessage(null) machineAction({ variables: { deviceId: machine.deviceId, - action: `${action?.command}`.toLowerCase(), - ...(action?.command === 'Rename' && { newName: value }) + action: `${action?.command}`, + ...(action?.command === 'rename' && { newName: value }) } }) }} @@ -174,7 +174,8 @@ const MachineDetailsRow = ({ it: machine, onActionSuccess }) => { InverseIcon={EditReversedIcon} onClick={() => setAction({ - command: 'Rename', + command: 'rename', + humanReadable: 'Rename', confirmationMessage: 'Write the new name for this machine' }) }> @@ -188,7 +189,8 @@ const MachineDetailsRow = ({ it: machine, onActionSuccess }) => { disabled={loading} onClick={() => setAction({ - command: 'Unpair' + command: 'unpair', + humanReadable: 'Unpair' }) }> Unpair @@ -201,26 +203,42 @@ const MachineDetailsRow = ({ it: machine, onActionSuccess }) => { disabled={loading} onClick={() => setAction({ - command: 'Reboot' + command: 'reboot', + humanReadable: 'Reboot' }) }> Reboot setAction({ - command: 'Shutdown', + command: 'shutdown', + humanReadable: 'Shutdown', message: 'In order to bring it back online, the machine will need to be visited and its power reset.' }) }> Shutdown + + setAction({ + command: 'restartServices', + humanReadable: 'Restart services for' + }) + }> + Restart Services +