refactor some shit

This commit is contained in:
2025-06-21 22:26:22 +02:00
parent 9d6eee0f93
commit 15afa15794
4 changed files with 135 additions and 143 deletions

View File

@@ -695,35 +695,37 @@ export default function AdminPage() {
{/* Mobile-friendly header */}
<div className="flex flex-col sm:flex-row sm:justify-between sm:items-center mb-6 sm:mb-8 space-y-4 sm:space-y-0">
<h1 className="text-2xl sm:text-3xl font-bold">Admin Dashboard</h1>
<div className="flex flex-col sm:flex-row gap-2 sm:gap-2">
<button
onClick={handleLogout}
className="px-4 py-3 sm:py-2 bg-red-600 text-white rounded hover:bg-red-700 text-base font-medium"
>
Logout
</button>
<button
onClick={() => setShowChangePassword(true)}
className="px-4 py-3 sm:py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-base font-medium"
>
Passwort ändern
</button>
<div className="flex flex-col gap-3 sm:flex-row sm:gap-2">
<div className="flex flex-col sm:flex-row gap-2">
<button
onClick={handleLogout}
className="w-full sm:w-auto px-4 py-3 sm:py-2 bg-red-600 text-white rounded hover:bg-red-700 text-sm sm:text-base font-medium"
>
Logout
</button>
<button
onClick={() => setShowChangePassword(true)}
className="w-full sm:w-auto px-4 py-3 sm:py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm sm:text-base font-medium"
>
Passwort ändern
</button>
</div>
{/* Docker warning above export button */}
{isDocker && (
<div className="px-4 py-2 bg-yellow-200 text-yellow-900 rounded border border-yellow-400 font-semibold text-xs sm:text-sm text-center">
<span className="font-bold">Warning:</span> Docker is in use. Exporting will export the entire <span className="font-mono">/app</span> root directory (including all files and folders in the container's root).
</div>
)}
<div className="flex items-center gap-2">
<div className="flex flex-col sm:flex-row items-center gap-2">
<button
onClick={handleExportTarball}
className="px-4 py-3 sm:py-2 bg-green-600 text-white rounded hover:bg-green-700 text-base font-medium"
className="w-full sm:w-auto px-4 py-3 sm:py-2 bg-green-600 text-white rounded hover:bg-green-700 text-sm sm:text-base font-medium whitespace-nowrap"
title="Export Docker Posts"
>
Export Posts
</button>
{rememberExportChoice && lastExportChoice && (
<div className="flex items-center gap-1 text-xs text-gray-600">
<div className="flex items-center gap-1 text-xs text-gray-600 w-full sm:w-auto justify-center sm:justify-start">
<span>💾 {lastExportChoice === 'docker' ? 'Docker' : 'Local'}</span>
<button
onClick={clearExportChoice}