1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-22 20:55:03 +03:00

option to always ask for baud rate

This commit is contained in:
Eugene Pankov 2021-07-04 13:47:38 +02:00
parent a5a0546e68
commit 26e2c60265
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 9 additions and 3 deletions

View File

@ -8,9 +8,10 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
label Device
input.form-control(
type='text',
alwaysShowTypeahead,
[(ngModel)]='profile.options.port',
[ngbTypeahead]='portsAutocomplete',
[resultFormatter]='portsFormatter',
[resultFormatter]='portsFormatter'
)
.col-6
@ -18,8 +19,10 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
label Baud Rate
input.form-control(
type='number',
alwaysShowTypeahead,
placeholder='Ask every time',
[(ngModel)]='profile.options.baudrate',
[ngbTypeahead]='baudratesAutocomplete',
[ngbTypeahead]='baudratesAutocomplete'
)
.form-line

View File

@ -49,7 +49,10 @@ export class SerialProfileSettingsComponent implements ProfileSettingsComponent
baudratesAutocomplete = text$ => text$.pipe(
debounceTime(200),
distinctUntilChanged(),
map((q: string) => BAUD_RATES.filter(x => !q || x.toString().startsWith(q)))
map((q: string) => [
null,
...BAUD_RATES.filter(x => !q || x.toString().startsWith(q)),
])
)
portsFormatter = port => {