mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-14 13:24:47 +00:00
Adds http_code to heartbeatJSON
This commit is contained in:
parent
af34e861c5
commit
82dd4cec96
1 changed files with 5 additions and 1 deletions
|
@ -131,6 +131,7 @@ class Monitor extends BeanModel {
|
||||||
});
|
});
|
||||||
bean.msg = `${res.status} - ${res.statusText}`
|
bean.msg = `${res.status} - ${res.statusText}`
|
||||||
bean.ping = dayjs().valueOf() - startTime;
|
bean.ping = dayjs().valueOf() - startTime;
|
||||||
|
bean.http_code = `${res.status}`
|
||||||
|
|
||||||
// Check certificate if https is used
|
// Check certificate if https is used
|
||||||
|
|
||||||
|
@ -189,9 +190,12 @@ class Monitor extends BeanModel {
|
||||||
retries = 0;
|
retries = 0;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
bean.msg = error.message;
|
bean.msg = error.message;
|
||||||
|
|
||||||
|
if (error.response) {
|
||||||
|
bean.http_code = error.response.status;
|
||||||
|
}
|
||||||
|
|
||||||
// If UP come in here, it must be upside down mode
|
// If UP come in here, it must be upside down mode
|
||||||
// Just reset the retries
|
// Just reset the retries
|
||||||
if (this.isUpsideDown() && bean.status === UP) {
|
if (this.isUpsideDown() && bean.status === UP) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue