Update to uptime kuma 1.13.1
This commit is contained in:
parent
fffaecb693
commit
810d8a0293
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "uptimekuma-api",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "",
|
||||
"main": "src/index.js",
|
||||
"types": "src/index.d.ts",
|
||||
|
|
2
src/index.d.ts
vendored
2
src/index.d.ts
vendored
|
@ -8,7 +8,7 @@ export default class UptimeKumaApi {
|
|||
on(event: "pushSuccessful", handle: (url: string) => void);
|
||||
on(event: "pushFailed", handle: (url: string, err: Error) => void);
|
||||
|
||||
status(): Promise<[{
|
||||
status(name?:string): Promise<[{
|
||||
id: number,
|
||||
name: string,
|
||||
weight: number, monitors: [{
|
||||
|
|
|
@ -33,11 +33,11 @@ module.exports = class UptimeKumaApi extends EventEmitter {
|
|||
this._pushTimer.cancel();
|
||||
}
|
||||
|
||||
async status() {
|
||||
let resp = await client.get(this._baseURL + "api/status-page/monitor-list");
|
||||
let heartBeats = (await client.get(this._baseURL + "api/status-page/heartbeat")).data;
|
||||
async status(name = "default") {
|
||||
let resp = await client.get(this._baseURL + "api/status-page/"+name);
|
||||
let heartBeats = (await client.get(this._baseURL + "api/status-page/heartbeat/"+name)).data;
|
||||
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: []};
|
||||
for (let srcMonitor of srcCategory.monitorList) {
|
||||
targetCategory.monitors.push({
|
||||
|
|
Loading…
Reference in a new issue