Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/live-preview/hooks/usePreviewSignals

Cockpit client (features), next. Source: ui/client/features/live-preview/hooks/usePreviewSignals.tsx.

Variables#

PLUGIN_WAIT_MS#

const PLUGIN_WAIT_MS: 6000 = 6000

Defined in: ui/client/features/live-preview/hooks/usePreviewSignals.tsx:9

How long a preview that is answering may stay silent before "the plugin is not loaded" is said out loud. Long enough for a cold dev-server page load; a late ready still turns it back to on.

Functions#

usePreviewSignals()#

usePreviewSignals(source, active): object

Defined in: ui/client/features/live-preview/hooks/usePreviewSignals.tsx:16

What the framed app tells us about itself: whether the Cockpit preview plugin loaded (the bridge posts ready once), and the last uncaught error it threw. active is "the server is answering and the frame is on screen"; the clock for off only runs then. Both reset when the preview address changes.

Parameters#

source

PreviewSource | null

active

boolean

Returns#

object

appError

appError: string | null

appErrorSrc

appErrorSrc: string | null

dismissAppError

dismissAppError: () => void

Returns

void

plugin

plugin: PreviewPlugin