Merge branch 'master' into public-dashboard

# Conflicts:
#	src/components/MonitorList.vue
#	src/icon.js
This commit is contained in:
LouisLam
2021-09-14 15:05:04 +08:00
12 changed files with 873 additions and 28 deletions

View File

@@ -45,6 +45,8 @@ class Monitor extends BeanModel {
notificationIDList[bean.notification_id] = true;
}
const tags = await R.getAll("SELECT mt.*, tag.name, tag.color FROM monitor_tag mt JOIN tag ON mt.tag_id = tag.id WHERE mt.monitor_id = ?", [this.id]);
return {
id: this.id,
name: this.name,
@@ -65,6 +67,7 @@ class Monitor extends BeanModel {
dns_resolve_server: this.dns_resolve_server,
dns_last_result: this.dns_last_result,
notificationIDList,
tags: tags,
};
}

13
server/model/tag.js Normal file
View File

@@ -0,0 +1,13 @@
const { BeanModel } = require("redbean-node/dist/bean-model");
class Tag extends BeanModel {
toJSON() {
return {
id: this._id,
name: this._name,
color: this._color,
};
}
}
module.exports = Tag;