now the ports cannot be assigned twice, also simmilar application names work

This commit is contained in:
pika 2025-04-03 11:58:17 +02:00
parent e5300424ef
commit e9d1f985ae
7 changed files with 57 additions and 106 deletions

View file

@ -297,13 +297,13 @@
return;
}
const response = await fetch(`/api/servers/${serverId}/suggest_port`);
const response = await fetch(`/api/server/${serverId}/free-port`);
const data = await response.json();
if (data.port) {
if (data.success && data.port) {
addPortRow(data.port);
} else {
showNotification('No available ports found', 'warning');
showNotification(data.error || 'No available ports found', 'warning');
}
} catch (error) {
console.error('Error generating random port:', error);