mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 01:57:57 +00:00
* feat(ssh): manage a paired server's own SSH targets over RPC (ssh.target-management.v1) * fix(ssh): keep a browsed remote path untrimmed --------- Co-authored-by: m4air <m4air@Mac.localdomain>
16 lines
572 B
TypeScript
16 lines
572 B
TypeScript
import { ipcMain } from 'electron'
|
|
import type { SshConnectionManager } from '../ssh/ssh-connection-manager'
|
|
import { browseSshDirectory, type RemoteBrowseResult } from '../ssh/ssh-remote-directory-browse'
|
|
|
|
export function registerSshBrowseHandler(
|
|
getConnectionManager: () => SshConnectionManager | null
|
|
): void {
|
|
ipcMain.removeHandler('ssh:browseDir')
|
|
|
|
ipcMain.handle(
|
|
'ssh:browseDir',
|
|
(_event, args: { targetId: string; dirPath: string }): Promise<RemoteBrowseResult> =>
|
|
browseSshDirectory(getConnectionManager(), args.targetId, args.dirPath)
|
|
)
|
|
}
|