1
0
mirror of https://github.com/Eugeny/tabby.git synced 2025-07-25 22:38:34 +00:00

sftp: added "copy full path" context menu item - fixed , fixed

This commit is contained in:
Eugene Pankov
2023-01-08 20:26:22 +01:00
parent 1397d0faed
commit 62d2735f86

@@ -21,15 +21,21 @@ export class EditSFTPContextMenu extends SFTPContextMenuItemProvider {
} }
async getItems (item: SFTPFile, panel: SFTPPanelComponent): Promise<MenuItemOptions[]> { async getItems (item: SFTPFile, panel: SFTPPanelComponent): Promise<MenuItemOptions[]> {
if (item.isDirectory) { const items: MenuItemOptions[] = [
return []
}
return [
{ {
click: () => this.edit(item, panel.sftp), click: () => this.platform.setClipboard({
label: this.translate.instant('Edit locally'), text: item.fullPath,
}),
label: this.translate.instant('Copy full path'),
}, },
] ]
if (!item.isDirectory) {
items.push({
click: () => this.edit(item, panel.sftp),
label: this.translate.instant('Edit locally'),
})
}
return items
} }
private async edit (item: SFTPFile, sftp: SFTPSession) { private async edit (item: SFTPFile, sftp: SFTPSession) {