zidane-ui/ machines
import { … } from 'zidane-ui/machines'ui/src/machines/index.ts
Components#
AddServerFormComponent#
Renders the add-a-server form.
function AddServerForm(props: AddServerFormProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | AddServerFormProps | The cancel and added callbacks, an id prefix, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the form. |
| idPrefix? | string | The fields' id prefix (two forms on one page). Default |
| onAdded | (result: { host?: HostSummary; latencyMs?: number; name: string; ok: true; serverVersion?: string }) => void | Promise<void> | Called after the server was saved. |
| onCancel | () => void | Called when the user cancels. |
| style? | CSSProperties | Inline styles on the form. |
CapabilitiesViewComponent#
Renders the full check: OS and free disk, each tool found or missing with its version, the sandbox, the environment kinds and what the host allows, with Re-check.
function CapabilitiesView(props: CapabilitiesViewProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | CapabilitiesViewProps |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| caps | HostCapabilities | null | The host's capabilities; |
| checking | boolean | A check is out (the Re-check button waits). |
| className? | string | Classes merged on the root. |
| error | MachinesError | null | Why the last check failed. |
| installed? | { name: string; ok: boolean; output: string } | null | How the last install went: its output shows under the tools when it failed. |
| installing? | string | null | The tool being installed. |
| installRestricted? | boolean | This connection may not install (a chat token): Install shows, Admin only. |
| local? | boolean | This computer: it serves no clients, so what it allows is not listed. |
| onInstall? | (name: string) => void | Installs a missing tool there. Absent: a missing tool offers nothing. |
| onRecheck | () => void | Probes again. |
| style? | CSSProperties | Inline styles on the root. |
CapabilityTagsComponent#
Renders the tags a host's row shows: a few tools and cloud kinds, then "+N".
function CapabilityTags(props: CapabilityTagsProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | CapabilityTagsProps |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| caps | HostCapabilities | null | The host's capabilities; nothing shows without them or for an older server's partial answer. |
ComposerNoticeComponent#
A dismissable notice above the composer: why a new chat could not be created (its server went offline, …).
function ComposerNotice(props: ComposerNoticeProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ComposerNoticeProps | The text, the dismiss callback, a test id, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| onDismiss | () => void | Called when the user dismisses it. |
| style? | CSSProperties | Inline styles on the root. |
| testId? | string | The root's |
| text | string | What happened. |
CopyTextComponent#
Text that copies itself on click, and says so for a moment.
function CopyText(props: CopyTextProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | CopyTextProps | The text, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the button. |
| field? | boolean | Shown as a full-width field (a well), not inline text. |
| style? | CSSProperties | Inline styles on the button. |
| text | string | The text shown and copied. |
DaemonMenuComponent#
Renders the daemon dot and its menu. Nothing without the host's daemon.
function DaemonMenu(props: DaemonMenuProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | DaemonMenuProps | The orb's counts, the app's session callbacks, the daemon mode toggle, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| attention? | number | Sessions waiting for the user, for the orb. |
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before "Restart daemon now". Default: the provider's confirm. |
| daemonMode? | boolean | Daemon mode is on: the toggle row offers to turn it off. |
| onDaemonModeChange? | (on: boolean) => void | Turns daemon mode on or off. Absent: no toggle row. |
| onOpenSession? | (sessionId: string) => void | Opens a session the daemon holds. Absent: its row does nothing. |
| running? | number | Runs on the daemon now, for the orb. |
| sessionTitle? | (sessionId: string) => string | A session's title for its row and the diagnostics. Default: the first 8 characters of its id. |
| style? | CSSProperties | Inline styles on the root. |
HostRemovedBannerComponent#
The chat that was open closed because its server was removed.
function HostRemovedBanner(props: HostRemovedBannerProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | HostRemovedBannerProps | The notice, the dismiss callback, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| notice | string | What was removed ( |
| onDismiss | () => void | Called when the user dismisses it. |
| style? | CSSProperties | Inline styles on the root. |
HostSignInComponent#
Renders a sign-in on a server from start to end.
function HostSignIn(props: HostSignInProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | HostSignInProps | The server, the target and its label, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| hostId | string | The server. |
| hostName | string | Its name, for the lines. |
| label | string | What is being signed in to, for the lines. |
| onClose | () => void | Closes the strip (Cancel or Close). |
| onDone? | () => void | The server stored the tokens. |
| style? | CSSProperties | Inline styles on the root. |
| target | HostSignInTarget | What to sign in to there. Read once, when the sign-in starts. |
HostsSectionComponent#
Renders the hosts list, the add form and a host's page.
function HostsSection(props: HostsSectionProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | HostsSectionProps |
|
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before removing a server, installing an update, copying a secret. Default: the provider's confirm. |
| now? | number | "Now" for the relative dates (screenshots). Default: the clock. |
| style? | CSSProperties | Inline styles on the root. |
HostSyncPanelComponent#
Renders a server's settings sync from this computer.
function HostSyncPanel(props: HostSyncPanelProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | HostSyncPanelProps | The server, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before copying a secret or taking over. Default: the provider's confirm. |
| host | HostSummary | The server. |
| style? | CSSProperties | Inline styles on the root. |
MachinesProviderComponent#
Provides a MachinesHost, optional label overrides and a confirm to the machines components below it.
function MachinesProvider(props: MachinesProviderProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | MachinesProviderProps | Provider props: the |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The components that read from |
| confirm? | MachinesConfirm | Asks before a destructive action, on the app's modal layer. Default: a |
| host | MachinesHost | The host the machines components read from and act through. |
| labels? | Partial<{ machinesAccess: (scope: string) => 'Admin access' | 'Chat access'; machinesAdd: string; machinesAdding: string; machinesAddServer: string; machinesAdminOnly: string; machinesAgo: (short: string) => string; machinesAutoUpdateTitle: string; machinesCancel: string; machinesCapabilitiesTitle: string; machinesCapsAsMachine: string; machinesCapsAvailable: string; machinesCapsAvailableA11y: string; machinesCapsChecking: string; machinesCapsClone: string; machinesCapsCreateFolders: string; machinesCapsEnvAvailable: string; machinesCapsFeatures: string; machinesCapsFree: (bytes: number) => string; machinesCapsInstall: string; machinesCapsInstallCopy: (command: string) => string; machinesCapsInstallCopyLabel: (tool: string) => string; machinesCapsInstalled: (tool: string) => string; machinesCapsInstallFailed: (tool: string) => string; machinesCapsInstalling: string; machinesCapsInstallLabel: (tool: string) => string; machinesCapsInstallPage: string; machinesCapsInstallPageLabel: (tool: string) => string; machinesCapsMissing: string; machinesCapsMissingA11y: string; machinesCapsMore: (count: number) => string; machinesCapsNotAvailable: string; machinesCapsOs: Record<string, string>; machinesCapsPartial: string; machinesCapsRecheck: string; machinesCapsRemoteInstalls: string; machinesCapsSandbox: string; machinesCapsSync: string; machinesCapsTools: string; machinesChangeUrl: string; machinesChangingUrl: string; machinesCheckError: (error: HostCheckError, message: string) => string; machinesConnectingTo: (name: string) => string; machinesCopiedText: (text: string) => string; machinesCopy: string; machinesCopyText: (text: string) => string; machinesDaemon: string; machinesDaemonActions: string; machinesDaemonConnected: string; machinesDaemonConnecting: string; machinesDaemonCopied: string; machinesDaemonCopy: string; machinesDaemonCopying: string; machinesDaemonDays: (days: number) => string; machinesDaemonHours: (hours: number, minutes: number) => string; machinesDaemonMenu: (health: string) => string; machinesDaemonMinutes: (minutes: number) => string; machinesDaemonModeOff: string; machinesDaemonModeOffHint: string; machinesDaemonModeOn: string; machinesDaemonModeOnHint: string; machinesDaemonNewer: string; machinesDaemonNewerDetail: (versions: string) => string; machinesDaemonOff: string; machinesDaemonOffDetail: string; machinesDaemonOlder: string; machinesDaemonOlderDetail: (versions: string) => string; machinesDaemonOnIt: string; machinesDaemonPid: (pid: number) => string; machinesDaemonProtocol: (version: number) => string; machinesDaemonReconnect: string; machinesDaemonReconnected: string; machinesDaemonReconnectHint: string; machinesDaemonReconnecting: string; machinesDaemonRefused: string; machinesDaemonRelaunch: string; machinesDaemonRelaunchHint: string; machinesDaemonRestart: string; machinesDaemonRestartDeferred: string; machinesDaemonRestarted: string; machinesDaemonRestartHint: string; machinesDaemonRestarting: string; machinesDaemonRestartNow: string; machinesDaemonRestartNowConfirm: string; machinesDaemonRestartNowHint: string; machinesDaemonRetiring: string; machinesDaemonRetiringDetail: string; machinesDaemonRetrying: string; machinesDaemonRunning: string; machinesDaemonStop: string; machinesDaemonStopAll: string; machinesDaemonStopped: (title: string) => string; machinesDaemonStoppedAll: (count: number | void) => string; machinesDaemonStopping: string; machinesDaemonStoppingAll: string; machinesDaemonUnreachable: string; machinesDaemonUp: (uptime: string) => string; machinesDaemonVersions: (daemon: number, window: number) => string; machinesDaemonWaitingForYou: string; machinesDeviceToken: string; machinesDeviceTokenPlaceholder: string; machinesDismiss: string; machinesError: (error: MachinesError) => string; machinesFactConnected: (ago: string) => string; machinesFactScope: (scope: string) => string; machinesFactServerName: (name: string) => string; machinesFactUptime: (uptime: string) => string; machinesFactVersion: (version: string) => string; machinesFolders: string; machinesForget: string; machinesForgetLabel: (machine: string) => string; machinesForgetMessage: (name: string) => string; machinesForgetTitle: (machine: string) => string; machinesGetAdmin: string; machinesGetAdminCopy: string; machinesGetAdminPairNext: string; machinesGetAdminRun: string; machinesGetAdminSave: string; machinesGetAdminSaved: string; machinesGetAdminSaving: string; machinesGetAdminToken: string; machinesGetAdminTokenField: string; machinesGpus: string; machinesHostActions: (name: string) => string; machinesHostName: string; machinesHostRemoved: (notice: string) => string; machinesHostStatuses: { 'auth-refused': string; connected: string; connecting: string; identity: string; local: string; offline: string; reconnecting: string; 'version-mismatch': string }; machinesHostsTitle: string; machinesInviteCommand: string; machinesInviteCopy: string; machinesInviteCreate: string; machinesInviteCreating: string; machinesInviteDone: string; machinesInviteExpires: (time: string) => string; machinesInviteForm: string; machinesInviteHint: string; machinesInviteName: string; machinesInviteNamePlaceholder: string; machinesInviteNameRule: string; machinesInviteNeedsAdmin: string; machinesInviteOpen: string; machinesInviteTitle: (name: string) => string; machinesLinkOff: string; machinesListEmpty: string; machinesListNotPermitted: string; machinesListTitle: (name: string) => string; machinesLocalDescription: string; machinesMachinesTitle: string; machinesNameOptional: string; machinesOfflineAuthRefused: (name: string) => string; machinesOfflineConnecting: (name: string) => string; machinesOfflineIdentity: (name: string) => string; machinesOfflineOther: (name: string, status: string) => string; machinesOfflineRemoved: (name: string) => string; machinesOfflineSince: (when: string) => string; machinesOfflineVersion: (name: string, error?: string) => string; machinesOkLine: (name: string, version?: string, latencyMs?: number) => string; machinesOpenHost: (name: string) => string; machinesRemove: string; machinesRemoveFailed: (name: string, detail: string) => string; machinesRemoveMessage: string; machinesRemoveTitle: (name: string) => string; machinesRemoving: string; machinesRename: string; machinesRenaming: string; machinesRetry: string; machinesSave: string; machinesSavedHostsError: (detail: string) => string; machinesServerUrl: string; machinesServerUrlPlaceholder: string; machinesShareAddFolder: string; machinesShared: (roots: string, name: string) => string; machinesShareFolders: string; machinesShareForm: string; machinesShareHint: (name: string) => string; machinesShareName: (name: string) => string; machinesShareNamePlaceholder: string; machinesShareOpen: string; machinesShareStart: string; machinesShareStop: string; machinesShareTitle: (name: string) => string; machinesShareToken: string; machinesShareTokenPlaceholder: string; machinesSharing: (name: string) => string; machinesStatus: (status: 'online' | 'offline') => 'online' | 'offline'; machinesStopping: string; machinesSyncAccounts: string; machinesSyncAgain: string; machinesSyncApiKey: string; machinesSyncBlocked: (reason: SyncBlockedReason, name: string) => string; machinesSyncCategories: Record<SyncCategory, { description: string; label: string }>; machinesSyncComplete: string; machinesSyncCopyKey: (label: string) => string; machinesSyncEditedHere: (device: string) => string; machinesSyncEditedOn: (name: string) => string; machinesSyncEditedOnTitle: (name: string) => string; machinesSyncEnvConfirm: string; machinesSyncEnvMessage: (name: string) => string; machinesSyncEnvTitle: (name: string) => string; machinesSyncFrom: (device: string) => string; machinesSyncKeyConfirm: string; machinesSyncKeyMessage: (name: string) => string; machinesSyncKeyTitle: (label: string, name: string) => string; machinesSyncMode: string; machinesSyncModeDescription: (device: string | undefined, name: string) => string; machinesSyncModes: Record<SyncMode, string>; machinesSyncMoreLines: (count: number) => string; machinesSyncNoAccounts: string; machinesSyncNotPushed: string; machinesSyncNotSyncable: (list: string) => string; machinesSyncNotSynced: string; machinesSyncOffline: string; machinesSyncOnHost: (name: string) => string; machinesSyncOutcomeDetails: (label: string) => string; machinesSyncPartial: string; machinesSyncPushed: (ago: string) => string; machinesSyncPushing: string; machinesSyncPushNow: string; machinesSyncSetUpOn: (name: string) => string; machinesSyncSignedInThere: string; machinesSyncSignIn: (label: string) => string; machinesSyncSignInThere: string; machinesSyncStartsWithHosts: string; machinesSyncStaysHere: string; machinesSyncStdio: (name: string, list: string) => string; machinesSyncSyncedFrom: (device: string) => string; machinesSyncTakeOver: string; machinesSyncTakeOverMessage: (name: string, other: string) => string; machinesSyncTakeOverTitle: (name: string) => string; machinesSyncTitle: string; machinesSyncTooOld: string; machinesSyncWaiting: string; machinesSyncWaitingList: (categories: string) => string; machinesSyncWarnings: string; machinesSyncWhat: string; machinesTest: string; machinesTesting: string; machinesThisApp: string; machinesThisServer: string; machinesTokensCreate: string; machinesTokensCreated: (name: string) => string; machinesTokensCreatedAt: (ago: string) => string; machinesTokensCreating: string; machinesTokensEmpty: string; machinesTokensExpired: string; machinesTokensExpires: (date: string) => string; machinesTokensList: string; machinesTokensName: string; machinesTokensNamePlaceholder: string; machinesTokensNeverUsed: string; machinesTokensRevoke: string; machinesTokensRevoked: string; machinesTokensRevokeLabel: (name: string) => string; machinesTokensRevokeMessage: string; machinesTokensRevokeTitle: (name: string) => string; machinesTokensScope: string; machinesTokensScopes: Record<ServerTokenScope, string>; machinesTokensUsed: (ago: string) => string; machinesUpdateCheck: string; machinesUpdateChecking: string; machinesUpdateFrom: (version: string) => string; machinesUpdateInstall: string; machinesUpdateInstallMessage: string; machinesUpdateInstallTitle: (latest?: string) => string; machinesUpdateOff: string; machinesUpdateOn: string; machinesUpdateOtherWay: string; machinesUpdateOut: (version: string) => string; machinesUpdateRolledBack: (version: string) => string; machinesUpdateStateChecking: string; machinesUpdateStateDownloading: (latest?: string) => string; machinesUpdateStateError: string; machinesUpdateStateInstalling: (latest?: string) => string; machinesUpdateStateReady: (latest?: string) => string; machinesUpdateStateWaiting: (latest?: string) => string; machinesUpdateStateWaitingOn: (latest: string | undefined, blockers: readonly ('work' | 'terminals')[], since: string) => string; machinesUpdateTurnOff: string; machinesUpdateTurnOn: string; machinesUpdateUnsupported: (name: string) => string; machinesUpdateUpToDate: string; machinesUpdateVersion: (version: string) => string; machinesUrlChanged: (name: string, url: string) => string; machinesUse: string; machinesUseHint: (name: string) => string; machinesUseMachineName: (machine: string) => string; machinesUseNotLent: (name: string) => string; machinesUseStop: string; machinesUseTitle: (name: string) => string; machinesVersion: (version: string) => string; machinesVersionDiffers: (version: string, server: string) => string; machinesWaiting: (machine: string) => string }> | Overrides for the machines components' strings. Keys you leave out keep the default English label. |
MachineWaitingBannerComponent#
"Waiting for laptop…" while the session's run is paused on an offline machine, gone at once when the host hears that machine came back.
function MachineWaitingBanner(props: MachineWaitingBannerProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | MachineWaitingBannerProps | The machine waited for, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| machine | string | null | The machine the session's run waits for (from its notices, |
| style? | CSSProperties | Inline styles on the root. |
ServerCardComponent#
Renders a server's card: what it is and how it is, and the actions the host offers.
function ServerCard(props: ServerCardProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ServerCardProps | The server, its saved entry, the change callback, a badge, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| badge? | ReactNode | Shown after the status dot and chip (a sync outcome badge). |
| className? | string | Extra classes on the card. |
| confirm? | MachinesConfirm | Asks before Remove. Default: the provider's confirm. |
| host | HostSummary | The server, with its live status. |
| now? | number | The current time for the facts, epoch ms. Default: now. |
| onChanged? | () => void | Promise<void> | Called after a test, rename, URL change or removal changed what the host holds. |
| saved? | HostSummary | The saved entry, for the dates the live status lacks ( |
| style? | CSSProperties | Inline styles on the card. |
ServerMachinesPanelComponent#
Renders a server's machine links and machines.
function ServerMachinesPanel(props: ServerMachinesPanelProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ServerMachinesPanelProps | The server, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before Forget. Default: the provider's confirm. |
| host | HostSummary | The server. |
| now? | number | The current time for "last seen", epoch ms. Default: now. |
| style? | CSSProperties | Inline styles on the root. |
ServerOfflineBannerComponent#
Replaces the composer while the session's server can't be reached: why, and Retry (when the host can retry and a retry can help).
function ServerOfflineBanner(props: ServerOfflineBannerProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ServerOfflineBannerProps | The server, a fallback name, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| host | HostSummary | undefined | The session's server, or |
| name? | string | The name to use when the server is gone. Default: the |
| style? | CSSProperties | Inline styles on the root. |
ServerUpdatePanelComponent#
Renders a server's auto-update state and actions.
function ServerUpdatePanel(props: ServerUpdatePanelProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | ServerUpdatePanelProps | The server, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before Install now. Default: the provider's confirm. |
| host | HostSummary | The server. |
| style? | CSSProperties | Inline styles on the root. |
SyncAccountsComponent#
Renders this computer's accounts against the server's.
function SyncAccounts(props: SyncAccountsProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | SyncAccountsProps | The server, the accounts, the copied keys, |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| accounts | readonly HostSyncAccount[] | This computer's providers with an API key or a sign-in ( |
| className? | string | Extra classes on the root. |
| host | HostSummary | The server. |
| keys | readonly string[] | Providers whose API key is copied. |
| onToggleKey | (provider: { key: string; label: string }) => void | A key's box was ticked or unticked. |
| style? | CSSProperties | Inline styles on the root. |
SyncMarkerComponent#
Renders where a server's setting came from, or nothing when sync never wrote it.
function SyncMarker(props: SyncMarkerProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | SyncMarkerProps | The server, its record, the setting's key, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| hostId | string | The server whose setting it is. |
| settingKey | string | The setting's key ( |
| status | SyncStatus | null | The server's sync record ( |
| style? | CSSProperties | Inline styles on the root. |
SyncOutcomeBadgeComponent#
Renders a server's last push outcome, or nothing.
function SyncOutcomeBadge(props: SyncOutcomeBadgeProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | SyncOutcomeBadgeProps | The sync |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| state | HostSyncState | null | The server's sync state ( |
| style? | CSSProperties | Inline styles on the root. |
TokensPanelComponent#
Renders a server's tokens and the create form. Nothing without the host's tokens, or while the connection's
permissions are not known.
function TokensPanel(props: TokensPanelProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | TokensPanelProps | The server, |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before Revoke. Default: the provider's confirm. |
| host | HostSummary | The server whose tokens to manage. |
| now? | number | The current time for the dates, epoch ms. Default: now. |
| style? | CSSProperties | Inline styles on the root. |
Functions#
escapeCancelsFunction#
Escape inside an inline form closes that form, not the dialog around it.
function escapeCancels(cancel: () => void): (event: KeyboardEvent) => voidParameters
| Name | Type | Description |
|---|---|---|
| cancel | () => void | Closes the form. |
Returns
(event: KeyboardEvent) => voidhostsSettingsSectionFunction#
The Hosts section, over the nearest MachinesProvider.
function hostsSettingsSection(
props?: HostsSectionProps,
overrides?: PreferenceSectionOverrides,
): SettingsSectionParameters
| Name | Type | Default | Description |
|---|---|---|---|
| props? | HostsSectionProps | {} | What |
| overrides? | PreferenceSectionOverrides | {} | The title, description or group, instead of the layout's. |
Returns
useHostCapabilitiesFunction#
A host's capabilities. Nothing is asked while enabled is false (an unreachable server) or without the host's
capabilities.
function useHostCapabilities(hostId: string, enabled?: boolean): HostCapabilitiesStateParameters
| Name | Type | Default | Description |
|---|---|---|---|
| hostId | string | The host ( | |
| enabled? | boolean | true | Whether to ask. Default true. |
Returns
useHostSyncFunction#
hostId's sync state, kept current (re-read on every change the backend reports); null before the first read,
when it can't be read, or without the host's sync.state.
function useHostSync(
hostId: string,
): { reload: () => Promise<void>; state: HostSyncState | null }Parameters
| Name | Type | Description |
|---|---|---|
| hostId | string | The server. |
Returns
{ reload: () => Promise<void>; state: HostSyncState | null }useLentServersFunction#
The machine names of the servers this computer uses as machines (local@<server>), so a picker can show those
servers once, as servers. Listens to the host's links only while enabled.
function useLentServers(enabled: boolean): ReadonlySet<string>Parameters
| Name | Type | Description |
|---|---|---|
| enabled | boolean | Whether to listen (the app has servers and shows a picker). |
Returns
ReadonlySet<string>useMachinesConfirmFunction#
Returns how the machines components ask before a destructive action.
function useMachinesConfirm(): MachinesConfirmReturns
useMachinesHostFunction#
Returns the MachinesHost from the nearest MachinesProvider, or an empty host outside one.
function useMachinesHost(): MachinesHostReturns
useMachinesLabelsFunction#
Returns the machines components' strings: the defaults merged with any overrides given to MachinesProvider or LabelsProvider.
function useMachinesLabels(): { machinesAccess: (scope: string) => 'Admin access' | 'Chat access'; machinesAdd: string; machinesAdding: string; machinesAddServer: string; machinesAdminOnly: string; machinesAgo: (short: string) => string; machinesAutoUpdateTitle: string; machinesCancel: string; machinesCapabilitiesTitle: string; machinesCapsAsMachine: string; machinesCapsAvailable: string; machinesCapsAvailableA11y: string; machinesCapsChecking: string; machinesCapsClone: string; machinesCapsCreateFolders: string; machinesCapsEnvAvailable: string; machinesCapsFeatures: string; machinesCapsFree: (bytes: number) => string; machinesCapsInstall: string; machinesCapsInstallCopy: (command: string) => string; machinesCapsInstallCopyLabel: (tool: string) => string; machinesCapsInstalled: (tool: string) => string; machinesCapsInstallFailed: (tool: string) => string; machinesCapsInstalling: string; machinesCapsInstallLabel: (tool: string) => string; machinesCapsInstallPage: string; machinesCapsInstallPageLabel: (tool: string) => string; machinesCapsMissing: string; machinesCapsMissingA11y: string; machinesCapsMore: (count: number) => string; machinesCapsNotAvailable: string; machinesCapsOs: Record<string, string>; machinesCapsPartial: string; machinesCapsRecheck: string; machinesCapsRemoteInstalls: string; machinesCapsSandbox: string; machinesCapsSync: string; machinesCapsTools: string; machinesChangeUrl: string; machinesChangingUrl: string; machinesCheckError: (error: HostCheckError, message: string) => string; machinesConnectingTo: (name: string) => string; machinesCopiedText: (text: string) => string; machinesCopy: string; machinesCopyText: (text: string) => string; machinesDaemon: string; machinesDaemonActions: string; machinesDaemonConnected: string; machinesDaemonConnecting: string; machinesDaemonCopied: string; machinesDaemonCopy: string; machinesDaemonCopying: string; machinesDaemonDays: (days: number) => string; machinesDaemonHours: (hours: number, minutes: number) => string; machinesDaemonMenu: (health: string) => string; machinesDaemonMinutes: (minutes: number) => string; machinesDaemonModeOff: string; machinesDaemonModeOffHint: string; machinesDaemonModeOn: string; machinesDaemonModeOnHint: string; machinesDaemonNewer: string; machinesDaemonNewerDetail: (versions: string) => string; machinesDaemonOff: string; machinesDaemonOffDetail: string; machinesDaemonOlder: string; machinesDaemonOlderDetail: (versions: string) => string; machinesDaemonOnIt: string; machinesDaemonPid: (pid: number) => string; machinesDaemonProtocol: (version: number) => string; machinesDaemonReconnect: string; machinesDaemonReconnected: string; machinesDaemonReconnectHint: string; machinesDaemonReconnecting: string; machinesDaemonRefused: string; machinesDaemonRelaunch: string; machinesDaemonRelaunchHint: string; machinesDaemonRestart: string; machinesDaemonRestartDeferred: string; machinesDaemonRestarted: string; machinesDaemonRestartHint: string; machinesDaemonRestarting: string; machinesDaemonRestartNow: string; machinesDaemonRestartNowConfirm: string; machinesDaemonRestartNowHint: string; machinesDaemonRetiring: string; machinesDaemonRetiringDetail: string; machinesDaemonRetrying: string; machinesDaemonRunning: string; machinesDaemonStop: string; machinesDaemonStopAll: string; machinesDaemonStopped: (title: string) => string; machinesDaemonStoppedAll: (count: number | void) => string; machinesDaemonStopping: string; machinesDaemonStoppingAll: string; machinesDaemonUnreachable: string; machinesDaemonUp: (uptime: string) => string; machinesDaemonVersions: (daemon: number, window: number) => string; machinesDaemonWaitingForYou: string; machinesDeviceToken: string; machinesDeviceTokenPlaceholder: string; machinesDismiss: string; machinesError: (error: MachinesError) => string; machinesFactConnected: (ago: string) => string; machinesFactScope: (scope: string) => string; machinesFactServerName: (name: string) => string; machinesFactUptime: (uptime: string) => string; machinesFactVersion: (version: string) => string; machinesFolders: string; machinesForget: string; machinesForgetLabel: (machine: string) => string; machinesForgetMessage: (name: string) => string; machinesForgetTitle: (machine: string) => string; machinesGetAdmin: string; machinesGetAdminCopy: string; machinesGetAdminPairNext: string; machinesGetAdminRun: string; machinesGetAdminSave: string; machinesGetAdminSaved: string; machinesGetAdminSaving: string; machinesGetAdminToken: string; machinesGetAdminTokenField: string; machinesGpus: string; machinesHostActions: (name: string) => string; machinesHostName: string; machinesHostRemoved: (notice: string) => string; machinesHostStatuses: { 'auth-refused': string; connected: string; connecting: string; identity: string; local: string; offline: string; reconnecting: string; 'version-mismatch': string }; machinesHostsTitle: string; machinesInviteCommand: string; machinesInviteCopy: string; machinesInviteCreate: string; machinesInviteCreating: string; machinesInviteDone: string; machinesInviteExpires: (time: string) => string; machinesInviteForm: string; machinesInviteHint: string; machinesInviteName: string; machinesInviteNamePlaceholder: string; machinesInviteNameRule: string; machinesInviteNeedsAdmin: string; machinesInviteOpen: string; machinesInviteTitle: (name: string) => string; machinesLinkOff: string; machinesListEmpty: string; machinesListNotPermitted: string; machinesListTitle: (name: string) => string; machinesLocalDescription: string; machinesMachinesTitle: string; machinesNameOptional: string; machinesOfflineAuthRefused: (name: string) => string; machinesOfflineConnecting: (name: string) => string; machinesOfflineIdentity: (name: string) => string; machinesOfflineOther: (name: string, status: string) => string; machinesOfflineRemoved: (name: string) => string; machinesOfflineSince: (when: string) => string; machinesOfflineVersion: (name: string, error?: string) => string; machinesOkLine: (name: string, version?: string, latencyMs?: number) => string; machinesOpenHost: (name: string) => string; machinesRemove: string; machinesRemoveFailed: (name: string, detail: string) => string; machinesRemoveMessage: string; machinesRemoveTitle: (name: string) => string; machinesRemoving: string; machinesRename: string; machinesRenaming: string; machinesRetry: string; machinesSave: string; machinesSavedHostsError: (detail: string) => string; machinesServerUrl: string; machinesServerUrlPlaceholder: string; machinesShareAddFolder: string; machinesShared: (roots: string, name: string) => string; machinesShareFolders: string; machinesShareForm: string; machinesShareHint: (name: string) => string; machinesShareName: (name: string) => string; machinesShareNamePlaceholder: string; machinesShareOpen: string; machinesShareStart: string; machinesShareStop: string; machinesShareTitle: (name: string) => string; machinesShareToken: string; machinesShareTokenPlaceholder: string; machinesSharing: (name: string) => string; machinesStatus: (status: 'online' | 'offline') => 'online' | 'offline'; machinesStopping: string; machinesSyncAccounts: string; machinesSyncAgain: string; machinesSyncApiKey: string; machinesSyncBlocked: (reason: SyncBlockedReason, name: string) => string; machinesSyncCategories: Record<SyncCategory, { description: string; label: string }>; machinesSyncComplete: string; machinesSyncCopyKey: (label: string) => string; machinesSyncEditedHere: (device: string) => string; machinesSyncEditedOn: (name: string) => string; machinesSyncEditedOnTitle: (name: string) => string; machinesSyncEnvConfirm: string; machinesSyncEnvMessage: (name: string) => string; machinesSyncEnvTitle: (name: string) => string; machinesSyncFrom: (device: string) => string; machinesSyncKeyConfirm: string; machinesSyncKeyMessage: (name: string) => string; machinesSyncKeyTitle: (label: string, name: string) => string; machinesSyncMode: string; machinesSyncModeDescription: (device: string | undefined, name: string) => string; machinesSyncModes: Record<SyncMode, string>; machinesSyncMoreLines: (count: number) => string; machinesSyncNoAccounts: string; machinesSyncNotPushed: string; machinesSyncNotSyncable: (list: string) => string; machinesSyncNotSynced: string; machinesSyncOffline: string; machinesSyncOnHost: (name: string) => string; machinesSyncOutcomeDetails: (label: string) => string; machinesSyncPartial: string; machinesSyncPushed: (ago: string) => string; machinesSyncPushing: string; machinesSyncPushNow: string; machinesSyncSetUpOn: (name: string) => string; machinesSyncSignedInThere: string; machinesSyncSignIn: (label: string) => string; machinesSyncSignInThere: string; machinesSyncStartsWithHosts: string; machinesSyncStaysHere: string; machinesSyncStdio: (name: string, list: string) => string; machinesSyncSyncedFrom: (device: string) => string; machinesSyncTakeOver: string; machinesSyncTakeOverMessage: (name: string, other: string) => string; machinesSyncTakeOverTitle: (name: string) => string; machinesSyncTitle: string; machinesSyncTooOld: string; machinesSyncWaiting: string; machinesSyncWaitingList: (categories: string) => string; machinesSyncWarnings: string; machinesSyncWhat: string; machinesTest: string; machinesTesting: string; machinesThisApp: string; machinesThisServer: string; machinesTokensCreate: string; machinesTokensCreated: (name: string) => string; machinesTokensCreatedAt: (ago: string) => string; machinesTokensCreating: string; machinesTokensEmpty: string; machinesTokensExpired: string; machinesTokensExpires: (date: string) => string; machinesTokensList: string; machinesTokensName: string; machinesTokensNamePlaceholder: string; machinesTokensNeverUsed: string; machinesTokensRevoke: string; machinesTokensRevoked: string; machinesTokensRevokeLabel: (name: string) => string; machinesTokensRevokeMessage: string; machinesTokensRevokeTitle: (name: string) => string; machinesTokensScope: string; machinesTokensScopes: Record<ServerTokenScope, string>; machinesTokensUsed: (ago: string) => string; machinesUpdateCheck: string; machinesUpdateChecking: string; machinesUpdateFrom: (version: string) => string; machinesUpdateInstall: string; machinesUpdateInstallMessage: string; machinesUpdateInstallTitle: (latest?: string) => string; machinesUpdateOff: string; machinesUpdateOn: string; machinesUpdateOtherWay: string; machinesUpdateOut: (version: string) => string; machinesUpdateRolledBack: (version: string) => string; machinesUpdateStateChecking: string; machinesUpdateStateDownloading: (latest?: string) => string; machinesUpdateStateError: string; machinesUpdateStateInstalling: (latest?: string) => string; machinesUpdateStateReady: (latest?: string) => string; machinesUpdateStateWaiting: (latest?: string) => string; machinesUpdateStateWaitingOn: (latest: string | undefined, blockers: readonly ('work' | 'terminals')[], since: string) => string; machinesUpdateTurnOff: string; machinesUpdateTurnOn: string; machinesUpdateUnsupported: (name: string) => string; machinesUpdateUpToDate: string; machinesUpdateVersion: (version: string) => string; machinesUrlChanged: (name: string, url: string) => string; machinesUse: string; machinesUseHint: (name: string) => string; machinesUseMachineName: (machine: string) => string; machinesUseNotLent: (name: string) => string; machinesUseStop: string; machinesUseTitle: (name: string) => string; machinesVersion: (version: string) => string; machinesVersionDiffers: (version: string, server: string) => string; machinesWaiting: (machine: string) => string }Returns
{ machinesAccess: (scope: string) => 'Admin access' | 'Chat access'; machinesAdd: string; machinesAdding: string; machinesAddServer: string; machinesAdminOnly: string; machinesAgo: (short: string) => string; machinesAutoUpdateTitle: string; machinesCancel: string; machinesCapabilitiesTitle: string; machinesCapsAsMachine: string; machinesCapsAvailable: string; machinesCapsAvailableA11y: string; machinesCapsChecking: string; machinesCapsClone: string; machinesCapsCreateFolders: string; machinesCapsEnvAvailable: string; machinesCapsFeatures: string; machinesCapsFree: (bytes: number) => string; machinesCapsInstall: string; machinesCapsInstallCopy: (command: string) => string; machinesCapsInstallCopyLabel: (tool: string) => string; machinesCapsInstalled: (tool: string) => string; machinesCapsInstallFailed: (tool: string) => string; machinesCapsInstalling: string; machinesCapsInstallLabel: (tool: string) => string; machinesCapsInstallPage: string; machinesCapsInstallPageLabel: (tool: string) => string; machinesCapsMissing: string; machinesCapsMissingA11y: string; machinesCapsMore: (count: number) => string; machinesCapsNotAvailable: string; machinesCapsOs: Record<string, string>; machinesCapsPartial: string; machinesCapsRecheck: string; machinesCapsRemoteInstalls: string; machinesCapsSandbox: string; machinesCapsSync: string; machinesCapsTools: string; machinesChangeUrl: string; machinesChangingUrl: string; machinesCheckError: (error: HostCheckError, message: string) => string; machinesConnectingTo: (name: string) => string; machinesCopiedText: (text: string) => string; machinesCopy: string; machinesCopyText: (text: string) => string; machinesDaemon: string; machinesDaemonActions: string; machinesDaemonConnected: string; machinesDaemonConnecting: string; machinesDaemonCopied: string; machinesDaemonCopy: string; machinesDaemonCopying: string; machinesDaemonDays: (days: number) => string; machinesDaemonHours: (hours: number, minutes: number) => string; machinesDaemonMenu: (health: string) => string; machinesDaemonMinutes: (minutes: number) => string; machinesDaemonModeOff: string; machinesDaemonModeOffHint: string; machinesDaemonModeOn: string; machinesDaemonModeOnHint: string; machinesDaemonNewer: string; machinesDaemonNewerDetail: (versions: string) => string; machinesDaemonOff: string; machinesDaemonOffDetail: string; machinesDaemonOlder: string; machinesDaemonOlderDetail: (versions: string) => string; machinesDaemonOnIt: string; machinesDaemonPid: (pid: number) => string; machinesDaemonProtocol: (version: number) => string; machinesDaemonReconnect: string; machinesDaemonReconnected: string; machinesDaemonReconnectHint: string; machinesDaemonReconnecting: string; machinesDaemonRefused: string; machinesDaemonRelaunch: string; machinesDaemonRelaunchHint: string; machinesDaemonRestart: string; machinesDaemonRestartDeferred: string; machinesDaemonRestarted: string; machinesDaemonRestartHint: string; machinesDaemonRestarting: string; machinesDaemonRestartNow: string; machinesDaemonRestartNowConfirm: string; machinesDaemonRestartNowHint: string; machinesDaemonRetiring: string; machinesDaemonRetiringDetail: string; machinesDaemonRetrying: string; machinesDaemonRunning: string; machinesDaemonStop: string; machinesDaemonStopAll: string; machinesDaemonStopped: (title: string) => string; machinesDaemonStoppedAll: (count: number | void) => string; machinesDaemonStopping: string; machinesDaemonStoppingAll: string; machinesDaemonUnreachable: string; machinesDaemonUp: (uptime: string) => string; machinesDaemonVersions: (daemon: number, window: number) => string; machinesDaemonWaitingForYou: string; machinesDeviceToken: string; machinesDeviceTokenPlaceholder: string; machinesDismiss: string; machinesError: (error: MachinesError) => string; machinesFactConnected: (ago: string) => string; machinesFactScope: (scope: string) => string; machinesFactServerName: (name: string) => string; machinesFactUptime: (uptime: string) => string; machinesFactVersion: (version: string) => string; machinesFolders: string; machinesForget: string; machinesForgetLabel: (machine: string) => string; machinesForgetMessage: (name: string) => string; machinesForgetTitle: (machine: string) => string; machinesGetAdmin: string; machinesGetAdminCopy: string; machinesGetAdminPairNext: string; machinesGetAdminRun: string; machinesGetAdminSave: string; machinesGetAdminSaved: string; machinesGetAdminSaving: string; machinesGetAdminToken: string; machinesGetAdminTokenField: string; machinesGpus: string; machinesHostActions: (name: string) => string; machinesHostName: string; machinesHostRemoved: (notice: string) => string; machinesHostStatuses: { 'auth-refused': string; connected: string; connecting: string; identity: string; local: string; offline: string; reconnecting: string; 'version-mismatch': string }; machinesHostsTitle: string; machinesInviteCommand: string; machinesInviteCopy: string; machinesInviteCreate: string; machinesInviteCreating: string; machinesInviteDone: string; machinesInviteExpires: (time: string) => string; machinesInviteForm: string; machinesInviteHint: string; machinesInviteName: string; machinesInviteNamePlaceholder: string; machinesInviteNameRule: string; machinesInviteNeedsAdmin: string; machinesInviteOpen: string; machinesInviteTitle: (name: string) => string; machinesLinkOff: string; machinesListEmpty: string; machinesListNotPermitted: string; machinesListTitle: (name: string) => string; machinesLocalDescription: string; machinesMachinesTitle: string; machinesNameOptional: string; machinesOfflineAuthRefused: (name: string) => string; machinesOfflineConnecting: (name: string) => string; machinesOfflineIdentity: (name: string) => string; machinesOfflineOther: (name: string, status: string) => string; machinesOfflineRemoved: (name: string) => string; machinesOfflineSince: (when: string) => string; machinesOfflineVersion: (name: string, error?: string) => string; machinesOkLine: (name: string, version?: string, latencyMs?: number) => string; machinesOpenHost: (name: string) => string; machinesRemove: string; machinesRemoveFailed: (name: string, detail: string) => string; machinesRemoveMessage: string; machinesRemoveTitle: (name: string) => string; machinesRemoving: string; machinesRename: string; machinesRenaming: string; machinesRetry: string; machinesSave: string; machinesSavedHostsError: (detail: string) => string; machinesServerUrl: string; machinesServerUrlPlaceholder: string; machinesShareAddFolder: string; machinesShared: (roots: string, name: string) => string; machinesShareFolders: string; machinesShareForm: string; machinesShareHint: (name: string) => string; machinesShareName: (name: string) => string; machinesShareNamePlaceholder: string; machinesShareOpen: string; machinesShareStart: string; machinesShareStop: string; machinesShareTitle: (name: string) => string; machinesShareToken: string; machinesShareTokenPlaceholder: string; machinesSharing: (name: string) => string; machinesStatus: (status: 'online' | 'offline') => 'online' | 'offline'; machinesStopping: string; machinesSyncAccounts: string; machinesSyncAgain: string; machinesSyncApiKey: string; machinesSyncBlocked: (reason: SyncBlockedReason, name: string) => string; machinesSyncCategories: Record<SyncCategory, { description: string; label: string }>; machinesSyncComplete: string; machinesSyncCopyKey: (label: string) => string; machinesSyncEditedHere: (device: string) => string; machinesSyncEditedOn: (name: string) => string; machinesSyncEditedOnTitle: (name: string) => string; machinesSyncEnvConfirm: string; machinesSyncEnvMessage: (name: string) => string; machinesSyncEnvTitle: (name: string) => string; machinesSyncFrom: (device: string) => string; machinesSyncKeyConfirm: string; machinesSyncKeyMessage: (name: string) => string; machinesSyncKeyTitle: (label: string, name: string) => string; machinesSyncMode: string; machinesSyncModeDescription: (device: string | undefined, name: string) => string; machinesSyncModes: Record<SyncMode, string>; machinesSyncMoreLines: (count: number) => string; machinesSyncNoAccounts: string; machinesSyncNotPushed: string; machinesSyncNotSyncable: (list: string) => string; machinesSyncNotSynced: string; machinesSyncOffline: string; machinesSyncOnHost: (name: string) => string; machinesSyncOutcomeDetails: (label: string) => string; machinesSyncPartial: string; machinesSyncPushed: (ago: string) => string; machinesSyncPushing: string; machinesSyncPushNow: string; machinesSyncSetUpOn: (name: string) => string; machinesSyncSignedInThere: string; machinesSyncSignIn: (label: string) => string; machinesSyncSignInThere: string; machinesSyncStartsWithHosts: string; machinesSyncStaysHere: string; machinesSyncStdio: (name: string, list: string) => string; machinesSyncSyncedFrom: (device: string) => string; machinesSyncTakeOver: string; machinesSyncTakeOverMessage: (name: string, other: string) => string; machinesSyncTakeOverTitle: (name: string) => string; machinesSyncTitle: string; machinesSyncTooOld: string; machinesSyncWaiting: string; machinesSyncWaitingList: (categories: string) => string; machinesSyncWarnings: string; machinesSyncWhat: string; machinesTest: string; machinesTesting: string; machinesThisApp: string; machinesThisServer: string; machinesTokensCreate: string; machinesTokensCreated: (name: string) => string; machinesTokensCreatedAt: (ago: string) => string; machinesTokensCreating: string; machinesTokensEmpty: string; machinesTokensExpired: string; machinesTokensExpires: (date: string) => string; machinesTokensList: string; machinesTokensName: string; machinesTokensNamePlaceholder: string; machinesTokensNeverUsed: string; machinesTokensRevoke: string; machinesTokensRevoked: string; machinesTokensRevokeLabel: (name: string) => string; machinesTokensRevokeMessage: string; machinesTokensRevokeTitle: (name: string) => string; machinesTokensScope: string; machinesTokensScopes: Record<ServerTokenScope, string>; machinesTokensUsed: (ago: string) => string; machinesUpdateCheck: string; machinesUpdateChecking: string; machinesUpdateFrom: (version: string) => string; machinesUpdateInstall: string; machinesUpdateInstallMessage: string; machinesUpdateInstallTitle: (latest?: string) => string; machinesUpdateOff: string; machinesUpdateOn: string; machinesUpdateOtherWay: string; machinesUpdateOut: (version: string) => string; machinesUpdateRolledBack: (version: string) => string; machinesUpdateStateChecking: string; machinesUpdateStateDownloading: (latest?: string) => string; machinesUpdateStateError: string; machinesUpdateStateInstalling: (latest?: string) => string; machinesUpdateStateReady: (latest?: string) => string; machinesUpdateStateWaiting: (latest?: string) => string; machinesUpdateStateWaitingOn: (latest: string | undefined, blockers: readonly ('work' | 'terminals')[], since: string) => string; machinesUpdateTurnOff: string; machinesUpdateTurnOn: string; machinesUpdateUnsupported: (name: string) => string; machinesUpdateUpToDate: string; machinesUpdateVersion: (version: string) => string; machinesUrlChanged: (name: string, url: string) => string; machinesUse: string; machinesUseHint: (name: string) => string; machinesUseMachineName: (machine: string) => string; machinesUseNotLent: (name: string) => string; machinesUseStop: string; machinesUseTitle: (name: string) => string; machinesVersion: (version: string) => string; machinesVersionDiffers: (version: string, server: string) => string; machinesWaiting: (machine: string) => string }useOnlineMachinesFunction#
The names of the machines last heard online, from every host; empty without the host's machines.
function useOnlineMachines(): ReadonlySet<string>Returns
ReadonlySet<string>usePermittedFunction#
Whether the host may do action right now (its permitted store). Re-renders when that changes.
function usePermitted(action: MachinesAction): booleanParameters
| Name | Type | Description |
|---|---|---|
| action | MachinesAction | The action. |
Returns
booleanusePresenceMapFunction#
Every live session's presence, by session id (list-level decisions: ordering, counts); empty without presence.
function usePresenceMap(): ReadonlyMap<string, SessionPresence>Returns
ReadonlyMap<string, SessionPresence>useServerSyncStatusFunction#
A server's sync record, kept current; null for This computer (hostId null), a host without sync, or a server
without sync.
function useServerSyncStatus(hostId: string | null): SyncStatus | nullParameters
| Name | Type | Description |
|---|---|---|
| hostId | string | null | The server, or |
Returns
SyncStatus | nulluseSessionPresenceFunction#
One session's presence; re-renders only when that session's presence changes. null without presence.
function useSessionPresence(sessionId: string | null): SessionPresence | nullParameters
| Name | Type | Description |
|---|---|---|
| sessionId | string | null | The session, or |
Returns
SessionPresence | nullConstants#
HOST_CARD_ICON_CLASSConstant#
The icon well of a host card.
const HOST_CARD_ICON_CLASS: 'zg-well shrink-0 inline-flex items-center justify-center size-7 rounded-zg-md text-sm text-[var(--zg-text-muted)]'HOST_NAME_MAXConstant#
The desktop app's hosts:* limits, mirrored so a field can't take more than it accepts.
const HOST_NAME_MAX = 200HOST_TOKEN_MAXConstant#
The longest device token the desktop app accepts.
const HOST_TOKEN_MAX = 4096HOST_URL_MAXConstant#
The longest server URL the desktop app accepts.
const HOST_URL_MAX = 2048Interfaces#
AddServerFormPropsInterface#
Props for AddServerForm.
interface AddServerFormPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the form. |
| idPrefix? | string | The fields' id prefix (two forms on one page). Default |
| onAdded | (result: { host?: HostSummary; latencyMs?: number; name: string; ok: true; serverVersion?: string }) => void | Promise<void> | Called after the server was saved. |
| onCancel | () => void | Called when the user cancels. |
| style? | CSSProperties | Inline styles on the form. |
CapabilitiesViewPropsInterface#
Props for CapabilitiesView.
interface CapabilitiesViewPropsProperties
| Name | Type | Description |
|---|---|---|
| caps | HostCapabilities | null | The host's capabilities; |
| checking | boolean | A check is out (the Re-check button waits). |
| className? | string | Classes merged on the root. |
| error | MachinesError | null | Why the last check failed. |
| installed? | { name: string; ok: boolean; output: string } | null | How the last install went: its output shows under the tools when it failed. |
| installing? | string | null | The tool being installed. |
| installRestricted? | boolean | This connection may not install (a chat token): Install shows, Admin only. |
| local? | boolean | This computer: it serves no clients, so what it allows is not listed. |
| onInstall? | (name: string) => void | Installs a missing tool there. Absent: a missing tool offers nothing. |
| onRecheck | () => void | Probes again. |
| style? | CSSProperties | Inline styles on the root. |
CapabilityTagsPropsInterface#
Props for CapabilityTags.
interface CapabilityTagsPropsProperties
| Name | Type | Description |
|---|---|---|
| caps | HostCapabilities | null | The host's capabilities; nothing shows without them or for an older server's partial answer. |
ComposerNoticePropsInterface#
Props for ComposerNotice.
interface ComposerNoticePropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| onDismiss | () => void | Called when the user dismisses it. |
| style? | CSSProperties | Inline styles on the root. |
| testId? | string | The root's |
| text | string | What happened. |
CopyTextPropsInterface#
Props for CopyText.
interface CopyTextPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the button. |
| field? | boolean | Shown as a full-width field (a well), not inline text. |
| style? | CSSProperties | Inline styles on the button. |
| text | string | The text shown and copied. |
DaemonMenuPropsInterface#
Props for DaemonMenu.
interface DaemonMenuPropsProperties
| Name | Type | Description |
|---|---|---|
| attention? | number | Sessions waiting for the user, for the orb. |
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before "Restart daemon now". Default: the provider's confirm. |
| daemonMode? | boolean | Daemon mode is on: the toggle row offers to turn it off. |
| onDaemonModeChange? | (on: boolean) => void | Turns daemon mode on or off. Absent: no toggle row. |
| onOpenSession? | (sessionId: string) => void | Opens a session the daemon holds. Absent: its row does nothing. |
| running? | number | Runs on the daemon now, for the orb. |
| sessionTitle? | (sessionId: string) => string | A session's title for its row and the diagnostics. Default: the first 8 characters of its id. |
| style? | CSSProperties | Inline styles on the root. |
HostCapabilitiesStateInterface#
What useHostCapabilities returns.
interface HostCapabilitiesStateProperties
| Name | Type | Description |
|---|---|---|
| caps | HostCapabilities | null | The last answer; |
| checking | boolean | A check is out. |
| error | MachinesError | null | Why the last check failed; |
| install? | (name: string) => Promise<void> | Installs a missing tool there; absent without the host's |
| installed | { name: string; ok: boolean; output: string } | null | How the last install went. |
| installing | string | null | The tool being installed. |
| recheck | () => Promise<void> | Probes again, bypassing the backend's cache. |
HostRemovedBannerPropsInterface#
Props for HostRemovedBanner.
interface HostRemovedBannerPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| notice | string | What was removed ( |
| onDismiss | () => void | Called when the user dismisses it. |
| style? | CSSProperties | Inline styles on the root. |
HostSignInPropsInterface#
Props for HostSignIn.
interface HostSignInPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| hostId | string | The server. |
| hostName | string | Its name, for the lines. |
| label | string | What is being signed in to, for the lines. |
| onClose | () => void | Closes the strip (Cancel or Close). |
| onDone? | () => void | The server stored the tokens. |
| style? | CSSProperties | Inline styles on the root. |
| target | HostSignInTarget | What to sign in to there. Read once, when the sign-in starts. |
HostsSectionPropsInterface#
Props for HostsSection.
interface HostsSectionPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before removing a server, installing an update, copying a secret. Default: the provider's confirm. |
| now? | number | "Now" for the relative dates (screenshots). Default: the clock. |
| style? | CSSProperties | Inline styles on the root. |
HostSyncPanelPropsInterface#
Props for HostSyncPanel.
interface HostSyncPanelPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before copying a secret or taking over. Default: the provider's confirm. |
| host | HostSummary | The server. |
| style? | CSSProperties | Inline styles on the root. |
MachinesProviderPropsInterface#
Props for MachinesProvider.
interface MachinesProviderPropsProperties
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The components that read from |
| confirm? | MachinesConfirm | Asks before a destructive action, on the app's modal layer. Default: a |
| host | MachinesHost | The host the machines components read from and act through. |
| labels? | Partial<{ machinesAccess: (scope: string) => 'Admin access' | 'Chat access'; machinesAdd: string; machinesAdding: string; machinesAddServer: string; machinesAdminOnly: string; machinesAgo: (short: string) => string; machinesAutoUpdateTitle: string; machinesCancel: string; machinesCapabilitiesTitle: string; machinesCapsAsMachine: string; machinesCapsAvailable: string; machinesCapsAvailableA11y: string; machinesCapsChecking: string; machinesCapsClone: string; machinesCapsCreateFolders: string; machinesCapsEnvAvailable: string; machinesCapsFeatures: string; machinesCapsFree: (bytes: number) => string; machinesCapsInstall: string; machinesCapsInstallCopy: (command: string) => string; machinesCapsInstallCopyLabel: (tool: string) => string; machinesCapsInstalled: (tool: string) => string; machinesCapsInstallFailed: (tool: string) => string; machinesCapsInstalling: string; machinesCapsInstallLabel: (tool: string) => string; machinesCapsInstallPage: string; machinesCapsInstallPageLabel: (tool: string) => string; machinesCapsMissing: string; machinesCapsMissingA11y: string; machinesCapsMore: (count: number) => string; machinesCapsNotAvailable: string; machinesCapsOs: Record<string, string>; machinesCapsPartial: string; machinesCapsRecheck: string; machinesCapsRemoteInstalls: string; machinesCapsSandbox: string; machinesCapsSync: string; machinesCapsTools: string; machinesChangeUrl: string; machinesChangingUrl: string; machinesCheckError: (error: HostCheckError, message: string) => string; machinesConnectingTo: (name: string) => string; machinesCopiedText: (text: string) => string; machinesCopy: string; machinesCopyText: (text: string) => string; machinesDaemon: string; machinesDaemonActions: string; machinesDaemonConnected: string; machinesDaemonConnecting: string; machinesDaemonCopied: string; machinesDaemonCopy: string; machinesDaemonCopying: string; machinesDaemonDays: (days: number) => string; machinesDaemonHours: (hours: number, minutes: number) => string; machinesDaemonMenu: (health: string) => string; machinesDaemonMinutes: (minutes: number) => string; machinesDaemonModeOff: string; machinesDaemonModeOffHint: string; machinesDaemonModeOn: string; machinesDaemonModeOnHint: string; machinesDaemonNewer: string; machinesDaemonNewerDetail: (versions: string) => string; machinesDaemonOff: string; machinesDaemonOffDetail: string; machinesDaemonOlder: string; machinesDaemonOlderDetail: (versions: string) => string; machinesDaemonOnIt: string; machinesDaemonPid: (pid: number) => string; machinesDaemonProtocol: (version: number) => string; machinesDaemonReconnect: string; machinesDaemonReconnected: string; machinesDaemonReconnectHint: string; machinesDaemonReconnecting: string; machinesDaemonRefused: string; machinesDaemonRelaunch: string; machinesDaemonRelaunchHint: string; machinesDaemonRestart: string; machinesDaemonRestartDeferred: string; machinesDaemonRestarted: string; machinesDaemonRestartHint: string; machinesDaemonRestarting: string; machinesDaemonRestartNow: string; machinesDaemonRestartNowConfirm: string; machinesDaemonRestartNowHint: string; machinesDaemonRetiring: string; machinesDaemonRetiringDetail: string; machinesDaemonRetrying: string; machinesDaemonRunning: string; machinesDaemonStop: string; machinesDaemonStopAll: string; machinesDaemonStopped: (title: string) => string; machinesDaemonStoppedAll: (count: number | void) => string; machinesDaemonStopping: string; machinesDaemonStoppingAll: string; machinesDaemonUnreachable: string; machinesDaemonUp: (uptime: string) => string; machinesDaemonVersions: (daemon: number, window: number) => string; machinesDaemonWaitingForYou: string; machinesDeviceToken: string; machinesDeviceTokenPlaceholder: string; machinesDismiss: string; machinesError: (error: MachinesError) => string; machinesFactConnected: (ago: string) => string; machinesFactScope: (scope: string) => string; machinesFactServerName: (name: string) => string; machinesFactUptime: (uptime: string) => string; machinesFactVersion: (version: string) => string; machinesFolders: string; machinesForget: string; machinesForgetLabel: (machine: string) => string; machinesForgetMessage: (name: string) => string; machinesForgetTitle: (machine: string) => string; machinesGetAdmin: string; machinesGetAdminCopy: string; machinesGetAdminPairNext: string; machinesGetAdminRun: string; machinesGetAdminSave: string; machinesGetAdminSaved: string; machinesGetAdminSaving: string; machinesGetAdminToken: string; machinesGetAdminTokenField: string; machinesGpus: string; machinesHostActions: (name: string) => string; machinesHostName: string; machinesHostRemoved: (notice: string) => string; machinesHostStatuses: { 'auth-refused': string; connected: string; connecting: string; identity: string; local: string; offline: string; reconnecting: string; 'version-mismatch': string }; machinesHostsTitle: string; machinesInviteCommand: string; machinesInviteCopy: string; machinesInviteCreate: string; machinesInviteCreating: string; machinesInviteDone: string; machinesInviteExpires: (time: string) => string; machinesInviteForm: string; machinesInviteHint: string; machinesInviteName: string; machinesInviteNamePlaceholder: string; machinesInviteNameRule: string; machinesInviteNeedsAdmin: string; machinesInviteOpen: string; machinesInviteTitle: (name: string) => string; machinesLinkOff: string; machinesListEmpty: string; machinesListNotPermitted: string; machinesListTitle: (name: string) => string; machinesLocalDescription: string; machinesMachinesTitle: string; machinesNameOptional: string; machinesOfflineAuthRefused: (name: string) => string; machinesOfflineConnecting: (name: string) => string; machinesOfflineIdentity: (name: string) => string; machinesOfflineOther: (name: string, status: string) => string; machinesOfflineRemoved: (name: string) => string; machinesOfflineSince: (when: string) => string; machinesOfflineVersion: (name: string, error?: string) => string; machinesOkLine: (name: string, version?: string, latencyMs?: number) => string; machinesOpenHost: (name: string) => string; machinesRemove: string; machinesRemoveFailed: (name: string, detail: string) => string; machinesRemoveMessage: string; machinesRemoveTitle: (name: string) => string; machinesRemoving: string; machinesRename: string; machinesRenaming: string; machinesRetry: string; machinesSave: string; machinesSavedHostsError: (detail: string) => string; machinesServerUrl: string; machinesServerUrlPlaceholder: string; machinesShareAddFolder: string; machinesShared: (roots: string, name: string) => string; machinesShareFolders: string; machinesShareForm: string; machinesShareHint: (name: string) => string; machinesShareName: (name: string) => string; machinesShareNamePlaceholder: string; machinesShareOpen: string; machinesShareStart: string; machinesShareStop: string; machinesShareTitle: (name: string) => string; machinesShareToken: string; machinesShareTokenPlaceholder: string; machinesSharing: (name: string) => string; machinesStatus: (status: 'online' | 'offline') => 'online' | 'offline'; machinesStopping: string; machinesSyncAccounts: string; machinesSyncAgain: string; machinesSyncApiKey: string; machinesSyncBlocked: (reason: SyncBlockedReason, name: string) => string; machinesSyncCategories: Record<SyncCategory, { description: string; label: string }>; machinesSyncComplete: string; machinesSyncCopyKey: (label: string) => string; machinesSyncEditedHere: (device: string) => string; machinesSyncEditedOn: (name: string) => string; machinesSyncEditedOnTitle: (name: string) => string; machinesSyncEnvConfirm: string; machinesSyncEnvMessage: (name: string) => string; machinesSyncEnvTitle: (name: string) => string; machinesSyncFrom: (device: string) => string; machinesSyncKeyConfirm: string; machinesSyncKeyMessage: (name: string) => string; machinesSyncKeyTitle: (label: string, name: string) => string; machinesSyncMode: string; machinesSyncModeDescription: (device: string | undefined, name: string) => string; machinesSyncModes: Record<SyncMode, string>; machinesSyncMoreLines: (count: number) => string; machinesSyncNoAccounts: string; machinesSyncNotPushed: string; machinesSyncNotSyncable: (list: string) => string; machinesSyncNotSynced: string; machinesSyncOffline: string; machinesSyncOnHost: (name: string) => string; machinesSyncOutcomeDetails: (label: string) => string; machinesSyncPartial: string; machinesSyncPushed: (ago: string) => string; machinesSyncPushing: string; machinesSyncPushNow: string; machinesSyncSetUpOn: (name: string) => string; machinesSyncSignedInThere: string; machinesSyncSignIn: (label: string) => string; machinesSyncSignInThere: string; machinesSyncStartsWithHosts: string; machinesSyncStaysHere: string; machinesSyncStdio: (name: string, list: string) => string; machinesSyncSyncedFrom: (device: string) => string; machinesSyncTakeOver: string; machinesSyncTakeOverMessage: (name: string, other: string) => string; machinesSyncTakeOverTitle: (name: string) => string; machinesSyncTitle: string; machinesSyncTooOld: string; machinesSyncWaiting: string; machinesSyncWaitingList: (categories: string) => string; machinesSyncWarnings: string; machinesSyncWhat: string; machinesTest: string; machinesTesting: string; machinesThisApp: string; machinesThisServer: string; machinesTokensCreate: string; machinesTokensCreated: (name: string) => string; machinesTokensCreatedAt: (ago: string) => string; machinesTokensCreating: string; machinesTokensEmpty: string; machinesTokensExpired: string; machinesTokensExpires: (date: string) => string; machinesTokensList: string; machinesTokensName: string; machinesTokensNamePlaceholder: string; machinesTokensNeverUsed: string; machinesTokensRevoke: string; machinesTokensRevoked: string; machinesTokensRevokeLabel: (name: string) => string; machinesTokensRevokeMessage: string; machinesTokensRevokeTitle: (name: string) => string; machinesTokensScope: string; machinesTokensScopes: Record<ServerTokenScope, string>; machinesTokensUsed: (ago: string) => string; machinesUpdateCheck: string; machinesUpdateChecking: string; machinesUpdateFrom: (version: string) => string; machinesUpdateInstall: string; machinesUpdateInstallMessage: string; machinesUpdateInstallTitle: (latest?: string) => string; machinesUpdateOff: string; machinesUpdateOn: string; machinesUpdateOtherWay: string; machinesUpdateOut: (version: string) => string; machinesUpdateRolledBack: (version: string) => string; machinesUpdateStateChecking: string; machinesUpdateStateDownloading: (latest?: string) => string; machinesUpdateStateError: string; machinesUpdateStateInstalling: (latest?: string) => string; machinesUpdateStateReady: (latest?: string) => string; machinesUpdateStateWaiting: (latest?: string) => string; machinesUpdateStateWaitingOn: (latest: string | undefined, blockers: readonly ('work' | 'terminals')[], since: string) => string; machinesUpdateTurnOff: string; machinesUpdateTurnOn: string; machinesUpdateUnsupported: (name: string) => string; machinesUpdateUpToDate: string; machinesUpdateVersion: (version: string) => string; machinesUrlChanged: (name: string, url: string) => string; machinesUse: string; machinesUseHint: (name: string) => string; machinesUseMachineName: (machine: string) => string; machinesUseNotLent: (name: string) => string; machinesUseStop: string; machinesUseTitle: (name: string) => string; machinesVersion: (version: string) => string; machinesVersionDiffers: (version: string, server: string) => string; machinesWaiting: (machine: string) => string }> | Overrides for the machines components' strings. Keys you leave out keep the default English label. |
MachineWaitingBannerPropsInterface#
Props for MachineWaitingBanner.
interface MachineWaitingBannerPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| machine | string | null | The machine the session's run waits for (from its notices, |
| style? | CSSProperties | Inline styles on the root. |
ServerCardPropsInterface#
Props for ServerCard.
interface ServerCardPropsProperties
| Name | Type | Description |
|---|---|---|
| badge? | ReactNode | Shown after the status dot and chip (a sync outcome badge). |
| className? | string | Extra classes on the card. |
| confirm? | MachinesConfirm | Asks before Remove. Default: the provider's confirm. |
| host | HostSummary | The server, with its live status. |
| now? | number | The current time for the facts, epoch ms. Default: now. |
| onChanged? | () => void | Promise<void> | Called after a test, rename, URL change or removal changed what the host holds. |
| saved? | HostSummary | The saved entry, for the dates the live status lacks ( |
| style? | CSSProperties | Inline styles on the card. |
ServerMachinesPanelPropsInterface#
Props for ServerMachinesPanel.
interface ServerMachinesPanelPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before Forget. Default: the provider's confirm. |
| host | HostSummary | The server. |
| now? | number | The current time for "last seen", epoch ms. Default: now. |
| style? | CSSProperties | Inline styles on the root. |
ServerOfflineBannerPropsInterface#
Props for ServerOfflineBanner.
interface ServerOfflineBannerPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| host | HostSummary | undefined | The session's server, or |
| name? | string | The name to use when the server is gone. Default: the |
| style? | CSSProperties | Inline styles on the root. |
ServerUpdatePanelPropsInterface#
Props for ServerUpdatePanel.
interface ServerUpdatePanelPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before Install now. Default: the provider's confirm. |
| host | HostSummary | The server. |
| style? | CSSProperties | Inline styles on the root. |
SyncAccountsPropsInterface#
Props for SyncAccounts.
interface SyncAccountsPropsProperties
| Name | Type | Description |
|---|---|---|
| accounts | readonly HostSyncAccount[] | This computer's providers with an API key or a sign-in ( |
| className? | string | Extra classes on the root. |
| host | HostSummary | The server. |
| keys | readonly string[] | Providers whose API key is copied. |
| onToggleKey | (provider: { key: string; label: string }) => void | A key's box was ticked or unticked. |
| style? | CSSProperties | Inline styles on the root. |
SyncMarkerPropsInterface#
Props for SyncMarker.
interface SyncMarkerPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| hostId | string | The server whose setting it is. |
| settingKey | string | The setting's key ( |
| status | SyncStatus | null | The server's sync record ( |
| style? | CSSProperties | Inline styles on the root. |
SyncOutcomeBadgePropsInterface#
Props for SyncOutcomeBadge.
interface SyncOutcomeBadgePropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| state | HostSyncState | null | The server's sync state ( |
| style? | CSSProperties | Inline styles on the root. |
TokensPanelPropsInterface#
Props for TokensPanel.
interface TokensPanelPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root. |
| confirm? | MachinesConfirm | Asks before Revoke. Default: the provider's confirm. |
| host | HostSummary | The server whose tokens to manage. |
| now? | number | The current time for the dates, epoch ms. Default: now. |
| style? | CSSProperties | Inline styles on the root. |
Types#
MachinesConfirmType#
Asks the user to confirm; resolves with the answer.
type MachinesConfirm = (options: ConfirmOptions) => Promise<boolean>