mirror of
https://github.com/Eugeny/tabby
synced 2024-11-14 08:57:21 +00:00
Lint pass
This commit is contained in:
parent
d6c2c5de31
commit
4d60ae2e90
5 changed files with 10 additions and 10 deletions
|
@ -90,19 +90,19 @@ export interface FileUploadOptions {
|
||||||
export class DirectoryUpload {
|
export class DirectoryUpload {
|
||||||
private childrens: (FileUpload|DirectoryUpload)[] = []
|
private childrens: (FileUpload|DirectoryUpload)[] = []
|
||||||
|
|
||||||
constructor(private name = '') {
|
constructor (private name = '') {
|
||||||
// Just set name for now.
|
// Just set name for now.
|
||||||
}
|
}
|
||||||
|
|
||||||
getName () {
|
getName (): string {
|
||||||
return this.name
|
return this.name
|
||||||
}
|
}
|
||||||
|
|
||||||
getChildrens () {
|
getChildrens (): (FileUpload|DirectoryUpload)[] {
|
||||||
return this.childrens
|
return this.childrens
|
||||||
}
|
}
|
||||||
|
|
||||||
pushChildren (item: FileUpload|DirectoryUpload) {
|
pushChildren (item: FileUpload|DirectoryUpload): void {
|
||||||
this.childrens.push(item)
|
this.childrens.push(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ export class DropZoneDirective implements AfterViewInit {
|
||||||
})
|
})
|
||||||
this.el.nativeElement.addEventListener('drop', async (event: DragEvent) => {
|
this.el.nativeElement.addEventListener('drop', async (event: DragEvent) => {
|
||||||
this.removeHint()
|
this.removeHint()
|
||||||
this.transfer.emit(await this.platform.startUploadFromDragEvent(event, true))
|
this.transfer.emit(await this.platform.startUploadFromDragEvent(event, true))
|
||||||
})
|
})
|
||||||
this.el.nativeElement.addEventListener('dragleave', () => {
|
this.el.nativeElement.addEventListener('dragleave', () => {
|
||||||
this.removeHint()
|
this.removeHint()
|
||||||
|
|
|
@ -54,7 +54,7 @@ export class ElectronPlatformService extends PlatformService {
|
||||||
if (item.isDirectory()) {
|
if (item.isDirectory()) {
|
||||||
root.pushChildren(await this.getAllFiles(path.join(dir, item.name), new DirectoryUpload(item.name)))
|
root.pushChildren(await this.getAllFiles(path.join(dir, item.name), new DirectoryUpload(item.name)))
|
||||||
} else {
|
} else {
|
||||||
let file = new ElectronFileUpload(path.join(dir, item.name), this.electron)
|
const file = new ElectronFileUpload(path.join(dir, item.name), this.electron)
|
||||||
root.pushChildren(file)
|
root.pushChildren(file)
|
||||||
await wrapPromise(this.zone, file.open())
|
await wrapPromise(this.zone, file.open())
|
||||||
this.fileTransferStarted.next(file)
|
this.fileTransferStarted.next(file)
|
||||||
|
@ -248,8 +248,8 @@ export class ElectronPlatformService extends PlatformService {
|
||||||
paths = result.filePaths
|
paths = result.filePaths
|
||||||
}
|
}
|
||||||
|
|
||||||
let root = new DirectoryUpload()
|
const root = new DirectoryUpload()
|
||||||
root.pushChildren(await this.getAllFiles(paths[0].split(path.sep).join(path.posix.sep),new DirectoryUpload(path.basename(paths[0]))))
|
root.pushChildren(await this.getAllFiles(paths[0].split(path.sep).join(path.posix.sep), new DirectoryUpload(path.basename(paths[0]))))
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ export class SFTPPanelComponent {
|
||||||
} catch {
|
} catch {
|
||||||
// Intentionally ignoring errors from making duplicate dirs.
|
// Intentionally ignoring errors from making duplicate dirs.
|
||||||
}
|
}
|
||||||
await this.uploadOneFolder(t, path.posix.join(accumPath,t.getName()))
|
await this.uploadOneFolder(t, path.posix.join(accumPath, t.getName()))
|
||||||
} else {
|
} else {
|
||||||
await this.sftp.upload(path.posix.join(this.path, accumPath, t.getName()), t)
|
await this.sftp.upload(path.posix.join(this.path, accumPath, t.getName()), t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class WebPlatformService extends PlatformService {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async startUploadDirectory (paths?: string[]): Promise<DirectoryUpload> {
|
async startUploadDirectory (_paths?: string[]): Promise<DirectoryUpload> {
|
||||||
return new DirectoryUpload()
|
return new DirectoryUpload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue