Skip to main content

Function: formatMonitorDetail()

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

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

Format detail label dynamically based on monitor type configuration.

Parametersโ€‹

monitorTypeโ€‹

Type of monitor.

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

detailsโ€‹

string

Detail value to format.

Returnsโ€‹

Promise<string>

Formatted detail string supplied by the monitor registry.

Exampleโ€‹

const label = await formatMonitorDetail("http", "200"); // "Response Code: 200"
const label = await formatMonitorDetail("port", "80"); // "Port: 80"