Add latest changes

Dieser Commit ist enthalten in:
2025-07-03 20:38:33 +00:00
Ursprung 63f3d92724
Commit 6f6cde65db
129 geänderte Dateien mit 3998 neuen und 1199 gelöschten Zeilen

Datei anzeigen

@@ -153,6 +153,19 @@
Anzahl der Geräte, auf denen die Lizenz gleichzeitig aktiviert sein kann.
</small>
</div>
<div class="col-md-6">
<label for="concurrentSessions" class="form-label">
Max. gleichzeitige Sessions
</label>
<select class="form-select" id="concurrentSessions" name="max_concurrent_sessions" required>
{% for i in range(1, 11) %}
<option value="{{ i }}" {% if i == 1 %}selected{% endif %}>{{ i }} {% if i == 1 %}Session{% else %}Sessions{% endif %}</option>
{% endfor %}
</select>
<small class="form-text text-muted">
Wie viele Geräte können gleichzeitig online sein. Muss kleiner oder gleich dem Gerätelimit sein.
</small>
</div>
</div>
</div>
</div>
@@ -574,5 +587,51 @@ function showCustomerTypeIndicator(type) {
function hideCustomerTypeIndicator() {
document.getElementById('customerTypeIndicator').classList.add('d-none');
}
// Validation for concurrent sessions vs device limit
document.getElementById('deviceLimit').addEventListener('change', validateSessionLimit);
document.getElementById('concurrentSessions').addEventListener('change', validateSessionLimit);
function validateSessionLimit() {
const deviceLimit = parseInt(document.getElementById('deviceLimit').value);
const concurrentSessions = parseInt(document.getElementById('concurrentSessions').value);
const sessionsSelect = document.getElementById('concurrentSessions');
// Update options to not exceed device limit
sessionsSelect.innerHTML = '';
for (let i = 1; i <= Math.min(10, deviceLimit); i++) {
const option = document.createElement('option');
option.value = i;
option.textContent = i + (i === 1 ? ' Session' : ' Sessions');
if (i === Math.min(concurrentSessions, deviceLimit)) {
option.selected = true;
}
sessionsSelect.appendChild(option);
}
// Show warning if adjusted
if (concurrentSessions > deviceLimit) {
const toast = document.createElement('div');
toast.className = 'toast align-items-center text-white bg-warning border-0 position-fixed bottom-0 end-0 m-3';
toast.setAttribute('role', 'alert');
toast.innerHTML = `
<div class="d-flex">
<div class="toast-body">
Gleichzeitige Sessions wurden auf ${deviceLimit} angepasst (Max. Gerätelimit).
</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast"></button>
</div>
`;
document.body.appendChild(toast);
const bsToast = new bootstrap.Toast(toast);
bsToast.show();
setTimeout(() => toast.remove(), 5000);
}
}
// Initialize validation on page load
document.addEventListener('DOMContentLoaded', function() {
validateSessionLimit();
});
</script>
{% endblock %}