+ {OneUptimeDate.convertSecondsToDaysHoursMinutesAndSeconds( + item.lastXSecondsOfLogs || 0, + )} +
+ ); + }, + }); + } + + if (props.monitorStep.data?.logMonitor?.severityTexts) { + logMonitorDetailView.severityTexts = + props.monitorStep.data?.logMonitor?.severityTexts; + + logFields.push({ + key: "severityTexts", + title: "Log Severity", + description: "Severity of the logs to monitor.", + fieldType: FieldType.ArrayOfText, + placeholder: "No severity entered", + }); + } + + if ( + props.monitorStep.data?.logMonitor?.attributes && + Object.keys(props.monitorStep.data?.logMonitor?.attributes).length > 0 + ) { + logMonitorDetailView.attributes = + props.monitorStep.data?.logMonitor?.attributes; + + logFields.push({ + key: "attributes", + title: "Log Attributes", + description: "Attributes of the logs to monitor.", + fieldType: FieldType.JSON, + placeholder: "No attributes entered", + }); + } + + if ( + props.monitorStep.data?.logMonitor?.telemetryServiceIds && + props.monitorStep.data?.logMonitor?.telemetryServiceIds.length > 0 && + telemetryServices && + telemetryServices.length > 0 + ) { + logMonitorDetailView.telemetryServices = telemetryServices; // set the telemetry services + + logFields.push({ + key: "telemetryServices", + title: "Telemetry Services", + description: "Telemetry services to monitor.", + fieldType: FieldType.Element, + placeholder: "No telemetry services entered", + getElement: (): ReactElement => { + return ( +