W13 new-drive pages pre-fill the next free hdd_N and answer a bad name visibly; W14 drive operator detail behind Részletek; W29 plain decommission names no move; unreleased
gates / gates (push) Successful in 1m37s
gates / gates (push) Successful in 1m37s
This commit is contained in:
@@ -189,7 +189,7 @@
|
||||
|
||||
<div class="settings-card" id="cfg-card" style="display:none">
|
||||
<h3>2. Konfiguráció</h3>
|
||||
<form id="attach-form" onsubmit="return submitAttach(event)">
|
||||
<form id="attach-form" novalidate onsubmit="return submitAttach(event)">
|
||||
<div class="form-group">
|
||||
<label>Kiválasztott eszköz</label>
|
||||
<span class="settings-value mono" id="sel-device">—</span>
|
||||
@@ -199,10 +199,10 @@
|
||||
<label for="mount-name">Csatlakoztatási név <span class="required">*</span></label>
|
||||
<div style="display:flex;align-items:center;gap:.25rem">
|
||||
<span class="mono" style="opacity:.6">/mnt/</span>
|
||||
<input type="text" id="mount-name" class="form-control" placeholder="hdd_1"
|
||||
pattern="[a-zA-Z0-9_-]+" required style="max-width:180px">
|
||||
<input type="text" id="mount-name" class="form-control" placeholder="hdd_1" value="hdd_1"
|
||||
pattern="[a-zA-Z0-9_-]+" maxlength="40" required style="max-width:180px">
|
||||
</div>
|
||||
<span class="form-hint">A meghajtó a /mnt/<név> útvonalra kerül.</span>
|
||||
<span class="form-hint">A meghajtó a /mnt/<név> útvonalra kerül. Hagyd így, ha nem tudod.</span>
|
||||
</div>
|
||||
<p class="form-hint" id="mounted-note" style="display:none">
|
||||
Ez a meghajtó már csatlakoztatva van, csak a gép nem tartja nyilván. A „Csatolás" a
|
||||
@@ -295,9 +295,20 @@ function pickDisk(radio){
|
||||
document.getElementById('cfg-card').scrollIntoView({behavior:'smooth'});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function mountNameProblem(){
|
||||
if(selMounted){ return ''; }
|
||||
var v=(document.getElementById('mount-name').value||'').trim();
|
||||
if(/^[a-zA-Z0-9_-]{1,40}$/.test(v)){ return ''; }
|
||||
return 'Írj be egy csatlakoztatási nevet. Csak betű, szám, _ és - lehet benne, legfeljebb 40 karakter. Ha nem tudod, írd be: {name}'.replace('{name}', 'hdd_1');
|
||||
}
|
||||
|
||||
async function submitAttach(ev){
|
||||
ev.preventDefault();
|
||||
var btn=document.getElementById('attach-btn'); var out=document.getElementById('attach-result');
|
||||
var bad=mountNameProblem();
|
||||
if(bad){ out.innerHTML='<div class="alert alert-error" id="mount-name-error">'+esc(bad)+'</div>'; document.getElementById('mount-name').focus(); return false; }
|
||||
btn.disabled=true; out.innerHTML='<p class="form-hint">Csatlakoztatás folyamatban…</p>';
|
||||
try{
|
||||
|
||||
@@ -309,7 +320,7 @@ async function submitAttach(ev){
|
||||
set_default:document.getElementById('set-default').checked};
|
||||
}else{
|
||||
url='/api/storage/attach';
|
||||
body={device:selDevice, fstype:selFSType, mount_name:document.getElementById('mount-name').value,
|
||||
body={device:selDevice, fstype:selFSType, mount_name:document.getElementById('mount-name').value.trim(),
|
||||
label:document.getElementById('storage-label').value, set_default:document.getElementById('set-default').checked};
|
||||
}
|
||||
var r=await fetch(url,{method:'POST',headers:Object.assign({'Content-Type':'application/json'},csrfHeaders()),body:JSON.stringify(body)});
|
||||
|
||||
Reference in New Issue
Block a user