Update to uptime kuma 1.13.1

This commit is contained in:
Ilya 2022-03-25 21:12:54 +03:00
parent fffaecb693
commit 810d8a0293
3 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "uptimekuma-api", "name": "uptimekuma-api",
"version": "1.0.2", "version": "1.0.3",
"description": "", "description": "",
"main": "src/index.js", "main": "src/index.js",
"types": "src/index.d.ts", "types": "src/index.d.ts",

2
src/index.d.ts vendored
View file

@ -8,7 +8,7 @@ export default class UptimeKumaApi {
on(event: "pushSuccessful", handle: (url: string) => void); on(event: "pushSuccessful", handle: (url: string) => void);
on(event: "pushFailed", handle: (url: string, err: Error) => void); on(event: "pushFailed", handle: (url: string, err: Error) => void);
status(): Promise<[{ status(name?:string): Promise<[{
id: number, id: number,
name: string, name: string,
weight: number, monitors: [{ weight: number, monitors: [{

View file

@ -33,11 +33,11 @@ module.exports = class UptimeKumaApi extends EventEmitter {
this._pushTimer.cancel(); this._pushTimer.cancel();
} }
async status() { async status(name = "default") {
let resp = await client.get(this._baseURL + "api/status-page/monitor-list"); let resp = await client.get(this._baseURL + "api/status-page/"+name);
let heartBeats = (await client.get(this._baseURL + "api/status-page/heartbeat")).data; let heartBeats = (await client.get(this._baseURL + "api/status-page/heartbeat/"+name)).data;
let result = []; let result = [];
for (let srcCategory of resp.data) { for (let srcCategory of resp.data.publicGroupList) {
let targetCategory = {id: srcCategory.id, name: srcCategory.name, weight: srcCategory.weight, monitors: []}; let targetCategory = {id: srcCategory.id, name: srcCategory.name, weight: srcCategory.weight, monitors: []};
for (let srcMonitor of srcCategory.monitorList) { for (let srcMonitor of srcCategory.monitorList) {
targetCategory.monitors.push({ targetCategory.monitors.push({