project rename

This commit is contained in:
Eugene Pankov
2021-06-29 23:57:04 +02:00
parent c61be3d52b
commit 43cd3318da
609 changed files with 510 additions and 530 deletions

View File

@@ -0,0 +1,49 @@
import { Component } from '@angular/core'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { BaseComponent } from 'tabby-core'
import { SFTPFile, SFTPSession } from '../api'
/** @hidden */
@Component({
template: require('./sftpDeleteModal.component.pug'),
})
export class SFTPDeleteModalComponent extends BaseComponent {
sftp: SFTPSession
item: SFTPFile
progressMessage = ''
cancelled = false
constructor (
private modalInstance: NgbActiveModal,
) {
super()
}
ngOnInit (): void {
this.destroyed$.subscribe(() => this.cancel())
this.run(this.item).then(() => {
this.modalInstance.close()
})
}
cancel (): void {
this.cancelled = true
this.modalInstance.close()
}
async run (file: SFTPFile): Promise<void> {
this.progressMessage = file.fullPath
if (file.isDirectory) {
for (const child of await this.sftp.readdir(file.fullPath)) {
await this.run(child)
if (this.cancelled) {
break
}
}
await this.sftp.rmdir(file.fullPath)
} else {
this.sftp.unlink(file.fullPath)
}
}
}