mirror of
https://github.com/eugeny/tabby
synced 2026-05-03 07:50:45 +00:00
Add SFTP context menu download for files (#10971)
Package-Build / Lint (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docs / build (push) Has been cancelled
Package-Build / macOS-Build (arm64, aarch64-apple-darwin) (push) Has been cancelled
Package-Build / macOS-Build (x86_64, x86_64-apple-darwin) (push) Has been cancelled
Package-Build / Linux-Build (amd64, x64, ubuntu-24.04, x86_64-unknown-linux-gnu) (push) Has been cancelled
Package-Build / Linux-Build (arm64, arm64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu, aarch64-linux-gnu-) (push) Has been cancelled
Package-Build / Linux-Build (armhf, arm, ubuntu-24.04, arm-unknown-linux-gnueabihf, arm-linux-gnueabihf-) (push) Has been cancelled
Package-Build / Windows-Build (arm64, aarch64-pc-windows-msvc) (push) Has been cancelled
Package-Build / Windows-Build (x64, x86_64-pc-windows-msvc) (push) Has been cancelled
Package-Build / Lint (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docs / build (push) Has been cancelled
Package-Build / macOS-Build (arm64, aarch64-apple-darwin) (push) Has been cancelled
Package-Build / macOS-Build (x86_64, x86_64-apple-darwin) (push) Has been cancelled
Package-Build / Linux-Build (amd64, x64, ubuntu-24.04, x86_64-unknown-linux-gnu) (push) Has been cancelled
Package-Build / Linux-Build (arm64, arm64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu, aarch64-linux-gnu-) (push) Has been cancelled
Package-Build / Linux-Build (armhf, arm, ubuntu-24.04, arm-unknown-linux-gnueabihf, arm-linux-gnueabihf-) (push) Has been cancelled
Package-Build / Windows-Build (arm64, aarch64-pc-windows-msvc) (push) Has been cancelled
Package-Build / Windows-Build (x64, x86_64-pc-windows-msvc) (push) Has been cancelled
This commit is contained in:
+1
-2
@@ -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"
|
||||
@@ -2571,4 +2571,3 @@ msgstr "Diminuir zoom"
|
||||
msgctxt "[Dynamic] port forwarding"
|
||||
msgid "id.port-forwarding.dynamic"
|
||||
msgstr "Dinâmico"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user