mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-23 21:09:52 +00:00
allow editing the current SFTP path by double-clicking - #7154, fixed #7291, fixed #7295, fixed #6666, fixed #6646, fixed #6354, fixed #5646
This commit is contained in:
parent
24f8a4bd43
commit
1397d0faed
@ -1,11 +1,22 @@
|
|||||||
.header
|
.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((click)='navigate("/")') SFTP
|
||||||
a.breadcrumb-item(
|
a.breadcrumb-item(
|
||||||
*ngFor='let segment of pathSegments',
|
*ngFor='let segment of pathSegments',
|
||||||
(click)='navigate(segment.path)'
|
(click)='navigate(segment.path)'
|
||||||
) {{segment.name}}
|
) {{segment.name}}
|
||||||
|
|
||||||
|
.breadcrumb-spacer.flex-grow-1.h-100((dblclick)='editPath()')
|
||||||
|
|
||||||
button.btn.btn-link.btn-sm.d-flex((click)='openCreateDirectoryModal()')
|
button.btn.btn-link.btn-sm.d-flex((click)='openCreateDirectoryModal()')
|
||||||
i.fas.fa-plus.mr-1
|
i.fas.fa-plus.mr-1
|
||||||
div(translate) Create directory
|
div(translate) Create directory
|
||||||
|
@ -27,6 +27,7 @@ export class SFTPPanelComponent {
|
|||||||
@Output() pathChange = new EventEmitter<string>()
|
@Output() pathChange = new EventEmitter<string>()
|
||||||
pathSegments: PathSegment[] = []
|
pathSegments: PathSegment[] = []
|
||||||
@Input() cwdDetectionAvailable = false
|
@Input() cwdDetectionAvailable = false
|
||||||
|
editingPath: string|null = null
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private ngbModal: NgbModal,
|
private ngbModal: NgbModal,
|
||||||
@ -182,6 +183,18 @@ export class SFTPPanelComponent {
|
|||||||
window.localStorage.sshCWDTipDismissed = 'true'
|
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 {
|
close (): void {
|
||||||
this.closed.emit()
|
this.closed.emit()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user