Die UNterscheidung von Test und Echt Lizenzen ist strikter

Dieser Commit ist enthalten in:
2025-06-21 20:15:50 +02:00
Ursprung fdf74c11ec
Commit 08e4e939ab
3 geänderte Dateien mit 103 neuen und 7 gelöschten Zeilen

Datei anzeigen

@@ -270,8 +270,7 @@ function calculateValidUntil() {
break;
}
// Ein Tag abziehen, da der Starttag mitgezählt wird
endDate.setDate(endDate.getDate() - 1);
// Kein Tag abziehen - die Lizenz ist bis einschließlich des Enddatums gültig
document.getElementById('validUntil').value = endDate.toISOString().split('T')[0];
}
@@ -366,6 +365,9 @@ document.addEventListener('DOMContentLoaded', function() {
nameInput.required = true;
emailInput.required = true;
// New customers are currently hardcoded as fake (TODO in backend)
window.selectedCustomerIsFake = true;
// Zeige Indikator für neuen Kunden
showCustomerTypeIndicator('new');
} else {
@@ -377,11 +379,17 @@ document.addEventListener('DOMContentLoaded', function() {
nameInput.value = '';
emailInput.value = '';
// Store customer's is_fake status
window.selectedCustomerIsFake = e.params.data.is_fake || false;
// Zeige Indikator basierend auf Kundendaten
if (e.params.data.is_fake !== undefined) {
showCustomerTypeIndicator(e.params.data.is_fake ? 'fake' : 'real');
}
}
// Update resource availability check with new customer status
checkResourceAvailability();
});
// Clear handler
@@ -390,9 +398,14 @@ document.addEventListener('DOMContentLoaded', function() {
document.getElementById('emailDiv').style.display = 'none';
document.getElementById('customerName').required = false;
document.getElementById('email').required = false;
window.selectedCustomerIsFake = false;
checkResourceAvailability();
hideCustomerTypeIndicator();
});
// Store selected customer's is_fake status
window.selectedCustomerIsFake = false;
// Resource Availability Check
checkResourceAvailability();
@@ -408,8 +421,11 @@ function checkResourceAvailability() {
const ipv4Count = parseInt(document.getElementById('ipv4Count').value) || 0;
const phoneCount = parseInt(document.getElementById('phoneCount').value) || 0;
// Include is_fake parameter based on selected customer
const isFake = window.selectedCustomerIsFake ? 'true' : 'false';
// API-Call zur Verfügbarkeitsprüfung
fetch(`{{ url_for('api.check_resource_availability') }}?domain=${domainCount}&ipv4=${ipv4Count}&phone=${phoneCount}`)
fetch(`{{ url_for('api.check_resource_availability') }}?domain=${domainCount}&ipv4=${ipv4Count}&phone=${phoneCount}&is_fake=${isFake}`)
.then(response => response.json())
.then(data => {
// Update der Verfügbarkeitsanzeigen