ui/client/features/pages-editor/hooks/usePreviewSignals
Cockpit client (features), v0.8. Source: ui/client/features/pages-editor/hooks/usePreviewSignals.tsx.
Variables#
PLUGIN_WAIT_MS#
constPLUGIN_WAIT_MS:6000=6000
Defined in: ui/client/features/pages-editor/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/pages-editor/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
dismissAppError
dismissAppError: () =>
void
Returns
void
plugin
plugin:
PreviewPlugin