mirror of https://github.com/jumpserver/jumpserver
perf: 连接 RDP 协议会话时,高级选项支持 session bpp:i 参数配置;默认 32; (#12319)
Co-authored-by: feng <1304903146@qq.com>pull/12321/head
parent
5b51a8231c
commit
c4fef5899c
|
@ -27,7 +27,7 @@ from perms.models import ActionChoices
|
||||||
from terminal.connect_methods import NativeClient, ConnectMethodUtil
|
from terminal.connect_methods import NativeClient, ConnectMethodUtil
|
||||||
from terminal.models import EndpointRule, Endpoint
|
from terminal.models import EndpointRule, Endpoint
|
||||||
from users.const import FileNameConflictResolution
|
from users.const import FileNameConflictResolution
|
||||||
from users.const import RDPSmartSize
|
from users.const import RDPSmartSize, RDPColorQuality
|
||||||
from users.models import Preference
|
from users.models import Preference
|
||||||
from ..models import ConnectionToken, date_expired_default
|
from ..models import ConnectionToken, date_expired_default
|
||||||
from ..serializers import (
|
from ..serializers import (
|
||||||
|
@ -49,7 +49,6 @@ class RDPFileClientProtocolURLMixin:
|
||||||
'full address:s': '',
|
'full address:s': '',
|
||||||
'username:s': '',
|
'username:s': '',
|
||||||
'use multimon:i': '0',
|
'use multimon:i': '0',
|
||||||
'session bpp:i': '32',
|
|
||||||
'audiomode:i': '0',
|
'audiomode:i': '0',
|
||||||
'disable wallpaper:i': '0',
|
'disable wallpaper:i': '0',
|
||||||
'disable full window drag:i': '0',
|
'disable full window drag:i': '0',
|
||||||
|
@ -100,10 +99,13 @@ class RDPFileClientProtocolURLMixin:
|
||||||
rdp_options['winposstr:s'] = f'0,1,0,0,{width},{height}'
|
rdp_options['winposstr:s'] = f'0,1,0,0,{width},{height}'
|
||||||
rdp_options['dynamic resolution:i'] = '0'
|
rdp_options['dynamic resolution:i'] = '0'
|
||||||
|
|
||||||
|
color_quality = self.request.query_params.get('rdp_color_quality')
|
||||||
|
color_quality = color_quality if color_quality else os.getenv('JUMPSERVER_COLOR_DEPTH', RDPColorQuality.HIGH)
|
||||||
|
|
||||||
# 设置其他选项
|
# 设置其他选项
|
||||||
rdp_options['smart sizing:i'] = self.request.query_params.get('rdp_smart_size', RDPSmartSize.DISABLE)
|
rdp_options['session bpp:i'] = color_quality
|
||||||
rdp_options['session bpp:i'] = os.getenv('JUMPSERVER_COLOR_DEPTH', '32')
|
|
||||||
rdp_options['audiomode:i'] = self.parse_env_bool('JUMPSERVER_DISABLE_AUDIO', 'false', '2', '0')
|
rdp_options['audiomode:i'] = self.parse_env_bool('JUMPSERVER_DISABLE_AUDIO', 'false', '2', '0')
|
||||||
|
rdp_options['smart sizing:i'] = self.request.query_params.get('rdp_smart_size', RDPSmartSize.DISABLE)
|
||||||
|
|
||||||
# 设置远程应用, 不是 Mstsc
|
# 设置远程应用, 不是 Mstsc
|
||||||
if token.connect_method != NativeClient.mstsc:
|
if token.connect_method != NativeClient.mstsc:
|
||||||
|
|
|
@ -38,6 +38,11 @@ class RDPSmartSize(TextChoices):
|
||||||
ENABLE = '1', _('Enable')
|
ENABLE = '1', _('Enable')
|
||||||
|
|
||||||
|
|
||||||
|
class RDPColorQuality(TextChoices):
|
||||||
|
HIGH = '32', 'High(32 bit)'
|
||||||
|
MEDIUM = '16', 'Medium(16 bit)'
|
||||||
|
|
||||||
|
|
||||||
class KeyboardLayout(TextChoices):
|
class KeyboardLayout(TextChoices):
|
||||||
EN_US_QWERTY = 'en-us-qwerty', 'US English (Qwerty)'
|
EN_US_QWERTY = 'en-us-qwerty', 'US English (Qwerty)'
|
||||||
EN_UK_QWERTY = 'en-gb-qwerty', 'UK English (Qwerty)'
|
EN_UK_QWERTY = 'en-gb-qwerty', 'UK English (Qwerty)'
|
||||||
|
|
|
@ -5,7 +5,7 @@ from rest_framework import serializers
|
||||||
|
|
||||||
from users.const import (
|
from users.const import (
|
||||||
RDPResolution, RDPSmartSize, KeyboardLayout,
|
RDPResolution, RDPSmartSize, KeyboardLayout,
|
||||||
RDPClientOption, AppletConnectionMethod
|
RDPClientOption, AppletConnectionMethod, RDPColorQuality,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,10 @@ class GraphicsSerializer(serializers.Serializer):
|
||||||
choices=RDPClientOption.choices, default={RDPClientOption.FULL_SCREEN},
|
choices=RDPClientOption.choices, default={RDPClientOption.FULL_SCREEN},
|
||||||
label=_('RDP client option'), required=False
|
label=_('RDP client option'), required=False
|
||||||
)
|
)
|
||||||
|
rdp_color_quality = serializers.ChoiceField(
|
||||||
|
choices=RDPColorQuality.choices, default=RDPColorQuality.HIGH,
|
||||||
|
label=_('RDP color quality'), required=False
|
||||||
|
)
|
||||||
rdp_smart_size = serializers.ChoiceField(
|
rdp_smart_size = serializers.ChoiceField(
|
||||||
RDPSmartSize.choices, default=RDPSmartSize.DISABLE,
|
RDPSmartSize.choices, default=RDPSmartSize.DISABLE,
|
||||||
required=False, label=_('Rdp smart size'),
|
required=False, label=_('Rdp smart size'),
|
||||||
|
|
Loading…
Reference in New Issue