v0.318.0: the internal data place, partitions, an honest whole-box backup offer (R-1084), sys_drive never offered (R-1082)
gates / gates (push) Successful in 46s

felhom.eu architecture/16 §4-§6 (build B). MinAgent 0.157.0 — the internal place and the partitions appear only when
agent >= 0.158.0 reports them. Tests red-proved; four parity fixtures refreshed (only the new lines).

Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
2026-10-16 03:57:49 +02:00
parent 123d2d553f
commit a43d0423d5
28 changed files with 913 additions and 26 deletions
@@ -82,6 +82,9 @@
</div>
</div>
{{end}}
{{if .IsInternal}}
<div class="form-hint">{{T "storage.belso_tarhely_magyarazat"}}</div>
{{end}}
{{if .FSInfo}}
<div class="storage-path-fsinfo mono form-hint">
{{.FSInfo.FSType}} · {{.FSInfo.Device}}{{if .FSInfo.Model}} · {{.FSInfo.Model}}{{end}}
@@ -138,7 +141,7 @@
<button type="submit" class="btn btn-xs btn-outline" title="{{T "storage.a_meghajto_ujra_valaszthato_az"}}">{{T "storage.uj_telepitesek_engedelyezese"}}</button>
</form>
{{end}}
{{if .IsUSB}}
{{if and .IsUSB (not .IsInternal)}}
<button class="btn btn-xs btn-danger-outline" onclick="storageDisconnect('{{.Path}}', '{{.Label}}', {{.AppCount}})" title="{{T "storage.az_itt_tarolt_alkalmazasok_leallnak"}}">{{T "storage.biztonsagos_levalasztas"}}</button>
{{end}}
{{/* List-removal is the undo of a MANUAL add only. Wizard-enrolled drives
@@ -163,7 +166,9 @@
<button class="btn btn-xs btn-outline" onclick="storageMigrateAll('{{.Path}}','{{.Label}}')">{{T "storage.osszes_adat_athelyezese"}}</button>
</span>
{{end}}
{{if not .IsInternal}}
<button class="btn btn-xs btn-danger-outline" onclick="storageDecommission('{{.Path}}','{{.Label}}',{{.AppCount}})" title="{{T "storage.a_meghajto_vegleges_kivonasa_a"}}">{{T "storage.vegleges_leszereles"}}</button>
{{end}}
</div>
{{end}}
</div>
@@ -303,6 +308,8 @@ window.__registeredPaths=[{{range .StoragePaths}}{{if .Path}}"{{.Path}}",{{end}}
function actions(d, registered, hasSafeDisconnect){
// Destructive controls ONLY for user-data drives that are mounted under /mnt. System/backup get none.
if(d.role!=='user-data' || !d.mount_path || d.mount_path.indexOf('/mnt/')!==0) return '';
// The internal data place (`16` §5) is part of the system disk: no eject, no format (the agent refuses both too).
if(d.kind==='internal') return '';
// A user-data drive that ALSO backs the whole-system backup (agent `backup_target`): the agent refuses its eject
// (403) and a data-bearing format needs a signed job, so neither button is offered (R-298 design, 2026-10-08).
if(d.backup_target){
@@ -71,6 +71,20 @@ async function loadDisks(){
var cands = (j.data&&j.data.attach)||[];
if(cands.length===0){ document.getElementById('disk-list').innerHTML='<p class="form-hint">{{T "storage_attach.nincs_csatolhato_meghajto_a_csatolashoz"}}</p>'; return; }
var html='<div class="drive-list">';
// `16` §6 (agent ≥ 0.158.0): a disk that lists its parts offers each usable part (an ext4/xfs filesystem not yet
// a drive) as its own card, instead of the disk's first filesystem.
var flat=[];
cands.forEach(function(d){
var usable=(d.partitions||[]).filter(function(p){ return p.state==='filesystem' && p.mountable; });
if(!d.already_mounted && d.partitions && d.partitions.length){
usable.forEach(function(p){ flat.push({device:p.device, mount_source:p.device, fstype:p.fstype, size_bytes:p.size_bytes,
model:(d.model?d.model:d.device)+' — '+'{{T "storage_wizard.resz_n"}}'.replace('{n}', p.number||'?')}); });
return;
}
flat.push(d);
});
cands=flat;
if(cands.length===0){ document.getElementById('disk-list').innerHTML='<p class="form-hint">{{T "storage_attach.nincs_csatolhato_meghajto_a_csatolashoz"}}</p>'; return; }
cands.forEach(function(d,i){
var title = d.model ? esc(d.model) : esc(d.device);
var parts = [esc(d.device)];
@@ -82,16 +82,26 @@ async function loadDisks(){
var cands = (j.data&&j.data.initialize)||[];
if(cands.length===0){ document.getElementById('disk-list').innerHTML='<p class="form-hint">{{T "storage_init.nincs_elerheto_meghajto_az_inicializalas"}}</p>'; return; }
var html='<div class="drive-list">';
cands.forEach(function(d,i){
var n=0;
function card(dev, title, sub, db){
var i=n++;
return '<label class="drive-card role-user-data is-selectable" id="dc-'+i+'">'
+'<div class="drive-card-top"><div class="drive-select"><input type="radio" name="disk" value="'+esc(dev)+'" data-db="'+(db?'1':'0')+'" data-i="'+i+'" onchange="pickDisk(this)">'
+'<div class="drive-id"><span class="drive-name">'+title+'</span><span class="drive-sub">'+sub+'</span></div></div>'
+'<div class="drive-badges">'+dataBadge({data_bearing:db})+'</div></div></label>';
}
cands.forEach(function(d){
var title = d.model ? esc(d.model) : esc(d.device);
var parts = [esc(d.device)];
if(d.size_bytes) parts.push(fmtSize(d.size_bytes));
if(d.fstype) parts.push('{{T "storage_init.jelenlegi"}} '+esc(d.fstype));
var sub = parts.join(' · ');
html+='<label class="drive-card role-user-data is-selectable" id="dc-'+i+'">'
+'<div class="drive-card-top"><div class="drive-select"><input type="radio" name="disk" value="'+esc(d.device)+'" data-db="'+(d.data_bearing?'1':'0')+'" data-i="'+i+'" onchange="pickDisk(this)">'
+'<div class="drive-id"><span class="drive-name">'+title+'</span><span class="drive-sub">'+sub+'</span></div></div>'
+'<div class="drive-badges">'+dataBadge(d)+'</div></div></label>';
// `16` §6: a disk whose other part is already a drive offers only its free parts, never the whole disk.
if(!d.whole_disk_in_use) html+=card(d.device, title, parts.join(' · '), d.data_bearing);
(d.partitions||[]).forEach(function(p){
if(p.state!=='empty' && p.state!=='filesystem') return;
var ps=[esc(p.device)]; if(p.size_bytes) ps.push(fmtSize(p.size_bytes)); if(p.fstype) ps.push('{{T "storage_init.jelenlegi"}} '+esc(p.fstype));
html+=card(p.device, title+' — '+'{{T "storage_wizard.resz_n"}}'.replace('{n}', p.number||'?'), ps.join(' · '), p.state==='filesystem');
});
});
html+='</div>';
document.getElementById('disk-list').innerHTML=html;