Skip to content

Commit

Permalink
allow editing the current SFTP path by double-clicking - #7154, fixed #…
Browse files Browse the repository at this point in the history
…7291, fixed #7295, fixed #6666, fixed #6646, fixed #6354, fixed #5646
  • Loading branch information
Eugeny committed Jan 8, 2023
1 parent 24f8a4b commit 1397d0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tabby-ssh/src/components/sftpPanel.component.pug
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
.header
.breadcrumb.mr-auto
input.form-control.flex-grow-1.w-0(
*ngIf='editingPath !== null',
type='text',
autofocus,
(keydown.enter)='confirmPath()',
(keydown.esc)='editingPath = null',
(blur)='editingPath = null',
[(ngModel)]='editingPath'
)
.breadcrumb(*ngIf='editingPath === null', (dblclick)='editPath()')
a.breadcrumb-item((click)='navigate("/")') SFTP
a.breadcrumb-item(
*ngFor='let segment of pathSegments',
(click)='navigate(segment.path)'
) {{segment.name}}

.breadcrumb-spacer.flex-grow-1.h-100((dblclick)='editPath()')

button.btn.btn-link.btn-sm.d-flex((click)='openCreateDirectoryModal()')
i.fas.fa-plus.mr-1
div(translate) Create directory
Expand Down
13 changes: 13 additions & 0 deletions tabby-ssh/src/components/sftpPanel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class SFTPPanelComponent {
@Output() pathChange = new EventEmitter<string>()
pathSegments: PathSegment[] = []
@Input() cwdDetectionAvailable = false
editingPath: string|null = null

constructor (
private ngbModal: NgbModal,
Expand Down Expand Up @@ -182,6 +183,18 @@ export class SFTPPanelComponent {
window.localStorage.sshCWDTipDismissed = 'true'
}

editPath (): void {
this.editingPath = this.path
}

confirmPath (): void {
if (this.editingPath === null) {
return
}
this.navigate(this.editingPath)
this.editingPath = null
}

close (): void {
this.closed.emit()
}
Expand Down

0 comments on commit 1397d0f

Please sign in to comment.