Nav: gelber Update-Punkt, Update-Menueeintrag und UpdateModal entfernt
This commit is contained in:
@@ -4,7 +4,7 @@ import { TOOLS, getGroupedTools } from './toolRegistry.js';
|
|||||||
import CalendarWidget, { CalendarSettings } from './calendar.jsx';
|
import CalendarWidget, { CalendarSettings } from './calendar.jsx';
|
||||||
import { DateiSettings } from './tools/dateien.jsx';
|
import { DateiSettings } from './tools/dateien.jsx';
|
||||||
import { useConfirm } from './confirm.jsx';
|
import { useConfirm } from './confirm.jsx';
|
||||||
import { HomeIcon, AppsIcon, AdminIcon, MoreIcon, UserIcon, LogOutIcon, ChevronIcon, UpdateIcon, TrashIcon, MessageIcon } from './icons.jsx';
|
import { HomeIcon, AppsIcon, AdminIcon, MoreIcon, UserIcon, LogOutIcon, ChevronIcon, TrashIcon, MessageIcon } from './icons.jsx';
|
||||||
import { getOrCreateKeyPair, getPublicKeyJwk, getFingerprint, exportEncrypted, importEncrypted, generateNewKeyPair } from './crypto.js';
|
import { getOrCreateKeyPair, getPublicKeyJwk, getFingerprint, exportEncrypted, importEncrypted, generateNewKeyPair } from './crypto.js';
|
||||||
|
|
||||||
const CONST_ICONS = ['🔗','🌐','📊','📁','🛠','📧','🗓','💾','🖥','📡','🔒','📖','🎯','⚡','🏠','🔧','📱','🎮','🚀','💡'];
|
const CONST_ICONS = ['🔗','🌐','📊','📁','🛠','📧','🗓','💾','🖥','📡','🔒','📖','🎯','⚡','🏠','🔧','📱','🎮','🚀','💡'];
|
||||||
@@ -154,38 +154,8 @@ function Login({ onLogin }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Update Modal ──────────────────────────────────────────────────────────────
|
// ── Update Modal ──────────────────────────────────────────────────────────────
|
||||||
function UpdateModal({ data, onClose }) {
|
|
||||||
return (
|
|
||||||
<Modal title="📦 Update verfügbar" onClose={onClose}>
|
|
||||||
<div style={{ marginBottom:14, padding:'8px 12px', background:'rgba(255,230,109,0.06)',
|
|
||||||
border:'1px solid rgba(255,230,109,0.2)', borderRadius:8 }}>
|
|
||||||
<span style={{ color:'rgba(255,255,255,0.5)', fontSize:12, fontFamily:'monospace' }}>
|
|
||||||
Installiert: <span style={{ color:'#4ecdc4' }}>{data.currentVersion}</span>
|
|
||||||
{' → '}<span style={{ color:'#ffe66d' }}>{data.latestVersion}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{(data.releases||[]).map((r,i)=>(
|
|
||||||
<div key={i} style={{ marginBottom:12, padding:'12px 14px',
|
|
||||||
background:i===0?'rgba(78,205,196,0.05)':'rgba(255,255,255,0.02)',
|
|
||||||
border:`1px solid ${i===0?'rgba(78,205,196,0.2)':'rgba(255,255,255,0.05)'}`, borderRadius:8 }}>
|
|
||||||
<div style={{ display:'flex', justifyContent:'space-between', marginBottom:6 }}>
|
|
||||||
<span style={{ color:i===0?'#4ecdc4':'#fff', fontFamily:"'Space Mono',monospace", fontSize:13, fontWeight:700 }}>{r.name||r.version}</span>
|
|
||||||
<span style={{ color:'rgba(255,255,255,0.3)', fontSize:10, fontFamily:'monospace' }}>
|
|
||||||
{r.publishedAt?new Date(r.publishedAt).toLocaleDateString('de-DE'):''}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<pre style={{ color:'rgba(255,255,255,0.5)', fontSize:12, fontFamily:'monospace', whiteSpace:'pre-wrap', lineHeight:1.6, margin:0 }}>{r.body}</pre>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
<div style={{ color:'rgba(255,255,255,0.55)', fontSize:11, fontFamily:'monospace', marginTop:8, lineHeight:1.8 }}>
|
|
||||||
Update: <code style={{ color:'#4ecdc4' }}>docker compose up -d --build</code>
|
|
||||||
</div>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Desktop Sidebar ───────────────────────────────────────────────────────────
|
// ── Desktop Sidebar ───────────────────────────────────────────────────────────
|
||||||
function Sidebar({ active, setActive, user, onLogout, updateInfo, onUpdateClick, unreadMsgs=0 }) {
|
function Sidebar({ active, setActive, user, onLogout, unreadMsgs=0 }) {
|
||||||
const [appsOpen, setAppsOpen] = useState(true);
|
const [appsOpen, setAppsOpen] = useState(true);
|
||||||
const [collapsed, setCollapsed] = useState(false);
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
|
||||||
@@ -277,17 +247,6 @@ function Sidebar({ active, setActive, user, onLogout, updateInfo, onUpdateClick,
|
|||||||
|
|
||||||
<NavBtn item={{ id:'admin', Icon:AdminIcon, label:'Einstellungen' }} />
|
<NavBtn item={{ id:'admin', Icon:AdminIcon, label:'Einstellungen' }} />
|
||||||
</nav>
|
</nav>
|
||||||
{updateInfo?.hasUpdate && (
|
|
||||||
<button onClick={onUpdateClick} style={{
|
|
||||||
margin:'0 8px 8px', background:'rgba(255,230,109,0.08)',
|
|
||||||
border:'1px solid rgba(255,230,109,0.3)', borderRadius:8,
|
|
||||||
padding:'8px 12px', cursor:'pointer', display:'flex', alignItems:'center', gap:8,
|
|
||||||
}}>
|
|
||||||
<span style={{ width:7, height:7, borderRadius:'50%', background:'#ffe66d', flexShrink:0, boxShadow:'0 0 6px #ffe66d', display:'inline-block' }} />
|
|
||||||
<span style={{ color:'#ffe66d', fontSize:11, fontFamily:'monospace' }}>Update</span>
|
|
||||||
<span style={{ color:'rgba(255,230,109,0.5)', fontSize:10, fontFamily:'monospace', marginLeft:'auto' }}>{updateInfo.latestVersion}</span>
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
<div style={{ padding:'10px 12px 16px', borderTop:'1px solid rgba(255,255,255,0.06)' }}>
|
<div style={{ padding:'10px 12px 16px', borderTop:'1px solid rgba(255,255,255,0.06)' }}>
|
||||||
{!collapsed && <><div style={{ display:'flex', alignItems:'center', gap:8, marginBottom:8 }}>
|
{!collapsed && <><div style={{ display:'flex', alignItems:'center', gap:8, marginBottom:8 }}>
|
||||||
<div style={{ width:24, height:24, borderRadius:'50%', background:'linear-gradient(135deg,#ff6b9d,#4ecdc4)',
|
<div style={{ width:24, height:24, borderRadius:'50%', background:'linear-gradient(135deg,#ff6b9d,#4ecdc4)',
|
||||||
@@ -306,7 +265,7 @@ function Sidebar({ active, setActive, user, onLogout, updateInfo, onUpdateClick,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Mobile Bottom Navigation ──────────────────────────────────────────────────
|
// ── Mobile Bottom Navigation ──────────────────────────────────────────────────
|
||||||
function BottomNav({ active, setActive, user, onLogout, updateInfo, onUpdateClick, unreadMsgs=0 }) {
|
function BottomNav({ active, setActive, user, onLogout, unreadMsgs=0 }) {
|
||||||
const [menuOpen, setMenuOpen] = useState(false);
|
const [menuOpen, setMenuOpen] = useState(false);
|
||||||
const [appsOpen, setAppsOpen] = useState(false);
|
const [appsOpen, setAppsOpen] = useState(false);
|
||||||
const NAV_H = 56;
|
const NAV_H = 56;
|
||||||
@@ -382,7 +341,6 @@ function BottomNav({ active, setActive, user, onLogout, updateInfo, onUpdateClic
|
|||||||
|
|
||||||
{/* Mehr Sheet */}
|
{/* Mehr Sheet */}
|
||||||
<Sheet open={menuOpen} onClose={()=>setMenuOpen(false)}>
|
<Sheet open={menuOpen} onClose={()=>setMenuOpen(false)}>
|
||||||
{updateInfo?.hasUpdate && <MI Icon={UpdateIcon} label={`Update: ${updateInfo.latestVersion}`} onClick={()=>{setMenuOpen(false);onUpdateClick();}} color="#ffe66d"/>}
|
|
||||||
<div style={{height:1, background:'rgba(255,255,255,0.08)', margin:'4px 0'}}/>
|
<div style={{height:1, background:'rgba(255,255,255,0.08)', margin:'4px 0'}}/>
|
||||||
<MI Icon={UserIcon} label={user?.username||''} onClick={()=>{}} color="rgba(255,255,255,0.35)"/>
|
<MI Icon={UserIcon} label={user?.username||''} onClick={()=>{}} color="rgba(255,255,255,0.35)"/>
|
||||||
<MI Icon={LogOutIcon} label="Ausloggen" onClick={()=>{onLogout();setMenuOpen(false);}} color="#ff6b9d"/>
|
<MI Icon={LogOutIcon} label="Ausloggen" onClick={()=>{onLogout();setMenuOpen(false);}} color="#ff6b9d"/>
|
||||||
@@ -406,11 +364,6 @@ function BottomNav({ active, setActive, user, onLogout, updateInfo, onUpdateClic
|
|||||||
style={{ flex:1, display:'flex', flexDirection:'column', alignItems:'center',
|
style={{ flex:1, display:'flex', flexDirection:'column', alignItems:'center',
|
||||||
justifyContent:'center', gap:3, background:'transparent', border:'none',
|
justifyContent:'center', gap:3, background:'transparent', border:'none',
|
||||||
cursor:'pointer', position:'relative', minWidth:0, padding:'0 4px' }}>
|
cursor:'pointer', position:'relative', minWidth:0, padding:'0 4px' }}>
|
||||||
{isMehr && updateInfo?.hasUpdate && (
|
|
||||||
<span style={{ position:'absolute', top:6, right:'calc(50% - 16px)',
|
|
||||||
width:8, height:8, borderRadius:'50%', background:'#ffe66d',
|
|
||||||
boxShadow:'0 0 6px #ffe66d', display:'inline-block' }} />
|
|
||||||
)}
|
|
||||||
{isApps && unreadMsgs>0 && (
|
{isApps && unreadMsgs>0 && (
|
||||||
<span style={{ position:'absolute', top:6, right:'calc(50% - 16px)',
|
<span style={{ position:'absolute', top:6, right:'calc(50% - 16px)',
|
||||||
width:8, height:8, borderRadius:'50%', background:'#4ecdc4',
|
width:8, height:8, borderRadius:'50%', background:'#4ecdc4',
|
||||||
@@ -2385,8 +2338,6 @@ export default function App() {
|
|||||||
setActiveRaw(page);
|
setActiveRaw(page);
|
||||||
};
|
};
|
||||||
const [toastMsg,setToastMsg]=useState({msg:'',type:'success'});
|
const [toastMsg,setToastMsg]=useState({msg:'',type:'success'});
|
||||||
const [updateInfo,setUpdateInfo]=useState(null);
|
|
||||||
const [showUpd,setShowUpd]=useState(false);
|
|
||||||
const [unreadMsgs, setUnreadMsgs] = useState(0);
|
const [unreadMsgs, setUnreadMsgs] = useState(0);
|
||||||
const [unreadBoard, setUnreadBoard] = useState(0);
|
const [unreadBoard, setUnreadBoard] = useState(0);
|
||||||
const [unreadPromoted, setUnreadPromoted] = useState(0);
|
const [unreadPromoted, setUnreadPromoted] = useState(0);
|
||||||
@@ -2406,10 +2357,6 @@ export default function App() {
|
|||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(!user)return;
|
if(!user)return;
|
||||||
const check=()=>api('/system/update-check').then(setUpdateInfo).catch(()=>{});
|
|
||||||
check();
|
|
||||||
const t=setInterval(check,5*60*1000);
|
|
||||||
return()=>clearInterval(t);
|
|
||||||
},[user]);
|
},[user]);
|
||||||
|
|
||||||
// Schlüssel sofort nach Login initialisieren und Public Key registrieren
|
// Schlüssel sofort nach Login initialisieren und Public Key registrieren
|
||||||
@@ -2482,7 +2429,7 @@ export default function App() {
|
|||||||
{!mobile && (
|
{!mobile && (
|
||||||
<Sidebar active={active} setActive={setActive} user={user}
|
<Sidebar active={active} setActive={setActive} user={user}
|
||||||
onLogout={()=>{localStorage.removeItem('sk_token');setUser(null);}}
|
onLogout={()=>{localStorage.removeItem('sk_token');setUser(null);}}
|
||||||
updateInfo={updateInfo} onUpdateClick={()=>setShowUpd(true)}
|
|
||||||
unreadMsgs={unreadMsgs}/>
|
unreadMsgs={unreadMsgs}/>
|
||||||
)}
|
)}
|
||||||
<main style={mainStyle}>
|
<main style={mainStyle}>
|
||||||
@@ -2494,11 +2441,10 @@ export default function App() {
|
|||||||
{mobile && (
|
{mobile && (
|
||||||
<BottomNav active={active} setActive={setActive} user={user}
|
<BottomNav active={active} setActive={setActive} user={user}
|
||||||
onLogout={()=>{localStorage.removeItem('sk_token');setUser(null);}}
|
onLogout={()=>{localStorage.removeItem('sk_token');setUser(null);}}
|
||||||
updateInfo={updateInfo} onUpdateClick={()=>setShowUpd(true)}
|
|
||||||
unreadMsgs={unreadMsgs}/>
|
unreadMsgs={unreadMsgs}/>
|
||||||
)}
|
)}
|
||||||
<Toast msg={toastMsg.msg} type={toastMsg.type}/>
|
<Toast msg={toastMsg.msg} type={toastMsg.type}/>
|
||||||
{showUpd&&updateInfo&&<UpdateModal data={updateInfo} onClose={()=>setShowUpd(false)}/>}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user