fix: add missing UDP Relay admin tab button and HTTP/UDP mode toggle buttons on upload page
This commit is contained in:
parent
efdaa48cb6
commit
a3d1446060
1 changed files with 12 additions and 1 deletions
|
|
@ -462,9 +462,13 @@ body::before{content:'';position:fixed;inset:0;background:radial-gradient(ellips
|
||||||
<div class="page active" id="page-upload">
|
<div class="page active" id="page-upload">
|
||||||
|
|
||||||
<div style="margin-top:1.5rem;margin-bottom:1.25rem">
|
<div style="margin-top:1.5rem;margin-bottom:1.25rem">
|
||||||
|
<div style="display:flex;gap:.5rem;margin-bottom:.75rem">
|
||||||
|
<button class="mode-btn active-http" id="btn-http" onclick="setMode('http')">🌐 HTTP Mode</button>
|
||||||
|
<button class="mode-btn" id="btn-udp" onclick="setMode('udp')">⚡ UDP Mode</button>
|
||||||
|
</div>
|
||||||
<div class="mode-desc" id="mode-desc" style="margin-bottom:0">
|
<div class="mode-desc" id="mode-desc" style="margin-bottom:0">
|
||||||
<strong id="mode-label">HTTP Mode:</strong> <span id="mode-detail">Direct S3 presigned upload. Best for LAN and stable connections.</span>
|
<strong id="mode-label">HTTP Mode:</strong> <span id="mode-detail">Direct S3 presigned upload. Best for LAN and stable connections.</span>
|
||||||
<span id="udp-ext-hint" style="display:none;margin-left:.5rem;color:var(--dragon-bright);font-size:.75rem">⚡ UDP extension detected — <a href="#" onclick="setMode('udp');return false" style="color:inherit">switch to UDP</a></span>
|
<span id="udp-ext-hint" style="display:none;margin-left:.5rem;color:var(--dragon-bright);font-size:.75rem">⚡ UDP extension detected</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -521,6 +525,7 @@ body::before{content:'';position:fixed;inset:0;background:radial-gradient(ellips
|
||||||
<div class="admin-tab" data-tab="users" onclick="switchAdminTab('users')">Users</div>
|
<div class="admin-tab" data-tab="users" onclick="switchAdminTab('users')">Users</div>
|
||||||
<div class="admin-tab" data-tab="sharelinks" onclick="switchAdminTab('sharelinks')">🔗 Share Links</div>
|
<div class="admin-tab" data-tab="sharelinks" onclick="switchAdminTab('sharelinks')">🔗 Share Links</div>
|
||||||
<div class="admin-tab" data-tab="folders" onclick="switchAdminTab('folders')">Folders</div>
|
<div class="admin-tab" data-tab="folders" onclick="switchAdminTab('folders')">Folders</div>
|
||||||
|
<div class="admin-tab" data-tab="relay" onclick="switchAdminTab('relay')">⚡ UDP Relay</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- S3 -->
|
<!-- S3 -->
|
||||||
|
|
@ -922,16 +927,22 @@ function setMode(mode) {
|
||||||
const label = document.getElementById('mode-label');
|
const label = document.getElementById('mode-label');
|
||||||
const detail = document.getElementById('mode-detail');
|
const detail = document.getElementById('mode-detail');
|
||||||
const hint = document.getElementById('udp-ext-hint');
|
const hint = document.getElementById('udp-ext-hint');
|
||||||
|
const btnHttp = document.getElementById('btn-http');
|
||||||
|
const btnUdp = document.getElementById('btn-udp');
|
||||||
if (mode === 'http') {
|
if (mode === 'http') {
|
||||||
btn.className = 'btn-upload';
|
btn.className = 'btn-upload';
|
||||||
if (label) label.textContent = 'HTTP Mode:';
|
if (label) label.textContent = 'HTTP Mode:';
|
||||||
if (detail) detail.textContent = 'Direct S3 presigned upload. Best for LAN and stable connections.';
|
if (detail) detail.textContent = 'Direct S3 presigned upload. Best for LAN and stable connections.';
|
||||||
if (hint) hint.style.display = 'none';
|
if (hint) hint.style.display = 'none';
|
||||||
|
if (btnHttp) { btnHttp.className = 'mode-btn active-http'; }
|
||||||
|
if (btnUdp) { btnUdp.className = 'mode-btn'; }
|
||||||
} else {
|
} else {
|
||||||
btn.className = 'btn-upload udp';
|
btn.className = 'btn-upload udp';
|
||||||
if (label) label.textContent = 'UDP Mode:';
|
if (label) label.textContent = 'UDP Mode:';
|
||||||
if (detail) detail.textContent = 'Fast relay-accelerated transfer via the Chrome extension.';
|
if (detail) detail.textContent = 'Fast relay-accelerated transfer via the Chrome extension.';
|
||||||
if (hint) hint.style.display = 'none';
|
if (hint) hint.style.display = 'none';
|
||||||
|
if (btnHttp) { btnHttp.className = 'mode-btn'; }
|
||||||
|
if (btnUdp) { btnUdp.className = 'mode-btn active-udp'; }
|
||||||
}
|
}
|
||||||
updateUploadBtn();
|
updateUploadBtn();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue