Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions locale/pt-BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ msgstr "Abaixo"

#: locale/tmp-html/tabby-settings/src/components/configSyncSettingsTab.component.html:43
msgid "Download"
msgstr "Transferir"
msgstr "Download"

#: locale/tmp-html/tabby-terminal/src/components/terminalSettingsTab.component.html:23
msgid "Draw bold text in bright colors"
Expand Down Expand Up @@ -2571,4 +2571,3 @@ msgstr "Diminuir zoom"
msgctxt "[Dynamic] port forwarding"
msgid "id.port-forwarding.dynamic"
msgstr "Dinâmico"

20 changes: 20 additions & 0 deletions tabby-ssh/src/components/sftpPanel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ export class SFTPPanelComponent {
}
}

async downloadItem (item: SFTPFile): Promise<void> {
if (item.isDirectory) {
await this.downloadFolder(item)
return
}

if (item.isSymlink) {
const target = path.resolve(this.path, await this.sftp.readlink(item.fullPath))
const stat = await this.sftp.stat(target)
if (stat.isDirectory) {
await this.downloadFolder(item)
return
}
await this.download(item.fullPath, stat.mode, stat.size)
return
}

await this.download(item.fullPath, item.mode, item.size)
}

async openCreateDirectoryModal (): Promise<void> {
const modal = this.ngbModal.open(SFTPCreateDirectoryModalComponent)
const directoryName = await modal.result.catch(() => null)
Expand Down
7 changes: 7 additions & 0 deletions tabby-ssh/src/sftpContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ export class CommonSFTPContextMenu extends SFTPContextMenuItemProvider {
})
}

if (!item.isDirectory) {
items.push({
click: () => panel.downloadItem(item),
label: this.translate.instant('Download'),
})
}

items.push({
click: async () => {
if ((await this.platform.showMessageBox({
Expand Down
Loading