Skip to content

Commit

Permalink
feat: 个人设置 rdp smart size可配置
Browse files Browse the repository at this point in the history
  • Loading branch information
feng626 committed Nov 2, 2023
1 parent 89fc9ce commit cc1a82f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/app/elements/setting/setting.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ <h1 mat-dialog-title>
</mat-select>
</mat-form-field>

<mat-form-field>
<mat-select [(value)]="setting.graphics.rdp_smart_size"
placeholder="{{'RDP smart size'| translate}}">
<mat-option *ngFor="let s of rdpSmartSizeOptions" [value]="s.value">
{{s.label}}
</mat-option>
</mat-select>
</mat-form-field>

<mat-form-field>
<label class="field-label" style="padding-bottom: 7px;">
{{'Keyboard layout'| translate }}
Expand Down
2 changes: 2 additions & 0 deletions src/app/elements/setting/setting.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class ElementSettingComponent implements OnInit {
public boolChoices: any[];
keyboardLayoutOptions: any[];
resolutionsOptions: any[];
rdpSmartSizeOptions: any[];
setting: Setting;
globalSetting: GlobalSetting;
type = 'general';
Expand Down Expand Up @@ -52,6 +53,7 @@ export class ElementSettingComponent implements OnInit {
const res: any = await this._http.options(url).toPromise();
const graphics = res.actions.GET.graphics.children;
this.resolutionsOptions = graphics.rdp_resolution.choices;
this.rdpSmartSizeOptions = graphics.rdp_smart_size.choices;
this.keyboardLayoutOptions = graphics.keyboard_layout.choices;
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ export class Setting {
rdp_resolution: 'Auto',
keyboard_layout: 'en-us-qwerty',
rdp_client_option: [],
applet_connection_method: 'web'
applet_connection_method: 'web',
rdp_smart_size: '0'
};
command_line = {
character_terminal_font_size: 14,
Expand Down
4 changes: 3 additions & 1 deletion src/app/services/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class HttpService {

cleanRDPParams(params) {
const cleanedParams = {};
const {rdp_resolution, rdp_client_option} = params.graphics;
const {rdp_resolution, rdp_client_option, rdp_smart_size} = params.graphics;

if (rdp_resolution && rdp_resolution.indexOf('x') > -1) {
const [width, height] = rdp_resolution.split('x');
Expand All @@ -229,6 +229,8 @@ export class HttpService {
if (rdp_client_option.includes('drives_redirect')) {
cleanedParams['drives_redirect'] = '1';
}

cleanedParams['rdp_smart_size'] = rdp_smart_size;
return cleanedParams;
}

Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Checkbox": "Checkbox",
"Batch connect": "Batch connect",
"RDP resolution": "RDP resolution",
"RDP smart size": "RDP smart size",
"Send text to all ssh terminals": "Send text to all ssh terminals",
"Switch to quick command": "Switch to quick command",
"Switch to input command": "Switch to input command",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Checkbox": "複数選択",
"Batch connect": "バッチ接続",
"RDP resolution": "RDP解像度",
"RDP smart size": "RDP スマート・サイズ",
"Send text to all ssh terminals": "すべてのssh端末にテキストを送信します",
"Switch to quick command": "クイックコマンドに切り替え",
"Switch to input command": "入力コマンドに切り替え",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Checkbox": "多选",
"Batch connect": "批量连接",
"RDP resolution": "RDP分辨率",
"RDP smart size": "RDP 智能大小",
"Send text to all ssh terminals": "发送文本到所有ssh终端",
"Switch to quick command": "切换到快捷命令",
"Switch to input command": "切换到输入命令",
Expand Down

0 comments on commit cc1a82f

Please sign in to comment.