mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-24 07:21:09 -04:00
A complete maintenance planning system has been created
This commit is contained in:
parent
c3c4db52ec
commit
0d3414c6d6
32 changed files with 1121 additions and 51 deletions
38
server/model/maintenance.js
Normal file
38
server/model/maintenance.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
const dayjs = require("dayjs");
|
||||
const utc = require("dayjs/plugin/utc");
|
||||
let timezone = require("dayjs/plugin/timezone");
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
const { BeanModel } = require("redbean-node/dist/bean-model");
|
||||
|
||||
class Maintenance extends BeanModel {
|
||||
|
||||
/**
|
||||
* Return a object that ready to parse to JSON for public
|
||||
* Only show necessary data to public
|
||||
*/
|
||||
async toPublicJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
start_date: this.start_date,
|
||||
end_date: this.end_date
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a object that ready to parse to JSON
|
||||
*/
|
||||
async toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
title: this.title,
|
||||
description: this.description,
|
||||
start_date: this.start_date,
|
||||
end_date: this.end_date
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Maintenance;
|
Loading…
Add table
Add a link
Reference in a new issue