mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-31 01:24:42 +02:00
🩹 Renames success to successStatus
This commit is contained in:
parent
d298516070
commit
cefe56c0be
@ -22,9 +22,9 @@ const makePing = (ip, render) => {
|
|||||||
session.pingHost(ip, (error, target) => {
|
session.pingHost(ip, (error, target) => {
|
||||||
const timeTaken = (new Date() - startTime);
|
const timeTaken = (new Date() - startTime);
|
||||||
if (error) {
|
if (error) {
|
||||||
render(JSON.stringify({ success: false, message: `❌ ${error}` }));
|
render(JSON.stringify({ successStatus: false, message: `❌ ${error}` }));
|
||||||
} else {
|
} else {
|
||||||
render(JSON.stringify({ success: true, message: `✅ ${target} is Alive\n⏱️ Took ${timeTaken} ms` }));
|
render(JSON.stringify({ successStatus: true, message: `✅ ${target} is Alive\n⏱️ Took ${timeTaken} ms` }));
|
||||||
}
|
}
|
||||||
session.close();
|
session.close();
|
||||||
});
|
});
|
||||||
@ -33,7 +33,7 @@ const makePing = (ip, render) => {
|
|||||||
/* Checks if a given IP address is online, and accessible */
|
/* Checks if a given IP address is online, and accessible */
|
||||||
module.exports = (paramStr, render) => {
|
module.exports = (paramStr, render) => {
|
||||||
if (!paramStr || !paramStr.includes('ip=')) {
|
if (!paramStr || !paramStr.includes('ip=')) {
|
||||||
render(JSON.stringify({ success: false, message: '❌ Malformed or Missing IP' }));
|
render(JSON.stringify({ successStatus: false, message: '❌ Malformed or Missing IP' }));
|
||||||
} else {
|
} else {
|
||||||
// Prepare the parameters, which are got from the URL
|
// Prepare the parameters, which are got from the URL
|
||||||
const ip = decodeURIComponent((new URLSearchParams(paramStr)).get('ip'));
|
const ip = decodeURIComponent((new URLSearchParams(paramStr)).get('ip'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user