diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 67b4270..538fae6 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -233,12 +233,10 @@ export default function AdminPage() {

Admin Settings

-
-
- {loading ? ( -
Loading settings...
- ) : ( -
+ {loading ? ( +
Loading settings...
+ ) : ( +
)} -
-
); } diff --git a/src/app/api/version/route.ts b/src/app/api/version/route.ts new file mode 100644 index 0000000..3c18894 --- /dev/null +++ b/src/app/api/version/route.ts @@ -0,0 +1,34 @@ +import { NextResponse } from 'next/server'; +import { execSync } from 'child_process'; + +export async function GET() { + try { + // Get the total number of commits + const commitCount = execSync('git rev-list --count HEAD', { + encoding: 'utf-8', + stdio: ['pipe', 'pipe', 'ignore'] // Ignore stderr + }).trim(); + + // Also get the short hash for reference + const commitHash = execSync('git rev-parse --short HEAD', { + encoding: 'utf-8', + stdio: ['pipe', 'pipe', 'ignore'] + }).trim(); + + return NextResponse.json({ + count: parseInt(commitCount, 10), + hash: commitHash, + fullHash: execSync('git rev-parse HEAD', { + encoding: 'utf-8', + stdio: ['pipe', 'pipe', 'ignore'] + }).trim() + }); + } catch (error) { + // If git is not available or not a git repo, return unknown + return NextResponse.json({ + count: null, + hash: 'unknown', + fullHash: null + }); + } +} diff --git a/src/app/moderation/page.tsx b/src/app/moderation/page.tsx index d83fecf..67a2ea1 100644 --- a/src/app/moderation/page.tsx +++ b/src/app/moderation/page.tsx @@ -189,45 +189,29 @@ export default function ModerationPage() {

Moderation

-
-
- - - -
+
+ + + +
- {tab === 'reports' && ( -
+ {tab === 'reports' && ( +
{(['open', 'resolved', 'all'] as const).map((status) => ( @@ -256,7 +240,7 @@ export default function ModerationPage() { {reports.map((report) => (
-
+
@{report.target.author.handle}: {report.target.content || '[repost]'}
@@ -329,7 +315,7 @@ export default function ModerationPage() { )} {tab === 'posts' && ( -
+
{loading ? (
Loading posts...
) : posts.length === 0 ? ( @@ -339,7 +325,7 @@ export default function ModerationPage() { {posts.map((post) => (
-
+
-
{post.content || '[repost]'}
+
{post.content || '[repost]'}
{post.removedReason && (
Reason: {post.removedReason} @@ -383,7 +369,7 @@ export default function ModerationPage() { )} {tab === 'users' && ( -
+
{loading ? (
Loading users...
) : users.length === 0 ? ( @@ -393,7 +379,7 @@ export default function ModerationPage() { {users.map((user) => (
-
+
)} -
); } diff --git a/src/components/LayoutWrapper.tsx b/src/components/LayoutWrapper.tsx index acf8d95..11aafb2 100644 --- a/src/components/LayoutWrapper.tsx +++ b/src/components/LayoutWrapper.tsx @@ -13,8 +13,7 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) { const isStandalone = pathname === '/login' || pathname === '/register' || - pathname?.startsWith('/install') || - pathname?.startsWith('/admin'); + pathname?.startsWith('/install'); if (loading) { return ( diff --git a/src/components/RightSidebar.tsx b/src/components/RightSidebar.tsx index a00c7d2..68f1b73 100644 --- a/src/components/RightSidebar.tsx +++ b/src/components/RightSidebar.tsx @@ -19,6 +19,7 @@ export function RightSidebar() { bannerUrl: '', admins: [] as Admin[], }); + const [version, setVersion] = useState<{ count: number | null; hash: string; fullHash: string | null } | null>(null); const [loading, setLoading] = useState(true); @@ -39,6 +40,12 @@ export function RightSidebar() { }) .catch(() => { }) .finally(() => setLoading(false)); + + // Fetch version info + fetch('/api/version') + .then(res => res.json()) + .then(data => setVersion(data)) + .catch(() => setVersion({ count: null, hash: 'unknown', fullHash: null })); }, []); if (loading) { @@ -108,7 +115,15 @@ export function RightSidebar() {

Network Info

- Running Synapsis v0.1.0 + Running Synapsis + {version && version.count !== null && ( + <> + {' • '} + + Commit {version.count} + + + )}

{nodeInfo.admins.length > 0 && (