From 8250f361df2d1ea95b84dddeaacecf12811fbd4d Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 17 Apr 2021 14:07:53 +0300 Subject: [PATCH] fix --- .env | 4 +++- src/features/machines/api.js | 6 +++--- src/features/machines/components/MachineItem.js | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 31d922b..f54b1e9 100644 --- a/.env +++ b/.env @@ -2,4 +2,6 @@ REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password} REACT_APP_NETWORK_RESURRECTOR_API_URL=http://localhost:5064 -REACT_APP_NETWORK_RESURRECTOR_SERVER_URL=http://localhost:5062 \ No newline at end of file +#REACT_APP_NETWORK_RESURRECTOR_SERVER_URL=http://localhost:5062 + +REACT_APP_NETWORK_RESURRECTOR_SERVER_URL=https://toodle.ddns.net/network-resurrector-api \ No newline at end of file diff --git a/src/features/machines/api.js b/src/features/machines/api.js index 2f73eb5..be062d7 100644 --- a/src/features/machines/api.js +++ b/src/features/machines/api.js @@ -1,4 +1,4 @@ -import { get } from "../../utils/axios"; +import { get, post } from "../../utils/axios"; const apiUrl = `${process.env.REACT_APP_NETWORK_RESURRECTOR_API_URL}/network`; const serverUrl = `${process.env.REACT_APP_NETWORK_RESURRECTOR_SERVER_URL}/resurrector`; @@ -9,12 +9,12 @@ const readMachines = () => { }; const wakeMachine = macAddress => { - const promise = get(`${serverUrl}/wake`, { macAddress }); + const promise = post(`${serverUrl}/wake`, { macAddress }); return promise; }; const pingMachine = ipAddressOrMachineName => { - const promise = get(`${serverUrl}/ping`, { ipAddressOrMachineName }); + const promise = post(`${serverUrl}/ping`, { ipAddressOrMachineName }); return promise; }; diff --git a/src/features/machines/components/MachineItem.js b/src/features/machines/components/MachineItem.js index 2e924b6..1bc8a8a 100644 --- a/src/features/machines/components/MachineItem.js +++ b/src/features/machines/components/MachineItem.js @@ -45,7 +45,10 @@ const MachineItem = ({ machine, actions }) => { <> {actions.map(action => ( - +