mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 21:00:41 +00:00
feat: update backup routes and navigation links for consistency
This commit is contained in:
@@ -87,7 +87,7 @@ export default function AppAuthenticatedShell(props: AppAuthenticatedShellProps)
|
||||
<span>{t('nav_device_management')}</span>
|
||||
</Link>
|
||||
{props.profile?.role === 'admin' && (
|
||||
<Link href="/help" className={`side-link ${props.location === '/help' ? 'active' : ''}`}>
|
||||
<Link href="/backup" className={`side-link ${props.location === '/backup' ? 'active' : ''}`}>
|
||||
<Cloud size={16} />
|
||||
<span>{t('nav_backup_strategy')}</span>
|
||||
</Link>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { lazy, Suspense } from 'preact/compat';
|
||||
import { useEffect } from 'preact/hooks';
|
||||
import { Link, Route, Switch } from 'wouter';
|
||||
import { ArrowUpDown, Cloud, LogOut, Settings as SettingsIcon, Shield, ShieldUser } from 'lucide-preact';
|
||||
import type { ImportAttachmentFile, ImportResultSummary } from '@/components/ImportPage';
|
||||
@@ -21,6 +22,13 @@ function RouteContentFallback() {
|
||||
return <div className="loading-screen">{t('txt_loading_nodewarden')}</div>;
|
||||
}
|
||||
|
||||
function LegacyBackupRedirect(props: { onNavigate: (path: string) => void }) {
|
||||
useEffect(() => {
|
||||
props.onNavigate('/backup');
|
||||
}, [props]);
|
||||
return null;
|
||||
}
|
||||
|
||||
export interface AppMainRoutesProps {
|
||||
profile: Profile | null;
|
||||
session: SessionState | null;
|
||||
@@ -232,7 +240,7 @@ export default function AppMainRoutes(props: AppMainRoutesProps) {
|
||||
</Link>
|
||||
)}
|
||||
{props.profile.role === 'admin' && (
|
||||
<Link href="/help" className="mobile-settings-link">
|
||||
<Link href="/backup" className="mobile-settings-link">
|
||||
<Cloud size={18} />
|
||||
<span>{t('nav_backup_strategy')}</span>
|
||||
</Link>
|
||||
@@ -299,6 +307,9 @@ export default function AppMainRoutes(props: AppMainRoutesProps) {
|
||||
</Route>
|
||||
))}
|
||||
<Route path="/help">
|
||||
<LegacyBackupRedirect onNavigate={props.onNavigate} />
|
||||
</Route>
|
||||
<Route path="/backup">
|
||||
{props.profile?.role === 'admin' ? (
|
||||
<div className="stack">
|
||||
{props.mobileLayout && (
|
||||
|
||||
Reference in New Issue
Block a user