diff --git a/rdgenerator/views.py b/rdgenerator/views.py index ccf6242..b99e147 100644 --- a/rdgenerator/views.py +++ b/rdgenerator/views.py @@ -119,14 +119,18 @@ def generator_view(request): decodedCustom['password'] = permPass if theme != "system": if themeDorO == "default": - decodedCustom['default-settings']['theme'] = theme + if platform == "windows-x86": + decodedCustom['default-settings']['allow-darktheme'] = 'Y' if theme == "dark" else 'N' + else: + decodedCustom['default-settings']['theme'] = theme elif themeDorO == "override": - decodedCustom['override-settings']['theme'] = theme - #decodedCustom['approve-mode'] = passApproveMode + if platform == "windows-x86": + decodedCustom['override-settings']['allow-darktheme'] = 'Y' if theme == "dark" else 'N' + else: + decodedCustom['override-settings']['theme'] = theme decodedCustom['enable-lan-discovery'] = 'N' if denyLan else 'Y' #decodedCustom['direct-server'] = 'Y' if enableDirectIP else 'N' decodedCustom['allow-auto-disconnect'] = 'Y' if autoClose else 'N' - decodedCustom['allow-remove-wallpaper'] = 'Y' if removeWallpaper else 'N' if permissionsDorO == "default": decodedCustom['default-settings']['access-mode'] = permissionsType decodedCustom['default-settings']['enable-keyboard'] = 'Y' if enableKeyboard else 'N' @@ -139,9 +143,10 @@ def generator_view(request): decodedCustom['default-settings']['enable-block-input'] = 'Y' if enableBlockingInput else 'N' decodedCustom['default-settings']['allow-remote-config-modification'] = 'Y' if enableRemoteModi else 'N' decodedCustom['default-settings']['direct-server'] = 'Y' if enableDirectIP else 'N' - decodedCustom['default-settings']['hide-cm'] = 'Y' if hidecm else 'N' decodedCustom['default-settings']['verification-method'] = 'use-permanent-password' if hidecm else 'use-both-passwords' decodedCustom['default-settings']['approve-mode'] = passApproveMode + decodedCustom['default-settings']['allow-hide-cm'] = 'Y' if hidecm else 'N' + decodedCustom['default-settings']['allow-remove-wallpaper'] = 'Y' if removeWallpaper else 'N' else: decodedCustom['override-settings']['access-mode'] = permissionsType decodedCustom['override-settings']['enable-keyboard'] = 'Y' if enableKeyboard else 'N' @@ -153,6 +158,11 @@ def generator_view(request): decodedCustom['override-settings']['enable-record-session'] = 'Y' if enableRecording else 'N' decodedCustom['override-settings']['enable-block-input'] = 'Y' if enableBlockingInput else 'N' decodedCustom['override-settings']['allow-remote-config-modification'] = 'Y' if enableRemoteModi else 'N' + decodedCustom['override-settings']['direct-server'] = 'Y' if enableDirectIP else 'N' + decodedCustom['override-settings']['verification-method'] = 'use-permanent-password' if hidecm else 'use-both-passwords' + decodedCustom['override-settings']['approve-mode'] = passApproveMode + decodedCustom['override-settings']['allow-hide-cm'] = 'Y' if hidecm else 'N' + decodedCustom['override-settings']['allow-remove-wallpaper'] = 'Y' if removeWallpaper else 'N' for line in defaultManual.splitlines(): k, value = line.split('=') @@ -179,16 +189,17 @@ def generator_view(request): extras['rdgen'] = 'true' extras['cycleMonitor'] = 'true' if cycleMonitor else 'false' extras['xOffline'] = 'true' if xOffline else 'false' - extras['hidecm'] = 'true' if hidecm else 'false' extras['removeNewVersionNotif'] = 'true' if removeNewVersionNotif else 'false' extras['compname'] = compname extra_input = json.dumps(extras) ####from here run the github action, we need user, repo, access token. if platform == 'windows': - url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows.yml/dispatches' + url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows.yml/dispatches' + if platform == 'windows-x86': + url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows-x86.yml/dispatches' elif platform == 'linux': - url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-linux.yml/dispatches' + url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-linux.yml/dispatches' elif platform == 'android': url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-android.yml/dispatches' elif platform == 'macos': @@ -392,4 +403,4 @@ def save_custom_client(request): for chunk in file.chunks(): f.write(chunk) - return HttpResponse("File saved successfully!") \ No newline at end of file + return HttpResponse("File saved successfully!")