remove used vars

This commit is contained in:
LouisLam 2021-07-22 11:15:53 +08:00
parent 916b9da0dc
commit 7e4a1ad279

View File

@ -72,7 +72,7 @@ class Notification {
finalData = data; finalData = data;
} }
let res = await axios.post(notification.webhookURL, finalData, config) await axios.post(notification.webhookURL, finalData, config)
return okMsg; return okMsg;
} catch (error) { } catch (error) {
@ -90,7 +90,7 @@ class Notification {
username: 'Uptime-Kuma', username: 'Uptime-Kuma',
content: msg content: msg
} }
let res = await axios.post(notification.discordWebhookUrl, data) await axios.post(notification.discordWebhookUrl, data)
return okMsg; return okMsg;
} }
// If heartbeatJSON is not null, we go into the normal alerting loop. // If heartbeatJSON is not null, we go into the normal alerting loop.
@ -116,7 +116,7 @@ class Notification {
] ]
}] }]
} }
let res = await axios.post(notification.discordWebhookUrl, data) await axios.post(notification.discordWebhookUrl, data)
return okMsg; return okMsg;
} catch(error) { } catch(error) {
throwGeneralAxiosError(error) throwGeneralAxiosError(error)
@ -131,7 +131,7 @@ class Notification {
}; };
let config = {}; let config = {};
let res = await axios.post(notification.signalURL, data, config) await axios.post(notification.signalURL, data, config)
return okMsg; return okMsg;
} catch (error) { } catch (error) {
throwGeneralAxiosError(error) throwGeneralAxiosError(error)
@ -141,7 +141,7 @@ class Notification {
try { try {
if (heartbeatJSON == null) { if (heartbeatJSON == null) {
let data = {'text': "Uptime Kuma Slack testing successful.", 'channel': notification.slackchannel, 'username': notification.slackusername, 'icon_emoji': notification.slackiconemo} let data = {'text': "Uptime Kuma Slack testing successful.", 'channel': notification.slackchannel, 'username': notification.slackusername, 'icon_emoji': notification.slackiconemo}
let res = await axios.post(notification.slackwebhookURL, data) await axios.post(notification.slackwebhookURL, data)
return okMsg; return okMsg;
} }
@ -186,7 +186,7 @@ class Notification {
} }
] ]
} }
let res = await axios.post(notification.slackwebhookURL, data) await axios.post(notification.slackwebhookURL, data)
return okMsg; return okMsg;
} catch (error) { } catch (error) {
throwGeneralAxiosError(error) throwGeneralAxiosError(error)
@ -199,7 +199,7 @@ class Notification {
let data = {'message': "<b>Uptime Kuma Pushover testing successful.</b>", let data = {'message': "<b>Uptime Kuma Pushover testing successful.</b>",
'user': notification.pushoveruserkey, 'token': notification.pushoverapptoken, 'sound':notification.pushoversounds, 'user': notification.pushoveruserkey, 'token': notification.pushoverapptoken, 'sound':notification.pushoversounds,
'priority': notification.pushoverpriority, 'title':notification.pushovertitle, 'retry': "30", 'expire':"3600", 'html': 1} 'priority': notification.pushoverpriority, 'title':notification.pushovertitle, 'retry': "30", 'expire':"3600", 'html': 1}
let res = await axios.post(pushoverlink, data) await axios.post(pushoverlink, data)
return okMsg; return okMsg;
} }
@ -214,7 +214,7 @@ class Notification {
"expire": "3600", "expire": "3600",
"html": 1 "html": 1
} }
let res = await axios.post(pushoverlink, data) await axios.post(pushoverlink, data)
return okMsg; return okMsg;
} catch (error) { } catch (error) {
throwGeneralAxiosError(error) throwGeneralAxiosError(error)