This commit is contained in:
Willard Nilges 2024-11-26 01:32:48 +00:00 committed by GitHub
commit ea4c84fa65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 7 deletions

View file

@ -596,16 +596,13 @@ def create():
if iso != 'none':
iso = '{}:iso/{}'.format(app.config['PROXMOX_ISO_STORAGE'], iso)
if not user.rtp:
if template == 'none':
usage_check = user.check_usage(0, 0, disk)
else:
usage_check = user.check_usage(cores, memory, disk)
username = user.name
else:
usage_check = None
username = request.form['user']
if usage_check:
return usage_check
return usage_check, 403
else:
valid, available = (
check_hostname(starrs, name) if app.config['USE_STARRS'] else (True, True)

View file

@ -240,9 +240,9 @@ $("#create-vm").click(function(){
swal("Uh oh...", "Invalid SSH key!", "error");
} else if (disk > max_disk) {
swal("Uh oh...", `You do not have enough disk resources available! Please lower the VM disk size to ${max_disk}GB or lower.`, "error");
} else if (template != 'none' && cores > max_cpu) {
} else if (cores > max_cpu) {
swal("Uh oh...", `You do not have enough CPU resources available! Please lower the VM cores to ${max_cpu} or lower.`, "error");
} else if (template != 'none' && mem/1024 > max_mem) {
} else if (mem/1024 > max_mem) {
swal("Uh oh...", `You do not have enough memory resources available! Please lower the VM memory to ${max_mem}GB or lower.`, "error");
} else {
fetch(`/hostname/${name}`, {