From cf3df951a9b03e3bdf5b1789ff4c173e7404dd53 Mon Sep 17 00:00:00 2001 From: xinwen Date: Tue, 3 Aug 2021 10:57:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20xrdp=20=E8=BF=9E=E6=8E=A5=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=8C=87=E5=AE=9A=E6=98=AF=E5=90=A6=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/api/connection_token.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/authentication/api/connection_token.py b/apps/authentication/api/connection_token.py index 57c41d03e..383a87c32 100644 --- a/apps/authentication/api/connection_token.py +++ b/apps/authentication/api/connection_token.py @@ -22,6 +22,7 @@ from common.utils import get_logger, random_string from common.drf.api import SerializerMixin from common.permissions import IsSuperUserOrAppUser, IsValidUser, IsSuperUser from orgs.mixins.api import RootOrgViewMixin +from common.http import is_true from ..serializers import ( ConnectionTokenSerializer, ConnectionTokenSecretSerializer, @@ -50,7 +51,7 @@ class ClientProtocolMixin: options = { 'full address:s': '', 'username:s': '', - 'screen mode id:i': '1', + # 'screen mode id:i': '1', # 'desktopwidth:i': '1280', # 'desktopheight:i': '800', 'use multimon:i': '0', @@ -82,8 +83,10 @@ class ClientProtocolMixin: asset, application, system_user, user = self.get_request_resource(serializer) height = self.request.query_params.get('height') width = self.request.query_params.get('width') + full_screen = is_true(self.request.query_params.get('full_screen')) token = self.create_token(user, asset, application, system_user) + options['screen mode id:i'] = '2' if full_screen else '1' address = settings.TERMINAL_RDP_ADDR if not address or address == 'localhost:3389': address = self.request.get_host().split(':')[0] + ':3389'