This commit is contained in:
2026-01-26 19:24:43 +00:00
commit 43a1c758b3
825 changed files with 121893 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
export function detectServerType({ host = '', port }) {
const normalizedHost = String(host).toLowerCase();
const numericPort = Number(port);
const hasPort = Number.isFinite(numericPort);
if (hasPort && numericPort === 8007) {
return 'pbs';
}
if (hasPort && numericPort === 8006) {
return 'proxmox';
}
if (hasPort && (numericPort === 443 || numericPort === 444)) {
return 'truenas';
}
if (normalizedHost.includes('pbs') || normalizedHost.includes('backup')) {
return 'pbs';
}
if (normalizedHost.includes('pve') || normalizedHost.includes('proxmox')) {
return 'proxmox';
}
if (normalizedHost.includes('truenas') || normalizedHost.includes('tn')) {
return 'truenas';
}
return 'proxmox';
}