feat: homelab deployment - NPM + IONOS DNS + monitoring + NAS backup
- Restructured docker-compose for Nginx Proxy Manager (no custom nginx) - Added domain wordly.art configuration - Added Prometheus + Grafana monitoring stack with pre-configured dashboards - Added PostgreSQL backup script to NAS (daily/weekly/monthly rotation) - Added alert rules for backend, system, and Docker metrics - Updated deployment guide for NPM + IONOS DNS homelab setup - Added marketing plan document - PDF translator and watermark support - Enhanced middleware, routes, and translator modules Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { Settings, AlertCircle, Loader2 } from "lucide-react";
|
||||
import { Settings, AlertCircle, Loader2, RotateCcw, CheckCircle2 } from "lucide-react";
|
||||
import { useSystemPage } from "./useSystemPage";
|
||||
import { CleanupSection } from "./CleanupSection";
|
||||
import { DiskSpaceCard } from "./DiskSpaceCard";
|
||||
import { ProviderStatus } from "../ProviderStatus";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
|
||||
export default function AdminSystemPage() {
|
||||
const { data, isLoading, error, isPurging, purgeResult, handleCleanup } = useSystemPage();
|
||||
const {
|
||||
data, isLoading, error,
|
||||
isPurging, purgeResult, handleCleanup,
|
||||
isResetting, resetResult, handleResetQuotas,
|
||||
} = useSystemPage();
|
||||
const { t } = useI18n();
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -16,9 +24,9 @@ export default function AdminSystemPage() {
|
||||
<Settings className="w-5 h-5 text-purple-400" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-xl font-semibold text-foreground">Système</h1>
|
||||
<h1 className="text-xl font-semibold text-foreground">{t('admin.system.title')}</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Surveiller l'état du système et gérer les ressources
|
||||
{t('admin.system.subtitle')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,7 +40,7 @@ export default function AdminSystemPage() {
|
||||
|
||||
{isLoading && !data ? (
|
||||
<div className="grid grid-cols-1 gap-3 md:grid-cols-2">
|
||||
{[1, 2].map((i) => (
|
||||
{[1, 2, 3].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="h-[88px] animate-pulse rounded-lg border border-border bg-card"
|
||||
@@ -52,6 +60,43 @@ export default function AdminSystemPage() {
|
||||
purgeResult={purgeResult}
|
||||
onCleanup={handleCleanup}
|
||||
/>
|
||||
|
||||
{/* Reset Translation Quotas */}
|
||||
<Card className="py-0">
|
||||
<CardContent className="flex items-center gap-3 px-4 py-3">
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-lg bg-amber-500/10">
|
||||
<RotateCcw className="size-4 text-amber-500" />
|
||||
</div>
|
||||
<div className="flex flex-1 flex-col gap-0.5">
|
||||
<span className="text-[10px] font-medium uppercase tracking-wider text-muted-foreground">
|
||||
{t('admin.system.quotas')}
|
||||
</span>
|
||||
<span className="text-sm font-semibold text-foreground">
|
||||
{t('admin.system.resetQuotas')}
|
||||
</span>
|
||||
{resetResult && (
|
||||
<span className="text-[10px] text-green-500 flex items-center gap-1">
|
||||
<CheckCircle2 className="size-3" />
|
||||
{resetResult.message}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 shrink-0 gap-1.5 border-amber-200/30 text-amber-600 hover:bg-amber-500/10 hover:text-amber-600 text-xs"
|
||||
onClick={handleResetQuotas}
|
||||
disabled={isResetting}
|
||||
>
|
||||
{isResetting ? (
|
||||
<Loader2 className="size-3 animate-spin" />
|
||||
) : (
|
||||
<RotateCcw className="size-3" />
|
||||
)}
|
||||
{isResetting ? t('admin.system.resetting') : t('admin.system.reset')}
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -1,14 +1,39 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useAdminDashboard } from "../useAdminDashboard";
|
||||
import { useCleanup } from "../useCleanup";
|
||||
import { useTranslationStore } from "@/lib/store";
|
||||
import { API_BASE } from "@/lib/config";
|
||||
|
||||
export function useSystemPage() {
|
||||
const { data, isLoading, error } = useAdminDashboard();
|
||||
const { isPurging, purgeResult, error: cleanupError, triggerCleanup } = useCleanup();
|
||||
const { settings } = useTranslationStore();
|
||||
|
||||
const [isResetting, setIsResetting] = useState(false);
|
||||
const [resetResult, setResetResult] = useState<{ keys_deleted: number; message: string } | null>(null);
|
||||
|
||||
const handleCleanup = () => triggerCleanup();
|
||||
|
||||
const handleResetQuotas = async () => {
|
||||
if (!settings.adminToken) return;
|
||||
setIsResetting(true);
|
||||
setResetResult(null);
|
||||
try {
|
||||
const res = await fetch(`${API_BASE}/api/v1/admin/quota/reset`, {
|
||||
method: "POST",
|
||||
headers: { Authorization: `Bearer ${settings.adminToken}` },
|
||||
});
|
||||
const json = await res.json();
|
||||
setResetResult(json);
|
||||
} catch {
|
||||
setResetResult({ keys_deleted: 0, message: "Erreur réseau" });
|
||||
} finally {
|
||||
setIsResetting(false);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
data,
|
||||
isLoading,
|
||||
@@ -16,5 +41,8 @@ export function useSystemPage() {
|
||||
isPurging,
|
||||
purgeResult,
|
||||
handleCleanup,
|
||||
isResetting,
|
||||
resetResult,
|
||||
handleResetQuotas,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user