feat: add support for NFS protocol with dynamic UI field updates and visibility toggles

This commit is contained in:
2026-06-09 15:28:27 +01:00
parent e6b806d2c1
commit d34e919f40
2 changed files with 22 additions and 4 deletions
+19 -1
View File
@@ -174,9 +174,27 @@ window.closeConnModal = () => {
window.updateProtocolFields = () => {
const protocol = document.getElementById('conn-protocol').value;
const showBucket = protocol === 's3' || protocol === 'smb';
const showBucket = protocol === 's3' || protocol === 'smb' || protocol === 'nfs';
document.getElementById('bucket-fields').style.display = showBucket ? 'block' : 'none';
const bucketLabel = document.getElementById('bucket-label');
if (bucketLabel) {
if (protocol === 'nfs') {
bucketLabel.innerText = 'Export Path';
} else if (protocol === 'smb') {
bucketLabel.innerText = 'Share';
} else {
bucketLabel.innerText = 'Bucket';
}
}
const isNFS = protocol === 'nfs';
const portGroup = document.getElementById('port-group');
if (portGroup) portGroup.style.display = isNFS ? 'none' : 'block';
const authRow = document.getElementById('auth-row');
if (authRow) authRow.style.display = isNFS ? 'none' : 'flex';
// Only show S3 specific fields when S3 is selected
const showS3Specific = protocol === 's3';
document.getElementById('region-group').style.display = showS3Specific ? 'flex' : 'none';