'use client'; export const dynamic = "force-dynamic"; /********************************************* * This is the main admin page for the blog. * * Written Jun 19 2025 * Rewritten fucking 15 times cause of the * fucking * typescript linter. * * If any Issues about "Window" (For Monaco) pop up. Its not my fucking fault * * Push later when on local Network. (//5jul25) ## Already done **********************************************/ import { useState, useEffect, useCallback, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { marked } from 'marked'; import hljs from 'highlight.js'; import matter from 'gray-matter'; import dynamicImport from 'next/dynamic'; import { Theme } from 'emoji-picker-react'; import '../highlight-github.css'; import { withBaseUrl } from '@/lib/baseUrl'; const MonacoEditor = dynamicImport(() => import('./MonacoEditor'), { ssr: false }); // Import monaco-vim only on client side let initVimMode: any = null; let VimMode: any = null; if (typeof window !== 'undefined') { const monacoVim = require('monaco-vim'); initVimMode = monacoVim.initVimMode; VimMode = monacoVim.VimMode; } import '@fontsource/jetbrains-mono'; interface Post { slug: string; title: string; date: string; tags: string[]; summary: string; content: string; pinned: boolean; } interface Folder { type: 'folder'; name: string; path: string; children: (Post | Folder)[]; emoji?: string; } interface Post { type: 'post'; slug: string; title: string; date: string; tags: string[]; summary: string; content: string; pinned: boolean; } type Node = Post | Folder; const EmojiPicker = dynamicImport(() => import('emoji-picker-react'), { ssr: false }); // Patch marked renderer to always add 'hljs' class to code blocks const renderer = new marked.Renderer(); renderer.code = function(code, infostring, escaped) { const lang = (infostring || '').match(/\S*/)?.[0]; const highlighted = lang && hljs.getLanguage(lang) ? hljs.highlight(code, { language: lang }).value : hljs.highlightAuto(code).value; const langClass = lang ? `language-${lang}` : ''; return `
${highlighted}`;
};
export default function AdminPage() {
const [isAuthenticated, setIsAuthenticated] = useState(false);
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [nodes, setNodes] = useStateHow are you hosting this application?
If you don't know your method of hosting, ask your Systems Administrator
Ziehe Markdown-Dateien hierher
Dateien werden hochgeladen zu: {currentPath.join('/') || 'root'}
{post.date}
{post.summary}
Lösche Beiträge und Ordner, verwalte deine Inhaltsstruktur
{/* Folder navigation breadcrumbs */}