You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uptime-kuma/server/model/maintenance.js

41 lines
1011 B

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 {
/**
2 years ago
* Return an object that ready to parse to JSON for public
* Only show necessary data to public
2 years ago
* @returns {Object}
*/
async toPublicJSON() {
return {
id: this.id,
title: this.title,
description: this.description,
start_date: this.start_date,
end_date: this.end_date,
};
}
/**
2 years ago
* Return an object that ready to parse to JSON
* @returns {Object}
*/
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;