hidecm, layout changes

This commit is contained in:
Bryan Gerlach
2025-04-14 06:45:11 -05:00
parent 256d647f04
commit 71eb691a52
2 changed files with 144 additions and 3 deletions

View File

@@ -150,6 +150,58 @@
border-radius: 4px; border-radius: 4px;
display: inline-block; display: inline-block;
margin-left: 10px; margin-left: 10px;
}
.password-requirement {
display: none; /* Hidden by default */
color: orange;
font-size: 0.9em;
margin-top: 5px;
}
.sponsor-button {
display: inline-flex;
align-items: center;
background: linear-gradient(135deg, #00457C 0%, #0079C1 100%);
color: white;
padding: 12px 28px;
border-radius: 50px;
text-decoration: none;
font-weight: 600;
font-size: 16px;
letter-spacing: 0.5px;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 69, 124, 0.2);
border: 2px solid rgba(255, 255, 255, 0.1);
text-transform: uppercase;
}
.sponsor-button:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 69, 124, 0.3);
background: linear-gradient(135deg, #005AA7 0%, #0095EA 100%);
border-color: rgba(255, 255, 255, 0.2);
}
.sponsor-button i {
margin-right: 12px;
font-size: 20px;
background: white;
color: #00457C;
padding: 8px;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.sponsor-button:hover i {
transform: rotate(360deg);
color: #0095EA;
}
</style> </style>
</head> </head>
<body> <body>
@@ -233,6 +285,7 @@
{{ form.runasadmin }}<br><br> {{ form.runasadmin }}<br><br>
<label for="{{ form.passApproveMode.id_for_label }}">Password Approve mode:</label> <label for="{{ form.passApproveMode.id_for_label }}">Password Approve mode:</label>
{{ form.passApproveMode }}<br><br> {{ form.passApproveMode }}<br><br>
<div id="passwordRequirement" class="password-requirement">To use the hide connection window feature, please set a permanent password.</div>
<label for="{{ form.permanentPassword.id_for_label }}">Set Permanent Password:</label> <label for="{{ form.permanentPassword.id_for_label }}">Set Permanent Password:</label>
{{ form.permanentPassword }} *The password is used as default, but can be changed by the client<br><br> {{ form.permanentPassword }} *The password is used as default, but can be changed by the client<br><br>
@@ -263,7 +316,7 @@
<div class="container"> <div class="container">
<div class="section"> <div class="section">
<h2><i class="fas fa-lock"></i> Permissions</h2> <h2><i class="fas fa-lock"></i> Permissions</h2>
The following Permissions can be set as default (the user can change the settins) or override (the settings cannot be changed).<br> The following Permissions can be set as default (the user can change the settings) or override (the settings cannot be changed).<br>
{{ form.permissionsDorO }} {{ form.permissionsDorO }}
<label for="{{ form.permissionsType.id_for_label }}">Permission type:</label> <label for="{{ form.permissionsType.id_for_label }}">Permission type:</label>
{{ form.permissionsType }}<br><br> {{ form.permissionsType }}<br><br>
@@ -298,10 +351,24 @@
<div class="platform"> <div class="platform">
<div class="section"> <div class="section">
<button type="submit"><i class="fas fa-rocket"></i> Generate Custom Client</button> <button type="submit"><i class="fas fa-rocket"></i> Generate Custom Client</button>
<a href="https://github.com/bryangerlach/rdgen">Source Code on github</a>
<iframe src="https://github.com/sponsors/bryangerlach/button" title="Sponsor bryangerlach" height="32" width="114" style="border: 0; border-radius: 6px;"></iframe>
</div> </div>
</div> </div>
<div style="text-align: center; margin: 30px 0;">
<a href="https://github.com/bryangerlach/rdgen"
target="_blank"
class="sponsor-button">
<i class="fab fa-github"></i>
Source Code on Github
</a>
</div>
<div style="text-align: center; margin: 30px 0;">
<a href="https://github.com/sponsors/bryangerlach?o=esb"
target="_blank"
class="sponsor-button">
<i class="fab fa-github"></i>
Donate
</a>
</div>
</form> </form>
<script> <script>
document.querySelectorAll('.platform-icon').forEach(icon => { document.querySelectorAll('.platform-icon').forEach(icon => {
@@ -317,6 +384,78 @@
document.getElementById("{{ form.logofile.id_for_label }}").addEventListener('change', function(event) { document.getElementById("{{ form.logofile.id_for_label }}").addEventListener('change', function(event) {
previewImage(event.target, 'logo-preview'); previewImage(event.target, 'logo-preview');
}); });
document.getElementById("{{ form.hidecm.id_for_label }}").addEventListener('change',function() {
if (this.checked) {
document.getElementById("passwordRequirement").style.display = 'block';
document.getElementById("{{ form.permanentPassword.id_for_label }}").focus();
} else {
document.getElementById("passwordRequirement").style.display = 'none';
}
});
const enableKeyboard = document.getElementById("{{ form.enableKeyboard.id_for_label }}");
const enableClipboard = document.getElementById("{{ form.enableClipboard.id_for_label }}");
const enableFileTransfer = document.getElementById("{{ form.enableFileTransfer.id_for_label }}");
const enableAudio = document.getElementById("{{ form.enableAudio.id_for_label }}");
const enableTCP = document.getElementById("{{ form.enableTCP.id_for_label }}");
const enableRemoteRestart = document.getElementById("{{ form.enableRemoteRestart.id_for_label }}");
const enableRecording = document.getElementById("{{ form.enableRecording.id_for_label }}");
const enableBlockingInput = document.getElementById("{{ form.enableBlockingInput.id_for_label }}");
const enableRemoteModi = document.getElementById("{{ form.enableRemoteModi.id_for_label }}");
document.getElementById("{{ form.permissionsType.id_for_label }}").addEventListener('change', function() {
if (this.value === 'full') {
enableKeyboard.checked = true;
enableClipboard.checked = true;
enableFileTransfer.checked = true;
enableAudio.checked = true;
enableTCP.checked = true;
enableRemoteRestart.checked = true;
enableRecording.checked = true;
enableBlockingInput.checked = true;
enableRemoteModi.checked = true;
enableKeyboard.disabled = true;
enableClipboard.disabled = true;
enableFileTransfer.disabled = true;
enableAudio.disabled = true;
enableTCP.disabled = true;
enableRemoteRestart.disabled = true;
enableRecording.disabled = true;
enableBlockingInput.disabled = true;
enableRemoteModi.disabled = true;
} else if (this.value === 'view') {
enableKeyboard.checked = false;
enableClipboard.checked = false;
enableFileTransfer.checked = false;
enableAudio.checked = false;
enableTCP.checked = false;
enableRemoteRestart.checked = false;
enableRecording.checked = false;
enableBlockingInput.checked = false;
enableRemoteModi.checked = false;
enableKeyboard.disabled = true;
enableClipboard.disabled = true;
enableFileTransfer.disabled = true;
enableAudio.disabled = true;
enableTCP.disabled = true;
enableRemoteRestart.disabled = true;
enableRecording.disabled = true;
enableBlockingInput.disabled = true;
enableRemoteModi.disabled = true;
} else if (this.value === 'custom') {
enableKeyboard.disabled = false;
enableClipboard.disabled = false;
enableFileTransfer.disabled = false;
enableAudio.disabled = false;
enableTCP.disabled = false;
enableRemoteRestart.disabled = false;
enableRecording.disabled = false;
enableBlockingInput.disabled = false;
enableRemoteModi.disabled = false;
}
});
function previewImage(input, previewContainerId) { function previewImage(input, previewContainerId) {
if (input.files && input.files[0]) { if (input.files && input.files[0]) {
var reader = new FileReader(); var reader = new FileReader();

View File

@@ -138,6 +138,8 @@ def generator_view(request):
decodedCustom['default-settings']['enable-block-input'] = 'Y' if enableBlockingInput else 'N' 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']['allow-remote-config-modification'] = 'Y' if enableRemoteModi else 'N'
decodedCustom['default-settings']['direct-server'] = 'Y' if enableDirectIP 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'
else: else:
decodedCustom['override-settings']['access-mode'] = permissionsType decodedCustom['override-settings']['access-mode'] = permissionsType
decodedCustom['override-settings']['enable-keyboard'] = 'Y' if enableKeyboard else 'N' decodedCustom['override-settings']['enable-keyboard'] = 'Y' if enableKeyboard else 'N'