mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-21 14:08:53 -04:00
add telegram notification
This commit is contained in:
parent
04ec91d7a9
commit
3bdf174e90
11 changed files with 418 additions and 85 deletions
|
@ -1,5 +1,6 @@
|
|||
const tcpp = require('tcp-ping');
|
||||
const Ping = require("./ping-lite");
|
||||
const {R} = require("redbean-node");
|
||||
|
||||
exports.tcping = function (hostname, port) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -37,3 +38,25 @@ exports.ping = function (hostname) {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
exports.setting = async function (key) {
|
||||
return await R.getCell("SELECT `value` FROM setting WHERE `key` = ? ", [
|
||||
key
|
||||
])
|
||||
}
|
||||
|
||||
exports.getSettings = async function (type) {
|
||||
let list = await R.getAll("SELECT * FROM setting WHERE `type` = ? ", [
|
||||
type
|
||||
])
|
||||
|
||||
let result = {};
|
||||
|
||||
for (let row of list) {
|
||||
result[row.key] = row.value;
|
||||
}
|
||||
|
||||
console.log(result)
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue