Skip to content

Commit 47db5ce

Browse files
committed
perf: add remote microphone for rdpfile
1 parent 020922f commit 47db5ce

5 files changed

Lines changed: 25 additions & 2 deletions

File tree

src/app/elements/connect/connect-dialog/advanced-option/advanced-option.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ export class ElementAdvancedOptionComponent implements OnChanges, OnInit {
107107
label: 'RDP resolution',
108108
value: this.setting.graphics.rdp_resolution || 'auto'
109109
},
110+
{
111+
type: 'select',
112+
field: 'remote_microphone',
113+
label: 'Remote microphone',
114+
hidden: () => {
115+
return !hasX || !this.protocol || this.protocol.name !== 'rdp';
116+
},
117+
value: (this.setting.graphics.rdp_client_option || []).includes('remote_microphone'),
118+
options: this.boolChoices
119+
},
110120
{
111121
type: 'select',
112122
field: 'backspaceAsCtrlH',

src/app/elements/connect/connect.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ export class ElementConnectComponent implements OnInit, OnDestroy {
146146
this._logger.debug('Connect info: ', connectInfo);
147147

148148
const connectMethod = connectInfo.connectMethod;
149-
const connectOption = connectInfo.connectOption;
149+
const connectOption = connectInfo.connectOption || {};
150+
connectInfo.connectOption = connectOption;
151+
if (connectInfo.protocol.name === 'rdp' && connectOption['remote_microphone'] === undefined) {
152+
connectOption['remote_microphone'] = (
153+
this._settingSvc.setting.graphics.rdp_client_option || []
154+
).includes('remote_microphone');
155+
}
150156
const connToken = await this._connectTokenSvc.create(asset, connectInfo);
151157

152158
if (!connToken) {

src/app/elements/nav/setting/setting.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
<label [(ngModel)]="rdpClientConfig.drives_redirect" nz-checkbox>
9191
{{ 'Driver redirect' | translate }}
9292
</label>
93+
<label [(ngModel)]="rdpClientConfig.remote_microphone" nz-checkbox>
94+
{{ 'Remote microphone' | translate }}
95+
</label>
9396
</nz-form-control>
9497
</nz-form-item>
9598

src/app/elements/nav/setting/setting.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export class ElementSettingComponent implements OnInit, OnDestroy {
3535
rdpClientConfig = {
3636
full_screen: false,
3737
multi_screen: false,
38-
drives_redirect: false
38+
drives_redirect: false,
39+
remote_microphone: false
3940
};
4041

4142
currentTheme = '';

src/app/services/http.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ export class HttpService {
467467
if (connectOption && connectOption.reusable) {
468468
url.searchParams.append('reusable', '1');
469469
}
470+
if (connectOption && connectOption.remote_microphone !== undefined) {
471+
url.searchParams.append('remote_microphone', connectOption.remote_microphone ? '1' : '0');
472+
}
470473
return window.open(url.href);
471474
}
472475

0 commit comments

Comments
 (0)