Skip to content

Commit

Permalink
Merge pull request #835 from jumpserver/pr@dev@perf_setting_default_v…
Browse files Browse the repository at this point in the history
…alue

perf: 默认值从全局过去
  • Loading branch information
ibuler committed Jun 6, 2023
2 parents d905906 + fa4748f commit 9eba031
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Component, EventEmitter, Input, OnChanges, Output} from '@angular/core';
import {ConnectMethod, ConnectOption, Protocol} from '@app/model';
import {ConnectMethod, ConnectOption, Protocol, Setting} from '@app/model';
import {resolutionsChoices} from '@app/globals';
import {SettingService} from '@app/services';

@Component({
selector: 'elements-advanced-option',
Expand All @@ -13,12 +14,14 @@ export class ElementAdvancedOptionComponent implements OnChanges {
@Output() onOptionsChange = new EventEmitter<ConnectOption[]>();
public advancedOptions: ConnectOption[] = [];
public isShowAdvancedOption = false;
public setting: Setting;
private boolChoices = [
{label: 'Yes', value: true},
{label: 'No', value: false},
];

constructor() {
constructor(_settingSvc: SettingService) {
this.setting = _settingSvc.setting;
}

ngOnChanges() {
Expand Down Expand Up @@ -58,7 +61,7 @@ export class ElementAdvancedOptionComponent implements OnChanges {
},
options: resolutionsChoices.map(i => ({label: i, value: i})),
label: 'Resolution',
value: 'Auto'
value: this.setting.rdpResolution
},
{
type: 'select',
Expand All @@ -68,7 +71,7 @@ export class ElementAdvancedOptionComponent implements OnChanges {
},
options: this.boolChoices,
label: 'Backspace as Ctrl+H',
value: false
value: !!this.setting.backspaceAsCtrlH
}
];
this.advancedOptions = this.advancedOptions.filter(i => !i.hidden());
Expand Down

0 comments on commit 9eba031

Please sign in to comment.