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')} button.btn.btn-link.btn-close((click)='close()') !{require('../../../tabby-core/src/icons/times.svg')}
.body(dropZone, (transfer)='uploadOne($event)') .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', translate) Connecting
div(*ngIf='sftp') div(*ngIf='sftp')
div(*ngIf='fileList === null', translate) Loading div(*ngIf='fileList === null', translate) Loading

View File

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

View File

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