Line

You are reading docs for v0.8. See latest (v0.9)

ui/client/features/dev-server/hooks/useDevServer

Cockpit client (features), v0.8. Source: ui/client/features/dev-server/hooks/useDevServer.tsx.

Functions#

useDevServer()#

useDevServer(): object

Defined in: ui/client/features/dev-server/hooks/useDevServer.tsx:16

The open project's dev server and the four things a person can do: Start, Restart, Stop, and "Use port N". Nothing here ever starts a server unasked: the only callers of startDevServer are confirmStart, requestStart and startOnPort, all reached from a click, and the first start of a project's command goes through a one-time "this is what will run" confirmation.

Returns#

cancelConfirm

cancelConfirm: () => void

Returns

void

confirmStart

confirmStart: () => Promise<void>

Returns

Promise<void>

error

error: string | null

requestStart

requestStart: () => Promise<void>

The Start click: runs at once when this project's command has been seen, otherwise asks first.

Returns

Promise<void>

restart

restart: () => Promise<void>

Returns

Promise<void>

startOnPort

startOnPort: (port?) => Promise<void> = start

Parameters
port?

number

Returns

Promise<void>

status

status: DevServerStatus | null

stop

stop: () => Promise<void>

Returns

Promise<void>

view

view: DevServerView