mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
41 lines
1011 B
JavaScript
41 lines
1011 B
JavaScript
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 an object that ready to parse to JSON for public
|
|
* Only show necessary data to public
|
|
* @returns {Object}
|
|
*/
|
|
async toPublicJSON() {
|
|
return {
|
|
id: this.id,
|
|
title: this.title,
|
|
description: this.description,
|
|
start_date: this.start_date,
|
|
end_date: this.end_date,
|
|
};
|
|
}
|
|
|
|
/**
|
|
* 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;
|