1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-23 13:13:49 +03:00

ssh: show CWD detection tip more prominently

This commit is contained in:
Eugene Pankov 2022-04-30 10:10:10 -07:00
parent a31cacf4ee
commit 12362231cf
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 21 additions and 1 deletions

View File

@ -17,6 +17,16 @@
button.btn.btn-link.btn-close((click)='close()') !{require('../../../tabby-core/src/icons/times.svg')}
.body(dropZone, (transfer)='uploadOne($event)')
a.alert.alert-info.d-flex.align-items-center(
*ngIf='shouldShowCWDTip && !cwdDetectionAvailable',
(click)='platform.openExternal("https://tabby.sh/go/cwd-detection")'
)
.mr-auto(translate)
strong(translate) Working directory detection
div(translate) Learn how to allow Tabby to detect remote shell's working directory.
button.close((click)='dismissCWDTip()')
i.fas.fa-close
div(*ngIf='!sftp', translate) Connecting
div(*ngIf='sftp')
div(*ngIf='fileList === null', translate) Loading

View File

@ -26,11 +26,12 @@ export class SFTPPanelComponent {
@Input() path = '/'
@Output() pathChange = new EventEmitter<string>()
pathSegments: PathSegment[] = []
@Input() cwdDetectionAvailable = false
constructor (
private ngbModal: NgbModal,
private platform: PlatformService,
private notifications: NotificationsService,
public platform: PlatformService,
@Optional() @Inject(SFTPContextMenuItemProvider) protected contextMenuProviders: SFTPContextMenuItemProvider[],
) {
this.contextMenuProviders.sort((a, b) => a.weight - b.weight)
@ -173,6 +174,14 @@ export class SFTPPanelComponent {
this.platform.popupContextMenu(await this.buildContextMenu(item), event)
}
get shouldShowCWDTip (): boolean {
return !window.localStorage.sshCWDTipDismissed
}
dismissCWDTip (): void {
window.localStorage.sshCWDTipDismissed = 'true'
}
close (): void {
this.closed.emit()
}

View File

@ -41,6 +41,7 @@ sftp-panel.bg-dark(
*ngIf='sftpPanelVisible',
(click)='$event.stopPropagation()',
[session]='sshSession',
[cwdDetectionAvailable]='session?.supportsWorkingDirectory()',
(closed)='sftpPanelVisible = false'
)