Skip to main content

Function: formatMonitorTitleSuffix()

formatMonitorTitleSuffix(monitorType: "http" | "http-keyword" | "http-status" | "http-header" | "http-json" | "http-latency" | "port" | "ping" | "dns" | "ssl" | "websocket-keepalive" | "server-heartbeat" | "replication" | "cdn-edge-consistency", monitor: Monitor): Promise<string>

Defined in: src/utils/monitorUiHelpers.ts:295

Format title suffix dynamically based on monitor type configuration.

Parametersโ€‹

monitorTypeโ€‹

Type of monitor.

"http" | "http-keyword" | "http-status" | "http-header" | "http-json" | "http-latency" | "port" | "ping" | "dns" | "ssl" | "websocket-keepalive" | "server-heartbeat" | "replication" | "cdn-edge-consistency"

monitorโ€‹

Monitor

Monitor data.

Returnsโ€‹

Promise<string>

Title suffix string suitable for rendering in the UI.

Exampleโ€‹

const suffix = await formatMonitorTitleSuffix("http", {
url: "https://example.com",
}); // " (https://example.com)"
const suffix = await formatMonitorTitleSuffix("port", {
host: "localhost",
port: 80,
}); // " (localhost:80)"