Separate system accounts and household people, add generation directory and consented member location sharing

This commit is contained in:
Codex
2026-10-18 20:00:43 +08:00
parent 67bc5a1ba9
commit 3b2c046060
52 changed files with 1497 additions and 311 deletions
+6 -4
View File
@@ -20,7 +20,8 @@ function applyPermissions(){
$('#scan-result').hidden=!isPlatformAdmin();
$('#new-household').hidden=!isPlatformAdmin();
$('#household-context').hidden=!loggedIn;
$('#household-filter').disabled=!isPlatformAdmin();
$('#household-filter').disabled=(state.households||[]).length<2;
$('nav [data-page="accounts"]').hidden=!isPlatformAdmin();
if(typeof renderSteward==='function')renderSteward();
$('#current-user').textContent=currentUser ? currentUser.name+' · '+roleName(currentUser) : '';
}
@@ -63,17 +64,18 @@ function showPage(page, options={}) {
setMobileMenu(false);
if(typeof leaveJournal==='function'&&activePage==='journal'&&page!=='journal'){if(!confirmJournalDiscard())return;leaveJournal();}
if(typeof leaveSettings==='function'&&activePage==='settings'&&page!=='settings')leaveSettings();
if(!isAdmin()&&!['households','overview','objects','device','live','playback','family','heritage','heritage-records','settings','journal'].includes(page))return;
if(!isAdmin()&&!['members','households','overview','objects','device','live','playback','family','heritage','heritage-records','settings','journal'].includes(page))return;
if(['accounts','users'].includes(page)&&!isPlatformAdmin())return;
if(['heritage','family','heritage-records'].includes(page)&&currentHome()?.kind&&currentHome().kind!=='home')return;
if(['objects','overview','sites','users','family','heritage','heritage-records','households','storage','settings','journal'].includes(page)&&typeof deviceContext!=='undefined')deviceContext=null;
if(typeof scopeEntered!=='undefined'){if(page==='households')scopeEntered=false;else if(!['storage','settings'].includes(page))scopeEntered=true;}
if(typeof scopeEntered!=='undefined'){if(['households','accounts','users'].includes(page))scopeEntered=false;else if(!['storage','settings'].includes(page))scopeEntered=true;}
if(page==='storage'&&!isPlatformAdmin())return;
if(page!=='heritage-records'&&typeof resetHeritage==='function')resetHeritage();
if (activePage !== page) {stopPlayers();if(typeof closePtz==='function')closePtz();}
if(page!=='family'&&typeof closeFamilyFullscreen==='function')closeFamilyFullscreen();
if(page!=='live'&&typeof closeWallFullscreen==='function')closeWallFullscreen();
const pageChanged=activePage!==page;activePage = page;
$('.metrics').hidden=['family','users','households','heritage','heritage-records','settings','journal','device'].includes(page);
$('.metrics').hidden=['members','accounts','family','users','households','heritage','heritage-records','settings','journal','device'].includes(page);
$('.filter-row').hidden=!['objects','sites','live','playback','cameras'].includes(page)||!!deviceContext;
$$('.page').forEach(el => el.hidden = el.id !== 'page-' + page);
$$('nav button').forEach(b => b.classList.toggle('active', b.dataset.page === page || b.dataset.page==='objects'&&['sites','device','cameras','recorders','live','playback'].includes(page)||b.dataset.page==='heritage'&&['family','heritage-records'].includes(page)));