Merge branch 'master' into fix/pause-child-monitors

pull/5193/head
Peace 2 months ago
commit 0a479ecb50
No known key found for this signature in database
GPG Key ID: 0EF6B46E172B739F

@ -1509,10 +1509,8 @@ class Monitor extends BeanModel {
return await R.getAll(` return await R.getAll(`
SELECT monitor_notification.monitor_id, monitor_notification.notification_id SELECT monitor_notification.monitor_id, monitor_notification.notification_id
FROM monitor_notification FROM monitor_notification
WHERE monitor_notification.monitor_id IN (?) WHERE monitor_notification.monitor_id IN (${monitorIDs.map((_) => "?").join(",")})
`, [ `, monitorIDs);
monitorIDs,
]);
} }
/** /**
@ -1522,13 +1520,11 @@ class Monitor extends BeanModel {
*/ */
static async getMonitorTag(monitorIDs) { static async getMonitorTag(monitorIDs) {
return await R.getAll(` return await R.getAll(`
SELECT monitor_tag.monitor_id, tag.name, tag.color SELECT monitor_tag.monitor_id, monitor_tag.tag_id, tag.name, tag.color
FROM monitor_tag FROM monitor_tag
JOIN tag ON monitor_tag.tag_id = tag.id JOIN tag ON monitor_tag.tag_id = tag.id
WHERE monitor_tag.monitor_id IN (?) WHERE monitor_tag.monitor_id IN (${monitorIDs.map((_) => "?").join(",")})
`, [ `, monitorIDs);
monitorIDs,
]);
} }
/** /**
@ -1568,6 +1564,7 @@ class Monitor extends BeanModel {
tagsMap.set(row.monitor_id, []); tagsMap.set(row.monitor_id, []);
} }
tagsMap.get(row.monitor_id).push({ tagsMap.get(row.monitor_id).push({
tag_id: row.tag_id,
name: row.name, name: row.name,
color: row.color color: row.color
}); });

@ -32,7 +32,7 @@ class Slack extends NotificationProvider {
* @param {object} monitorJSON The monitor config * @param {object} monitorJSON The monitor config
* @returns {Array} The relevant action objects * @returns {Array} The relevant action objects
*/ */
static buildActions(baseURL, monitorJSON) { buildActions(baseURL, monitorJSON) {
const actions = []; const actions = [];
if (baseURL) { if (baseURL) {
@ -73,7 +73,7 @@ class Slack extends NotificationProvider {
* @param {string} msg The message body * @param {string} msg The message body
* @returns {Array<object>} The rich content blocks for the Slack message * @returns {Array<object>} The rich content blocks for the Slack message
*/ */
static buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) { buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) {
//create an array to dynamically add blocks //create an array to dynamically add blocks
const blocks = []; const blocks = [];
@ -150,7 +150,7 @@ class Slack extends NotificationProvider {
data.attachments.push( data.attachments.push(
{ {
"color": (heartbeatJSON["status"] === UP) ? "#2eb886" : "#e01e5a", "color": (heartbeatJSON["status"] === UP) ? "#2eb886" : "#e01e5a",
"blocks": Slack.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg), "blocks": this.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg),
} }
); );
} else { } else {

@ -33,7 +33,7 @@
<template #item="monitor"> <template #item="monitor">
<div class="item" data-testid="monitor"> <div class="item" data-testid="monitor">
<div class="row"> <div class="row">
<div class="col-6 col-md-4 small-padding"> <div class="col-9 col-md-8 small-padding">
<div class="info"> <div class="info">
<font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" /> <font-awesome-icon v-if="editMode" icon="arrows-alt-v" class="action drag me-3" />
<font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" /> <font-awesome-icon v-if="editMode" icon="times" class="action remove me-3" @click="removeMonitor(group.index, monitor.index)" />
@ -71,7 +71,7 @@
</div> </div>
</div> </div>
</div> </div>
<div :key="$root.userHeartbeatBar" class="col-6 col-md-8"> <div :key="$root.userHeartbeatBar" class="col-3 col-md-4">
<HeartbeatBar size="mid" :monitor-id="monitor.element.id" /> <HeartbeatBar size="mid" :monitor-id="monitor.element.id" />
</div> </div>
</div> </div>

Loading…
Cancel
Save