This commit is contained in:
Bryan Gerlach
2024-09-27 10:54:27 -05:00
parent 04558547ac
commit 276020181c
2 changed files with 169 additions and 57 deletions

View File

@@ -2,7 +2,8 @@ from django import forms
class GenerateForm(forms.Form):
#Platform
platform = forms.ChoiceField(choices=[('windows','Windows'),('linux','Linux (currently unavailable)'),('android','Android (currently unavailable)')], initial='windows')
platform = forms.ChoiceField(choices=[('windows','Windows'),('linux','Linux (currently unavailable)'),('android','Android (testing now available)')], initial='windows')
delayFix = forms.BooleanField(initial=True, required=False)
#General
exename = forms.CharField(label="Name for EXE file", required=True)

View File

@@ -1,37 +1,134 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Server Configuration Form</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RustDesk Custom Client Builder</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #000;
color: #e0e0e0;
margin: 0;
padding: 20px;
}
.platform {
display: grid;
grid-template-columns: 1fr;
grid-gap: 20px;
margin: 0 auto;
padding: 20px;
max-width: 1200px;
}
.container {
display: grid;
grid-template-columns: 50% 50%;
grid-template-rows: repeat(2, auto); /* Adjust the number of rows as needed */
padding: 20px; /* Adjust the padding value as needed */
max-width: 1000px; /* Set a maximum width for the container */
grid-template-columns: 1fr 1fr; /* Adjust as needed */
grid-gap: 20px;
margin: 0 auto; /* Center the container horizontally */
padding: 20px;
max-width: 1200px;
}
.column {
flex: 50%;
}
h1 {
color: #fff;
text-align: center;
grid-column: 1 / -1;
}
h2 {
color: #fff;
margin-top: 0;
}
.section {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 20px;
margin-left: 10px;
margin-right: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add a subtle box shadow */
border-radius: 5px; /* Add rounded corners for a more 3D effect */
background-color: #111;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
flex: 50%;
}
label {
font-weight: bold;
display: block;
margin-bottom: 5px;
color: #bbb;
}
input[type="text"], input[type="password"], select, textarea {
width: 100%;
padding: 8px;
margin-bottom: 10px;
background-color: #222;
border: 1px solid #444;
border-radius: 4px;
color: #fff;
}
input[type="radio"], input[type="checkbox"] {
margin-right: 5px;
}
button {
background-color: #0077ff;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0066cc;
}
.platform-icons {
display: flex;
justify-content: space-around;
margin-bottom: 20px;
}
.platform-icon {
font-size: 32px;
color: #bbb;
cursor: pointer;
transition: color 0.3s ease;
}
.platform-icon:hover, .platform-icon.active {
color: #fff;
}
.checkbox-group {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 10px;
}
.checkbox-group label {
display: flex;
align-items: center;
}
.preview-image {
max-width: 100%;
max-height: 100px;
margin-top: 10px;
}
</style>
</head>
<body>
<form action="/generator" method="post" enctype="multipart/form-data" class="container">
<h2>Select Platform</h2>
<label for="{{ form.platform.id_for_label }}"></label>
{{ form.platform }}<br><br>
<h1><i class="fas fa-cogs"></i> RustDesk Custom Client Builder</h1>
<form action="/generator" method="post" enctype="multipart/form-data">
<div class="platform">
<h2><i class="fas fa-desktop"></i> Select Platform</h2>
<div class="platform-icons">
<i class="fab fa-windows platform-icon active" data-platform="windows"></i>
<i class="fab fa-linux platform-icon" data-platform="linux"></i>
<i class="fab fa-android platform-icon" data-platform="android"></i>
</div>
<select name="platform" id="id_platform">
<option value="windows" selected>Windows</option>
<option value="linux">Linux (currently unavailable)</option>
<option value="android">Android (currently unavailable)</option>
</select>
{{ form.delayFix }} <label for="{{ form.delayFix.id_for_label }}">Fix connection delay when using third-party API</label><br><br>
</div>
</div>
<div class="container">
<div class="section">
<h2>General</h2>
<h2><i class="fas fa-sliders-h"></i> General</h2>
<label for="{{ form.exename.id_for_label }}">Name of the configuration:</label>
{{ form.exename }}<br><br>
<label for="{{ form.appname.id_for_label }}">Custom Application Name:</label>
@@ -45,7 +142,7 @@
</div>
<div class="section">
<h2>Custom Server</h2>
<h2><i class="fas fa-server"></i> Custom Server</h2>
<label for="{{ form.serverIP.id_for_label }}">Host:</label>
{{ form.serverIP }}<br><br>
<label for="{{ form.key.id_for_label }}">Key:</label>
@@ -55,9 +152,10 @@
<label for="{{ form.urlLink.id_for_label }}">Custom URL for links (replaces https://rustdesk.com):</label>
{{ form.urlLink }}<br><br>
</div>
</div>
<div class="container">
<div class="section">
<h2>Security</h2>
<h2><i class="fas fa-shield-alt"></i> Security</h2>
<label for="{{ form.runasadmin.id_for_label }}">Always run as Administrator?</label>
{{ form.runasadmin }}<br><br>
<label for="{{ form.passApproveMode.id_for_label }}">Password Approve mode:</label>
@@ -74,7 +172,7 @@
</div>
<div class="section">
<h2>Visual</h2>
<h2><i class="fas fa-paint-brush"></i> Visual</h2>
<label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label>
{{ form.iconfile }}<br><br>
<!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> -->
@@ -86,7 +184,50 @@
<label for="{{ form.theme.id_for_label }}">Theme:</label>
{{ form.theme }} {{ form.themeDorO }} *Default sets the theme but allows the client to change it, Override sets the theme permanently.<br><br>
</div>
</div>
<div class="container">
<div class="section">
<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>
{{ form.permissionsDorO }}
<label for="{{ form.permissionsType.id_for_label }}">Permission type:</label>
{{ form.permissionsType }}<br><br>
<div class="checkbox-group">
{{ form.enableKeyboard }} <label for="{{ form.enableKeyboard.id_for_label }}">Enable keyboard/mouse</label>
{{ form.enableClipboard }} <label for="{{ form.enableClipboard.id_for_label }}">Enable clipboard</label><br>
{{ form.enableFileTransfer }} <label for="{{ form.enableFileTransfer.id_for_label }}">Enable file transfer</label>
{{ form.enableAudio }} <label for="{{ form.enableAudio.id_for_label }}">Enable audio</label><br>
{{ form.enableTCP }} <label for="{{ form.enableTCP.id_for_label }}">Enable TCP tunneling</label>
{{ form.enableRemoteRestart }} <label for="{{ form.enableRemoteRestart.id_for_label }}">Enable remote restart</label><br>
{{ form.enableRecording }} <label for="{{ form.enableRecording.id_for_label }}">Enable recording session</label>
{{ form.enableBlockingInput }} <label for="{{ form.enableBlockingInput.id_for_label }}">Enable blocking user input</label><br>
{{ form.enableRemoteModi }} <label for="{{ form.enableRemoteModi.id_for_label }}">Enable remote configuration modification</label><br><br>
</div>
</div>
<div class="section">
<h2><i class="fas fa-cog"></i> Other</h2>
{{ form.removeWallpaper }} <label for="{{ form.removeWallpaper.id_for_label }}">Remove wallpaper during incoming sessions</label><br><br>
<label for="{{ form.defaultManual.id_for_label }}">Default settings</label><br>
{{ form.defaultManual }}<br><br>
<label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
{{ form.overrideManual }}<br><br>
</div>
</div>
<div class="platform">
<div class="section">
<button type="submit"><i class="fas fa-rocket"></i> Generate Custom Client</button>
</div>
</div>
</form>
<script>
document.querySelectorAll('.platform-icon').forEach(icon => {
icon.addEventListener('click', function() {
document.querySelectorAll('.platform-icon').forEach(i => i.classList.remove('active'));
this.classList.add('active');
document.getElementById('id_platform').value = this.dataset.platform;
});
});
document.getElementById("{{ form.iconfile.id_for_label }}").addEventListener('change', function(event) {
previewImage(event.target, 'icon-preview');
});
@@ -108,35 +249,5 @@
}
}
</script>
<div class="section">
<h2>Permissions</h2>
The following Permissions can be set as default (the user can change the settins) or override (the settings cannot be changed).<br>
{{ form.permissionsDorO }}
<label for="{{ form.permissionsType.id_for_label }}">Permission type:</label>
{{ form.permissionsType }}<br><br>
{{ form.enableKeyboard }} <label for="{{ form.enableKeyboard.id_for_label }}">Enable keyboard/mouse</label>
{{ form.enableClipboard }} <label for="{{ form.enableClipboard.id_for_label }}">Enable clipboard</label><br>
{{ form.enableFileTransfer }} <label for="{{ form.enableFileTransfer.id_for_label }}">Enable file transfer</label>
{{ form.enableAudio }} <label for="{{ form.enableAudio.id_for_label }}">Enable audio</label><br>
{{ form.enableTCP }} <label for="{{ form.enableTCP.id_for_label }}">Enable TCP tunneling</label>
{{ form.enableRemoteRestart }} <label for="{{ form.enableRemoteRestart.id_for_label }}">Enable remote restart</label><br>
{{ form.enableRecording }} <label for="{{ form.enableRecording.id_for_label }}">Enable recording session</label>
{{ form.enableBlockingInput }} <label for="{{ form.enableBlockingInput.id_for_label }}">Enable blocking user input</label><br>
{{ form.enableRemoteModi }} <label for="{{ form.enableRemoteModi.id_for_label }}">Enable remote configuration modification</label><br><br>
</div>
<div class="section">
<h2>Other</h2>
{{ form.removeWallpaper }} <label for="{{ form.removeWallpaper.id_for_label }}">Remove wallpaper during incoming sessions</label><br><br>
<label for="{{ form.defaultManual.id_for_label }}">Default settings</label><br>
{{ form.defaultManual }}<br><br>
<label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
{{ form.overrideManual }}<br><br>
</div>
<div class="section">
<button type="submit">Submit</button> Generate a custom client exe file
</div>
</form>
</body>
</html>