mirror of
https://github.com/Eugeny/tabby.git
synced 2025-08-19 15:51:53 +00:00
Merge remote-tracking branch 'origin' into sftp
This commit is contained in:
@@ -113,8 +113,11 @@ export class SFTPPanelComponent {
|
||||
const modal = this.ngbModal.open(SFTPCreateDirectoryModalComponent)
|
||||
const directoryName = await modal.result
|
||||
if (directoryName !== '') {
|
||||
this.sftp.mkdir(path.join(this.path, directoryName)).finally(() => {
|
||||
this.sftp.mkdir(path.join(this.path, directoryName)).then(() => {
|
||||
this.notifications.notice('The directory was created successfully')
|
||||
this.navigate(path.join(this.path, directoryName))
|
||||
}).catch(() => {
|
||||
this.notifications.error('The directory could not be created')
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -125,7 +128,11 @@ export class SFTPPanelComponent {
|
||||
}
|
||||
|
||||
async uploadOne (transfer: FileUpload): Promise<void> {
|
||||
const savedPath = this.path
|
||||
await this.sftp.upload(path.join(this.path, transfer.getName()), transfer)
|
||||
if (this.path === savedPath) {
|
||||
await this.navigate(this.path)
|
||||
}
|
||||
}
|
||||
|
||||
async download (itemPath: string, mode: number, size: number): Promise<void> {
|
||||
|
@@ -12,7 +12,6 @@ import type { FileEntry, Stats } from 'ssh2-streams'
|
||||
export interface SFTPFile {
|
||||
name: string
|
||||
fullPath: string
|
||||
directory: string
|
||||
isDirectory: boolean
|
||||
isSymlink: boolean
|
||||
mode: number
|
||||
@@ -104,7 +103,6 @@ export class SFTPSession {
|
||||
const stats = await wrapPromise(this.zone, promisify<Stats>(f => this.sftp.stat(p, f))())
|
||||
return {
|
||||
name: posixPath.basename(p),
|
||||
directory: posixPath.dirname(p),
|
||||
fullPath: p,
|
||||
isDirectory: stats.isDirectory(),
|
||||
isSymlink: stats.isSymbolicLink(),
|
||||
@@ -188,7 +186,6 @@ export class SFTPSession {
|
||||
return {
|
||||
fullPath: p,
|
||||
name: posixPath.basename(p),
|
||||
directory: posixPath.dirname(p),
|
||||
isDirectory: (entry.attrs.mode & C.S_IFDIR) === C.S_IFDIR,
|
||||
isSymlink: (entry.attrs.mode & C.S_IFLNK) === C.S_IFLNK,
|
||||
mode: entry.attrs.mode,
|
||||
|
Reference in New Issue
Block a user