diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index dba458787..526eee480 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -68,6 +68,36 @@ class RDPFileClientProtocolURLMixin: 'bookmarktype:i': '3', 'use redirection server name:i': '0', } + + # copy from + # https://learn.microsoft.com/zh-cn/windows-server/administration/performance-tuning/role/remote-desktop/session-hosts + rdp_low_speed_broadband_option = { + "connection type:i": 2, + "disable wallpaper:i": 1, + "bitmapcachepersistenable:i": 1, + "disable full window drag:i": 1, + "disable menu anims:i": 1, + "allow font smoothing:i": 0, + "allow desktop composition:i": 0, + "disable themes:i": 0 + } + + rdp_high_speed_broadband_option = { + "connection type:i": 4, + "disable wallpaper:i": 0, + "bitmapcachepersistenable:i": 1, + "disable full window drag:i": 1, + "disable menu anims:i": 0, + "allow font smoothing:i": 0, + "allow desktop composition:i": 1, + "disable themes:i": 0 + } + + RDP_CONNECTION_SPEED_OPTION_MAP = { + "auto": {}, + "low_speed_broadband": rdp_low_speed_broadband_option, + "high_speed_broadband": rdp_high_speed_broadband_option, + } # 设置多屏显示 multi_mon = is_true(self.request.query_params.get('multi_mon')) if multi_mon: @@ -116,6 +146,8 @@ class RDPFileClientProtocolURLMixin: rdp = token.asset.platform.protocols.filter(name='rdp').first() if rdp and rdp.setting.get('console'): rdp_options['administrative session:i'] = '1' + rdp_connection_speed = token.connect_options.get('rdp_connection_speed', 'auto') + rdp_options.update(RDP_CONNECTION_SPEED_OPTION_MAP.get(rdp_connection_speed, {})) # 文件名 name = token.asset.name diff --git a/apps/i18n/luna/en.json b/apps/i18n/luna/en.json index 397f784eb..3ca3c46cf 100644 --- a/apps/i18n/luna/en.json +++ b/apps/i18n/luna/en.json @@ -223,5 +223,9 @@ "start time": "start time", "success": "success", "system user": "system user", - "user": "user" -} \ No newline at end of file + "user": "user", + "Low Speed Broadband (256 Kbps - 2 Mbps)": "Low Speed Broadband (256 Kbps - 2 Mbps)", + "High-speed broadband (2 Mbps – 10 Mbps )": "High-speed broadband (2 Mbps – 10 Mbps )", + "Auto": "Auto", + "RDP connection speed": "RDP connection speed" +} diff --git a/apps/i18n/luna/zh.json b/apps/i18n/luna/zh.json index db3970d4d..24b88e41a 100644 --- a/apps/i18n/luna/zh.json +++ b/apps/i18n/luna/zh.json @@ -221,5 +221,9 @@ "start time": "开始时间", "success": "成功", "system user": "系统用户", - "user": "用户" -} \ No newline at end of file + "user": "用户", + "Low Speed Broadband (256 Kbps - 2 Mbps)": "低速宽带 (256 Kbps - 2 Mbps)", + "High-speed broadband (2 Mbps – 10 Mbps )": "高速宽带 (2 Mbps - 10 Mbps)", + "Auto": "自动", + "RDP connection speed": "RDP 连接速度" +} diff --git a/apps/i18n/luna/zh_hant.json b/apps/i18n/luna/zh_hant.json index 91068af54..90b7755cd 100644 --- a/apps/i18n/luna/zh_hant.json +++ b/apps/i18n/luna/zh_hant.json @@ -225,5 +225,9 @@ "start time": "開始時間", "success": "成功", "system user": "系統用戶", - "user": "用戶" -} \ No newline at end of file + "user": "用戶", + "Low Speed Broadband (256 Kbps - 2 Mbps)": "低速寬帶 (256 Kbps - 2 Mbps)", + "High-speed broadband (2 Mbps – 10 Mbps )": "高速寬帶 (2 Mbps - 10 Mbps)", + "Auto": "自動", + "RDP connection speed": "RDP 連接速度" +}