- {detail.ssh_port > 0 && (
-
-
- SSH
-
-
-
- {sshText}
- } onClick={() => onCopy(sshText)} />
-
-
} onClick={openSSHTerminal}>
- {tr('sshOpenTerminal')}
-
-
{
- if (o) sshPointerClosed.current = false
- setSshMenuOpen(o)
- }}
- >
-
-
-
-
-
-
- {
- if (!(e.target as HTMLElement | null)?.closest('[data-disabled]')) {
- sshPointerClosed.current = true
- }
- }}
- onKeyDownCapture={() => { sshPointerClosed.current = false }}
- onPointerDownOutside={() => { sshPointerClosed.current = true }}
- onCloseAutoFocus={(e) => {
- if (
- sshOpenedByPointer.current
- || sshPointerClosed.current
- || hasVisibleDialog()
- ) {
- e.preventDefault()
- }
- }}
- >
-
- {tr('sshWriteConfig')}
-
-
- {tr('sshOpenVSCode')}
-
-
- { setSshUserDraft(sshUser); setSshUserDialog(true) }}>
- {tr('sshSetUser')}
-
-
-
-
-
-
- )}
- {tools && (
-
-
- {tr('guestToolsTitle')}
-
-
-
- {gtStatus}
-
-
-
- {suspended && showToolsAction && (
-
{tr('suspendedGuestToolsHint')}
- )}
-
- {showToolsAction && (
- }
- busy={busyAction === toolsAction}
- disabled={busy || guestToolsLocked}
- aria-describedby={suspended ? guestToolsHintId : undefined}
- onClick={() => onAction(toolsAction)}
- >
- {tr(toolsActionLabel)}
-
- )}
-
-
- )}
- {tools && showInstallCmd && (
-
-
- {tr('gtInstallSub')}
-
-
-
- {GUEST_TOOLS_INSTALL_CMD}
- } onClick={() => onCopy(GUEST_TOOLS_INSTALL_CMD)} />
- {running && (
- } busy={busyAction === 'type'} disabled={busy} onClick={() => onTypeText(GUEST_TOOLS_INSTALL_CMD)} />
- )}
-
-
-
- )}
- {tools && !gtOff && (
-
-
- {tr('sharedFolder')}
- ~/Desktop/ReimsShare
-
-
- } disabled={busy} onClick={onDeliverFile}>{tr('deliverFileShort')}
- } disabled={busy} onClick={() => onAction('openSharedFolder')}>{tr('openShort')}
-
-
- )}
- {tools && !gtOff && (
-
-
-
{tr('guestToolsPreventSleep')}
- {gtSleepActive && (
-
{tr('guestToolsSleepActive')}
- )}
-
-
-
-
-
- )}
- {canUseHostDNS && (() => {
- const dnsEnabled = hostDNS?.host_dns_enabled ?? false
- const dnsActive = hostDNS?.host_dns_active ?? false
- const dnsStale = hostDNS?.host_dns_config_stale ?? false
- const dnsReported = hostDNS?.host_dns_reported ?? false
- const toolsAttached = !!detail.guest_tools_attached
- const disableCmd = toolsAttached
- ? HOST_DNS_DISABLE_CMD
- : 'sh /private/etc/reims-host-dns/Disable-Host-DNS.command'
- const showApplySub = dnsEnabled && (dnsStale || !dnsActive)
- const showDisableSub = dnsActive || dnsStale || (dnsEnabled && running && !dnsReported)
-
- let dnsStatus: React.ReactNode
- if (hostDNSLoadErr && hostDNS === null) {
- dnsStatus =
{hostDNSLoadErr}
- } else if (dnsEnabled && dnsReported && dnsStale) {
- dnsStatus = (
-
-
- {tr('hostDNSStatusStale')}
-
- )
- } else if (dnsEnabled && dnsReported && dnsActive) {
- dnsStatus = (
-
-
- {tr('hostDNSStatusActive')}
-
- )
- } else if (dnsEnabled) {
- dnsStatus = (
-
-
- {tr('hostDNSStatusPending')}
-
- )
- } else if (dnsReported && (dnsActive || dnsStale)) {
- dnsStatus = (
-
-
- {tr('hostDNSStatusStillActive')}
-
- )
- } else {
- dnsStatus = (
-
- {tr('hostDNSOffHint')}
-
- )
- }
-
- return (
- <>
-
-
- {tr('guestToolsHostDNS')}
- {dnsStatus}
-
-
- void handleToggleHostDNS(checked)}
- />
-
-
- {showApplySub && (
-
-
-
- {tr(!toolsAttached ? 'hostDNSAttachHint' : dnsStale ? 'hostDNSStaleHint' : 'hostDNSApplyHint')}
-
-
- {toolsAttached && (
-
-
- {HOST_DNS_APPLY_CMD}
- } onClick={() => onCopy(HOST_DNS_APPLY_CMD)} />
- {running && (
- } busy={busyAction === 'type'} disabled={busy} onClick={() => onTypeText(HOST_DNS_APPLY_CMD)} />
- )}
-
-
- )}
-
- )}
- {showDisableSub && (
-
-
- {tr('hostDNSDisableCmdHint')}
-
-
-
- {disableCmd}
- } onClick={() => onCopy(disableCmd)} />
- {running && (
- } busy={busyAction === 'type'} disabled={busy} onClick={() => onTypeText(disableCmd)} />
- )}
-
-
-
- )}
- >
- )
- })()}
-
-