New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SFTP Feature: implement Create Folder #6049
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great! I've added a few comments, and I think the PR would also benefit greatly by adding a "New directory" button to the toolbar, next to "Upload" :)
tabby-ssh/src/components/sftpCreateDirectoryModal.component.pug
Outdated
Show resolved
Hide resolved
tabby-ssh/src/session/sftp.ts
Outdated
@@ -12,6 +12,7 @@ import type { FileEntry, Stats } from 'ssh2-streams' | |||
export interface SFTPFile { | |||
name: string | |||
fullPath: string | |||
directory: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unnecessary, (it's just posixPath.dirname(fullPath)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so... is this field really needed?
Co-authored-by: Eugeny <x@null.page>
Co-authored-by: Eugeny <x@null.page>
does tabby have an alert system to show an notification like "directory successfully created" or "directory could not be created" ? |
const modal = this.ngbModal.open(SFTPCreateDirectoryModalComponent) | ||
const directoryName = await modal.result | ||
if (directoryName !== '') { | ||
this.sftp.mkdir(path.join(this.path, directoryName)).finally(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be then
(or better, just await
) to prevent nagivating into a folder that failed to get created
tabby-ssh/src/session/sftp.ts
Outdated
@@ -12,6 +12,7 @@ import type { FileEntry, Stats } from 'ssh2-streams' | |||
export interface SFTPFile { | |||
name: string | |||
fullPath: string | |||
directory: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so... is this field really needed?
Yep! You can inject the NotificationsService: https://docs.tabby.sh/classes/NotificationsService.html
|
const savedPath = this.path | ||
if (this.path === savedPath) { | ||
await this.navigate(this.path) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've correctly noticed that this is wrong! I've just fixed the statement order in the master branch - you'll need to merge it back into your branch.
only info,notice and error are available i have added success or should i use info?
|
Just use notice for this one. |
i have switcht to then and catch for directory creation and remove directory in sftpfile |
Perfect 🚀 |
Perfect 🚀 |
first try to make sftp better
hope my coding skills are enouth :)
Fixes #4945