mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat: Add monitorId support across notification services and logs, and implement Notification Logs page
This commit is contained in:
@@ -70,6 +70,7 @@ export default class CallService {
|
||||
customTwilioConfig?: TwilioConfig | undefined;
|
||||
incidentId?: ObjectID | undefined;
|
||||
alertId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -144,6 +145,10 @@ export default class CallService {
|
||||
callLog.alertId = options.alertId;
|
||||
}
|
||||
|
||||
if (options.monitorId) {
|
||||
callLog.monitorId = options.monitorId;
|
||||
}
|
||||
|
||||
if (options.scheduledMaintenanceId) {
|
||||
callLog.scheduledMaintenanceId = options.scheduledMaintenanceId;
|
||||
}
|
||||
|
||||
@@ -483,6 +483,7 @@ export default class MailService {
|
||||
timeout?: number | undefined;
|
||||
incidentId?: ObjectID | undefined;
|
||||
alertId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -516,6 +517,10 @@ export default class MailService {
|
||||
emailLog.alertId = options.alertId;
|
||||
}
|
||||
|
||||
if (options.monitorId) {
|
||||
emailLog.monitorId = options.monitorId;
|
||||
}
|
||||
|
||||
if (options.scheduledMaintenanceId) {
|
||||
emailLog.scheduledMaintenanceId = options.scheduledMaintenanceId;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export default class SmsService {
|
||||
userOnCallLogTimelineId?: ObjectID | undefined;
|
||||
incidentId?: ObjectID | undefined;
|
||||
alertId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -91,6 +92,10 @@ export default class SmsService {
|
||||
smsLog.alertId = options.alertId;
|
||||
}
|
||||
|
||||
if (options.monitorId) {
|
||||
smsLog.monitorId = options.monitorId;
|
||||
}
|
||||
|
||||
if (options.scheduledMaintenanceId) {
|
||||
smsLog.scheduledMaintenanceId = options.scheduledMaintenanceId;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ export default class WhatsAppService {
|
||||
userOnCallLogTimelineId?: ObjectID | undefined;
|
||||
incidentId?: ObjectID | undefined;
|
||||
alertId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -96,6 +97,10 @@ export default class WhatsAppService {
|
||||
whatsAppLog.alertId = options.alertId;
|
||||
}
|
||||
|
||||
if (options.monitorId) {
|
||||
whatsAppLog.monitorId = options.monitorId;
|
||||
}
|
||||
|
||||
if (options.scheduledMaintenanceId) {
|
||||
whatsAppLog.scheduledMaintenanceId = options.scheduledMaintenanceId;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Project from "./Project";
|
||||
import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import Monitor from "./Monitor";
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import StatusPage from "./StatusPage";
|
||||
import StatusPageAnnouncement from "./StatusPageAnnouncement";
|
||||
@@ -464,6 +465,66 @@ export default class CallLog extends BaseModel {
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadCallLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "monitorId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Monitor,
|
||||
title: "Monitor",
|
||||
description: "Monitor associated with this Call (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Monitor;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "monitorId" })
|
||||
public monitor?: Monitor = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadCallLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Monitor ID",
|
||||
description: "ID of Monitor associated with this Call (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Project from "./Project";
|
||||
import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import Monitor from "./Monitor";
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import StatusPage from "./StatusPage";
|
||||
import ProjectSmtpConfig from "./ProjectSmtpConfig";
|
||||
@@ -499,6 +500,66 @@ export default class EmailLog extends BaseModel {
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadEmailLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "monitorId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Monitor,
|
||||
title: "Monitor",
|
||||
description: "Monitor associated with this email (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Monitor;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "monitorId" })
|
||||
public monitor?: Monitor = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadEmailLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Monitor ID",
|
||||
description: "ID of Monitor associated with this email (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Project from "./Project";
|
||||
import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import Monitor from "./Monitor";
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import StatusPage from "./StatusPage";
|
||||
import StatusPageAnnouncement from "./StatusPageAnnouncement";
|
||||
@@ -458,6 +459,66 @@ export default class PushNotificationLog extends BaseModel {
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadPushLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "monitorId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Monitor,
|
||||
title: "Monitor",
|
||||
description: "Monitor associated with this Push (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Monitor;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "monitorId" })
|
||||
public monitor?: Monitor = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadPushLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Monitor ID",
|
||||
description: "ID of Monitor associated with this Push (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Project from "./Project";
|
||||
import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import Monitor from "./Monitor";
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import StatusPage from "./StatusPage";
|
||||
import StatusPageAnnouncement from "./StatusPageAnnouncement";
|
||||
@@ -465,6 +466,66 @@ export default class SmsLog extends BaseModel {
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadSmsLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "monitorId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Monitor,
|
||||
title: "Monitor",
|
||||
description: "Monitor associated with this SMS (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Monitor;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "monitorId" })
|
||||
public monitor?: Monitor = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadSmsLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Monitor ID",
|
||||
description: "ID of Monitor associated with this SMS (if any)",
|
||||
example: "d4e5f6a7-89ab-23de-f456-456789abcdef",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Project from "./Project";
|
||||
import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import Monitor from "./Monitor";
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import StatusPage from "./StatusPage";
|
||||
import StatusPageAnnouncement from "./StatusPageAnnouncement";
|
||||
@@ -476,6 +477,64 @@ export default class WhatsAppLog extends BaseModel {
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWhatsAppLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "monitorId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Monitor,
|
||||
title: "Monitor",
|
||||
description: "Monitor associated with this message (if any)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Monitor;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "monitorId" })
|
||||
public monitor?: Monitor = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWhatsAppLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Monitor ID",
|
||||
description: "ID of Monitor associated with this message (if any)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -3,6 +3,7 @@ import Incident from "./Incident";
|
||||
import Alert from "./Alert";
|
||||
import AlertEpisode from "./AlertEpisode";
|
||||
import IncidentEpisode from "./IncidentEpisode";
|
||||
import Monitor from "./Monitor";
|
||||
import ScheduledMaintenance from "./ScheduledMaintenance";
|
||||
import StatusPage from "./StatusPage";
|
||||
import StatusPageAnnouncement from "./StatusPageAnnouncement";
|
||||
@@ -501,6 +502,64 @@ export default class WorkspaceNotificationLog extends BaseModel {
|
||||
})
|
||||
public alertId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@TableColumn({
|
||||
manyToOneRelationColumn: "monitorId",
|
||||
type: TableColumnType.Entity,
|
||||
modelType: Monitor,
|
||||
title: "Monitor",
|
||||
description: "Monitor associated with this message (if any)",
|
||||
})
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Monitor;
|
||||
},
|
||||
{
|
||||
eager: false,
|
||||
nullable: true,
|
||||
onDelete: "CASCADE",
|
||||
orphanedRowAction: "nullify",
|
||||
},
|
||||
)
|
||||
@JoinColumn({ name: "monitorId" })
|
||||
public monitor?: Monitor = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
Permission.ProjectOwner,
|
||||
Permission.ProjectAdmin,
|
||||
Permission.ProjectMember,
|
||||
Permission.ReadWorkspaceNotificationLog,
|
||||
Permission.ReadAllProjectResources,
|
||||
],
|
||||
update: [],
|
||||
})
|
||||
@Index()
|
||||
@TableColumn({
|
||||
type: TableColumnType.ObjectID,
|
||||
required: false,
|
||||
canReadOnRelationQuery: true,
|
||||
title: "Monitor ID",
|
||||
description: "ID of Monitor associated with this message (if any)",
|
||||
})
|
||||
@Column({
|
||||
type: ColumnType.ObjectID,
|
||||
nullable: true,
|
||||
transformer: ObjectID.getDatabaseTransformer(),
|
||||
})
|
||||
public monitorId?: ObjectID = undefined;
|
||||
|
||||
@ColumnAccessControl({
|
||||
create: [],
|
||||
read: [
|
||||
|
||||
@@ -30,6 +30,7 @@ export class CallService extends BaseService {
|
||||
alertId?: ObjectID | undefined;
|
||||
alertEpisodeId?: ObjectID | undefined;
|
||||
incidentEpisodeId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -60,6 +61,7 @@ export class CallService extends BaseService {
|
||||
incidentId: options.incidentId?.toString(),
|
||||
alertId: options.alertId?.toString(),
|
||||
alertEpisodeId: options.alertEpisodeId?.toString(),
|
||||
monitorId: options.monitorId?.toString(),
|
||||
scheduledMaintenanceId: options.scheduledMaintenanceId?.toString(),
|
||||
statusPageId: options.statusPageId?.toString(),
|
||||
statusPageAnnouncementId: options.statusPageAnnouncementId?.toString(),
|
||||
|
||||
@@ -25,6 +25,7 @@ export class MailService extends BaseService {
|
||||
alertId?: ObjectID | undefined;
|
||||
alertEpisodeId?: ObjectID | undefined;
|
||||
incidentEpisodeId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -74,6 +75,10 @@ export class MailService extends BaseService {
|
||||
body["alertEpisodeId"] = options.alertEpisodeId.toString();
|
||||
}
|
||||
|
||||
if (options?.monitorId) {
|
||||
body["monitorId"] = options.monitorId.toString();
|
||||
}
|
||||
|
||||
if (options?.scheduledMaintenanceId) {
|
||||
body["scheduledMaintenanceId"] =
|
||||
options.scheduledMaintenanceId.toString();
|
||||
|
||||
@@ -1314,6 +1314,7 @@ ${createdItem.description?.trim() || "No description provided."}
|
||||
}),
|
||||
whatsAppMessage,
|
||||
eventType,
|
||||
monitorId: monitor.id!,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1440,6 +1441,7 @@ ${createdItem.description?.trim() || "No description provided."}
|
||||
}),
|
||||
whatsAppMessage,
|
||||
eventType,
|
||||
monitorId: monitor.id!,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ export interface PushNotificationOptions {
|
||||
incidentId?: ObjectID | undefined;
|
||||
alertId?: ObjectID | undefined;
|
||||
alertEpisodeId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -163,6 +164,9 @@ export default class PushNotificationService {
|
||||
if (options.alertId) {
|
||||
log.alertId = options.alertId;
|
||||
}
|
||||
if (options.monitorId) {
|
||||
log.monitorId = options.monitorId;
|
||||
}
|
||||
if (options.scheduledMaintenanceId) {
|
||||
log.scheduledMaintenanceId = options.scheduledMaintenanceId;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export class SmsService extends BaseService {
|
||||
alertId?: ObjectID | undefined;
|
||||
alertEpisodeId?: ObjectID | undefined;
|
||||
incidentEpisodeId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -61,6 +62,7 @@ export class SmsService extends BaseService {
|
||||
incidentId: options.incidentId?.toString(),
|
||||
alertId: options.alertId?.toString(),
|
||||
alertEpisodeId: options.alertEpisodeId?.toString(),
|
||||
monitorId: options.monitorId?.toString(),
|
||||
scheduledMaintenanceId: options.scheduledMaintenanceId?.toString(),
|
||||
statusPageId: options.statusPageId?.toString(),
|
||||
statusPageAnnouncementId: options.statusPageAnnouncementId?.toString(),
|
||||
|
||||
@@ -51,6 +51,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
||||
alertId?: ObjectID | undefined;
|
||||
alertEpisodeId?: ObjectID | undefined;
|
||||
incidentEpisodeId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -117,6 +118,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
||||
alertId: data.alertId,
|
||||
alertEpisodeId: data.alertEpisodeId,
|
||||
incidentEpisodeId: data.incidentEpisodeId,
|
||||
monitorId: data.monitorId,
|
||||
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
||||
statusPageId: data.statusPageId,
|
||||
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
||||
@@ -164,6 +166,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
||||
alertId: data.alertId,
|
||||
alertEpisodeId: data.alertEpisodeId,
|
||||
incidentEpisodeId: data.incidentEpisodeId,
|
||||
monitorId: data.monitorId,
|
||||
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
||||
statusPageId: data.statusPageId,
|
||||
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
||||
@@ -218,6 +221,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
||||
alertId: data.alertId,
|
||||
alertEpisodeId: data.alertEpisodeId,
|
||||
incidentEpisodeId: data.incidentEpisodeId,
|
||||
monitorId: data.monitorId,
|
||||
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
||||
statusPageId: data.statusPageId,
|
||||
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
||||
@@ -264,6 +268,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
||||
alertId: data.alertId,
|
||||
alertEpisodeId: data.alertEpisodeId,
|
||||
incidentEpisodeId: data.incidentEpisodeId,
|
||||
monitorId: data.monitorId,
|
||||
scheduledMaintenanceId: data.scheduledMaintenanceId,
|
||||
statusPageId: data.statusPageId,
|
||||
statusPageAnnouncementId: data.statusPageAnnouncementId,
|
||||
@@ -294,6 +299,7 @@ export class Service extends DatabaseService<UserNotificationSetting> {
|
||||
projectId: data.projectId,
|
||||
userId: data.userId,
|
||||
teamId: data.teamId,
|
||||
monitorId: data.monitorId,
|
||||
// OnCall-related fields
|
||||
onCallPolicyId: data.onCallPolicyId,
|
||||
onCallPolicyEscalationRuleId: data.onCallPolicyEscalationRuleId,
|
||||
|
||||
@@ -28,6 +28,7 @@ export class WhatsAppService extends BaseService {
|
||||
alertId?: ObjectID | undefined;
|
||||
alertEpisodeId?: ObjectID | undefined;
|
||||
incidentEpisodeId?: ObjectID | undefined;
|
||||
monitorId?: ObjectID | undefined;
|
||||
scheduledMaintenanceId?: ObjectID | undefined;
|
||||
statusPageId?: ObjectID | undefined;
|
||||
statusPageAnnouncementId?: ObjectID | undefined;
|
||||
@@ -90,6 +91,10 @@ export class WhatsAppService extends BaseService {
|
||||
body["alertEpisodeId"] = options.alertEpisodeId.toString();
|
||||
}
|
||||
|
||||
if (options.monitorId) {
|
||||
body["monitorId"] = options.monitorId.toString();
|
||||
}
|
||||
|
||||
if (options.scheduledMaintenanceId) {
|
||||
body["scheduledMaintenanceId"] =
|
||||
options.scheduledMaintenanceId.toString();
|
||||
|
||||
20
Dashboard/src/Pages/Monitor/View/NotificationLogs.tsx
Normal file
20
Dashboard/src/Pages/Monitor/View/NotificationLogs.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React, { FunctionComponent, ReactElement } from "react";
|
||||
import PageComponentProps from "../../PageComponentProps";
|
||||
import NotificationLogsTabs from "../../../Components/NotificationLogs/NotificationLogsTabs";
|
||||
import Navigation from "Common/UI/Utils/Navigation";
|
||||
import ObjectID from "Common/Types/ObjectID";
|
||||
|
||||
const MonitorNotificationLogs: FunctionComponent<
|
||||
PageComponentProps
|
||||
> = (): ReactElement => {
|
||||
const modelId: ObjectID = Navigation.getLastParamAsObjectID(1);
|
||||
|
||||
return (
|
||||
<NotificationLogsTabs
|
||||
singularName="monitor"
|
||||
query={{ monitorId: modelId }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default MonitorNotificationLogs;
|
||||
@@ -132,6 +132,16 @@ const DashboardSideMenu: FunctionComponent<ComponentProps> = (
|
||||
}}
|
||||
icon={IconProp.ExclaimationCircle}
|
||||
/>
|
||||
<SideMenuItem
|
||||
link={{
|
||||
title: "Notification Logs",
|
||||
to: RouteUtil.populateRouteParams(
|
||||
RouteMap[PageMap.MONITOR_VIEW_NOTIFICATION_LOGS] as Route,
|
||||
{ modelId: props.modelId },
|
||||
),
|
||||
}}
|
||||
icon={IconProp.Bell}
|
||||
/>
|
||||
</SideMenuSection>
|
||||
|
||||
<SideMenuSection title="Advanced">
|
||||
|
||||
@@ -126,6 +126,12 @@ const MonitorViewSettings: LazyExoticComponent<
|
||||
return import("../Pages/Monitor/View/Settings");
|
||||
});
|
||||
|
||||
const MonitorViewNotificationLogs: LazyExoticComponent<
|
||||
FunctionComponent<ComponentProps>
|
||||
> = lazy(() => {
|
||||
return import("../Pages/Monitor/View/NotificationLogs");
|
||||
});
|
||||
|
||||
const MonitorCreate: LazyExoticComponent<FunctionComponent<ComponentProps>> =
|
||||
lazy(() => {
|
||||
return import("../Pages/Monitor/Create");
|
||||
@@ -492,6 +498,22 @@ const MonitorRoutes: FunctionComponent<ComponentProps> = (
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
|
||||
<PageRoute
|
||||
path={RouteUtil.getLastPathForKey(
|
||||
PageMap.MONITOR_VIEW_NOTIFICATION_LOGS,
|
||||
)}
|
||||
element={
|
||||
<Suspense fallback={Loader}>
|
||||
<MonitorViewNotificationLogs
|
||||
{...props}
|
||||
pageRoute={
|
||||
RouteMap[PageMap.MONITOR_VIEW_NOTIFICATION_LOGS] as Route
|
||||
}
|
||||
/>
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
</PageRoute>
|
||||
</Routes>
|
||||
);
|
||||
|
||||
@@ -102,6 +102,12 @@ export function getMonitorBreadcrumbs(path: string): Array<Link> | undefined {
|
||||
"View Monitor",
|
||||
"Delete Monitor",
|
||||
]),
|
||||
...BuildBreadcrumbLinksByTitles(PageMap.MONITOR_VIEW_NOTIFICATION_LOGS, [
|
||||
"Project",
|
||||
"Monitors",
|
||||
"View Monitor",
|
||||
"Notification Logs",
|
||||
]),
|
||||
|
||||
// Monitor Settings (Product-level)
|
||||
...BuildBreadcrumbLinksByTitles(PageMap.MONITORS_SETTINGS, [
|
||||
|
||||
@@ -176,6 +176,7 @@ enum PageMap {
|
||||
MONITOR_VIEW_DOCUMENTATION = "MONITOR_VIEW_DOCUMENTATION",
|
||||
MONITOR_VIEW_OWNERS = "MONITOR_VIEW_OWNERS",
|
||||
MONITOR_VIEW_SETTINGS = "MONITOR_VIEW_SETTINGS",
|
||||
MONITOR_VIEW_NOTIFICATION_LOGS = "MONITOR_VIEW_NOTIFICATION_LOGS",
|
||||
|
||||
// Monitor Settings (Product-level)
|
||||
MONITORS_SETTINGS = "MONITORS_SETTINGS",
|
||||
|
||||
@@ -34,6 +34,7 @@ export const MonitorsRoutePath: Dictionary<string> = {
|
||||
[PageMap.MONITOR_VIEW_PROBES]: `${RouteParams.ModelID}/probes`,
|
||||
[PageMap.MONITOR_VIEW_LOGS]: `${RouteParams.ModelID}/logs`,
|
||||
[PageMap.MONITOR_VIEW_DOCUMENTATION]: `${RouteParams.ModelID}/documentation`,
|
||||
[PageMap.MONITOR_VIEW_NOTIFICATION_LOGS]: `${RouteParams.ModelID}/notification-logs`,
|
||||
};
|
||||
|
||||
export const ServiceRoutePath: Dictionary<string> = {
|
||||
@@ -552,6 +553,12 @@ const RouteMap: Dictionary<Route> = {
|
||||
}`,
|
||||
),
|
||||
|
||||
[PageMap.MONITOR_VIEW_NOTIFICATION_LOGS]: new Route(
|
||||
`/dashboard/${RouteParams.ProjectID}/monitors/${
|
||||
MonitorsRoutePath[PageMap.MONITOR_VIEW_NOTIFICATION_LOGS]
|
||||
}`,
|
||||
),
|
||||
|
||||
// Monitor Settings Routes
|
||||
[PageMap.MONITORS_SETTINGS]: new Route(
|
||||
`/dashboard/${RouteParams.ProjectID}/monitors/${
|
||||
|
||||
@@ -148,6 +148,7 @@ RunCron(
|
||||
pushNotificationMessage: pushMessage,
|
||||
whatsAppMessage,
|
||||
eventType,
|
||||
monitorId: monitor.id!,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +231,7 @@ RunCron(
|
||||
pushNotificationMessage: pushMessage,
|
||||
whatsAppMessage,
|
||||
eventType,
|
||||
monitorId: monitor.id!,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,6 +282,7 @@ RunCron(
|
||||
pushNotificationMessage: pushMessage,
|
||||
whatsAppMessage,
|
||||
eventType,
|
||||
monitorId: monitor.id!,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user