feat: add support for NFS protocol with dynamic UI field updates and visibility toggles
This commit is contained in:
+3
-3
@@ -95,7 +95,7 @@
|
||||
<label>Host</label>
|
||||
<input type="text" id="conn-host" placeholder="example.com">
|
||||
</div>
|
||||
<div class="form-group" style="flex: 1;">
|
||||
<div class="form-group" style="flex: 1;" id="port-group">
|
||||
<label>Port</label>
|
||||
<input type="number" id="conn-port" placeholder="22">
|
||||
</div>
|
||||
@@ -104,7 +104,7 @@
|
||||
<div id="bucket-fields" style="display: none;">
|
||||
<div class="form-row">
|
||||
<div class="form-group" style="flex: 1;">
|
||||
<label>Bucket / Share</label>
|
||||
<label id="bucket-label">Bucket / Share</label>
|
||||
<input type="text" id="conn-bucket" placeholder="my-bucket-or-share">
|
||||
</div>
|
||||
<div class="form-group" style="flex: 1;" id="region-group">
|
||||
@@ -123,7 +123,7 @@
|
||||
<label style="margin: 0;">Use FTPS (Secure Explicit TLS)</label>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-row" id="auth-row">
|
||||
<div class="form-group" style="flex: 1;">
|
||||
<label>Username / Access Key</label>
|
||||
<input type="text" id="conn-username" placeholder="user">
|
||||
|
||||
+19
-1
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user