Rename the unified application to dashboard

This commit is contained in:
2026-11-04 23:01:32 +08:00
parent 4ec83f2603
commit 61d80f352f
223 changed files with 42 additions and 42 deletions
+6
View File
@@ -0,0 +1,6 @@
import type {GetServerSideProps} from 'next';
import {getPost} from '@/lib/library';
import {findWikiPage} from '@/content/wiki';
import {pageId,exploreUrl} from '@/content/page-links';
export default function Legacy(){return null;}
export const getServerSideProps:GetServerSideProps=async({params,query})=>{const key=String(params?.key||'');const page=findWikiPage(key);let destination='';if(page?.namespace==='Category')destination='/categories?category='+encodeURIComponent(page.slug);else if(page)destination=exploreUrl(pageId('wiki:'+key));else{const index=key.indexOf(':');if(!['Main','File'].includes(key.slice(0,index)))return {notFound:true};const post=await getPost(key.slice(index+1));if(post)destination=exploreUrl(post.id);}if(!destination)return {notFound:true};if(String(query.agent_mode||'').toLowerCase()==='true')destination+=(destination.includes('?')?'&':'?')+'agent_mode=True';return {redirect:{destination,permanent:true}};};