ui/client/features/pages-editor/hooks/usePageSource
Cockpit client (features), v0.8. Source: ui/client/features/pages-editor/hooks/usePageSource.tsx.
Functions#
usePageSource()#
usePageSource(
feature,file,contentHash,enabled):object
Defined in: ui/client/features/pages-editor/hooks/usePageSource.tsx:12
Loads a page's full source + diagnostics while enabled, and re-runs
whenever the page's contentHash changes (i.e. after any save), so the
markers always describe what is on disk. Derives editor-neutral markers
and the summary line; no editor library involved.
Parameters#
feature
string
file
string
contentHash
string
enabled
boolean
Returns#
object
diagnostics
diagnostics:
SourceDiagnostic[]
error
error:
string|null
loading
loading:
boolean
markers
markers:
SourceMarker[]
source
source:
string
summary
summary:
DiagnosticSummary
summaryText
summaryText:
string