Skip to content
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

Add description to port forwarding and autofill inputs with the deleted port #4959

Merged
merged 2 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tabby-ssh/src/api/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface ForwardedPortConfig {
port: number
targetAddress: string
targetPort: number
description: string
}

export const ALGORITHM_BLACKLIST = [
Expand Down
20 changes: 13 additions & 7 deletions tabby-ssh/src/components/sshPortForwardingConfig.component.pug
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
.list-group.mb-3
.list-group-item.d-flex.align-items-center(*ngFor='let fw of model')
strong(*ngIf='fw.type === PortForwardType.Local') Local
strong(*ngIf='fw.type === PortForwardType.Remote') Remote
strong(*ngIf='fw.type === PortForwardType.Dynamic') Dynamic
.ml-3 {{fw.host}}:{{fw.port}}
.ml-2 →
.ml-2(*ngIf='fw.type !== PortForwardType.Dynamic') {{fw.targetAddress}}:{{fw.targetPort}}
.ml-2(*ngIf='fw.type === PortForwardType.Dynamic') SOCKS proxy
div
span {{fw.description}}
.ms-2.d-flex.align-items-center
strong(*ngIf='fw.type === PortForwardType.Local') Local
strong(*ngIf='fw.type === PortForwardType.Remote') Remote
strong(*ngIf='fw.type === PortForwardType.Dynamic') Dynamic
.ml-3 {{fw.host}}:{{fw.port}}
.ml-2 →
.ml-2(*ngIf='fw.type !== PortForwardType.Dynamic') {{fw.targetAddress}}:{{fw.targetPort}}
.ml-2(*ngIf='fw.type === PortForwardType.Dynamic') SOCKS proxy
button.btn.btn-link.hover-reveal.ml-auto((click)='remove(fw)')
i.fas.fa-trash-alt

.input-group.mb-2
input.form-control(type='text', placeholder='Description', [(ngModel)]='newForward.description')

.input-group.mb-2(*ngIf='newForward.type === PortForwardType.Dynamic')
input.form-control(type='text', [(ngModel)]='newForward.host')
.input-group-append
Expand Down
2 changes: 2 additions & 0 deletions tabby-ssh/src/components/sshPortForwardingConfig.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class SSHPortForwardingConfigComponent {
port: 8000,
targetAddress: '127.0.0.1',
targetPort: 80,
description: '',
}
}

Expand All @@ -40,5 +41,6 @@ export class SSHPortForwardingConfigComponent {

remove (fw: ForwardedPortConfig) {
this.forwardRemoved.emit(fw)
this.newForward = fw
}
}
1 change: 1 addition & 0 deletions tabby-ssh/src/session/forwards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class ForwardedPort implements ForwardedPortConfig {
port: number
targetAddress: string
targetPort: number
description: string

private listener: Server|null = null

Expand Down