ui/client/features/pages-editor/hooks/usePagesEditorTabs
Cockpit client (features), v0.9. Source: ui/client/features/pages-editor/hooks/usePagesEditorTabs.tsx.
Functions#
usePagesEditorTabs()#
usePagesEditorTabs(
e):void
Defined in: ui/client/features/pages-editor/hooks/usePagesEditorTabs.tsx:18
Puts the Pages Editor's panels into the shell (slot registry): the page/feature tree in the Browser pane and Inspector / Scope / Source / Palette / Diff as Tools tabs. Each tab is memoised on the data it shows so the registry only updates when that changes.
Parameters#
e
allPages
{ error: string; pages: object[]; reload: () => void; status: "loading" | "ready" | "error"; }
allPages.error
string
allPages.pages
object[]
allPages.reload
() => void = load
allPages.status
"loading" | "ready" | "error"
dismissExternalChange
() => void = external.dismiss
error
string | null
externalChange
PageChange | null = external.change
feature
string
features
string[]
file
string
files
string[]
filesLoading
boolean
livePreview
{ connect: () => void; connectTo: (target) => void; disconnect: () => void; draft: string; frameRef: RefObject<HTMLIFrameElement | null>; fullScreen: boolean; message: string | null; release: (target) => void; setDraft: Dispatch<SetStateAction<string>>; url: string | null; view: LivePreviewView; }
livePreview.connect
() => void
livePreview.connectTo
(target) => void
Point the frame at an address the Cockpit itself was given (the dev server it started, #378).
livePreview.disconnect
() => void
livePreview.draft
string
livePreview.frameRef
RefObject<HTMLIFrameElement | null>
livePreview.fullScreen
boolean = full.fullScreen
livePreview.message
string | null
livePreview.release
(target) => void
Let go of target only if that is what the frame is showing: a server stopping must not close a URL the person typed.
livePreview.setDraft
Dispatch<SetStateAction<string>>
livePreview.url
string | null
livePreview.view
onTreeSaved
(tree) => void
openFile
(f) => void
openPageOf
(pageFeature, pageFile) => void
previewTitle
(node) => string
reloadFromDisk
() => void = external.reload
selectedNode
PagesEditorNode | null
selectedNodeId
string | null
selectNode
(nodeId) => void
setFeature
(f) => void
showAllPages
() => void
tree
PageTree | null
Returns#
void