diff --git a/.gitea/workflows/dev-deploy.yml b/.gitea/workflows/dev-deploy.yml index 2f34bdc..bc7904b 100644 --- a/.gitea/workflows/dev-deploy.yml +++ b/.gitea/workflows/dev-deploy.yml @@ -68,7 +68,7 @@ jobs: # Remove old images to force re-pull with correct architecture echo "🔄 Removing old images to force re-pull..." - docker rmi postgres:15-alpine redis:7-alpine 2>/dev/null || true + docker rmi postgres:16-alpine redis:7-alpine 2>/dev/null || true # Ensure networks exist before compose starts (network is external) echo "🌐 Ensuring networks exist..." diff --git a/app/components/About.tsx b/app/components/About.tsx index adad4ad..4a04a46 100644 --- a/app/components/About.tsx +++ b/app/components/About.tsx @@ -126,7 +126,7 @@ const About = () => {

Status

- +
diff --git a/app/components/ActivityFeed.tsx b/app/components/ActivityFeed.tsx index 2256a77..770fe77 100644 --- a/app/components/ActivityFeed.tsx +++ b/app/components/ActivityFeed.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { Disc3, Gamepad2, Zap, Quote as QuoteIcon } from "lucide-react"; import { useTranslations } from "next-intl"; @@ -22,14 +22,28 @@ const techQuotes = { { content: "Einfachheit ist die Voraussetzung fĂŒr VerlĂ€sslichkeit.", author: "Edsger W. Dijkstra" }, { content: "Wenn Debugging der Prozess des Entfernens von Fehlern ist, dann muss Programmieren der Prozess des Einbauens sein.", author: "Edsger W. Dijkstra" }, { content: "Gelöschter Code ist gedebuggter Code.", author: "Jeff Sickel" }, - { content: "Zuerst löse das Problem. Dann schreibe den Code.", author: "John Johnson" } + { content: "Zuerst löse das Problem. Dann schreibe den Code.", author: "John Johnson" }, + { content: "Jedes Programm kann um mindestens einen Faktor zwei vereinfacht werden. Jedes Programm hat mindestens einen Bug.", author: "Kernighan's Law" }, + { content: "Code lesen ist schwieriger als Code schreiben — deshalb schreibt jeder neu.", author: "Joel Spolsky" }, + { content: "Die beste Performance-Optimierung ist der Übergang von nicht-funktionierend zu funktionierend.", author: "J. Osterhout" }, + { content: "Mach es funktionierend, dann mach es schön, dann mach es schnell — in dieser Reihenfolge.", author: "Kent Beck" }, + { content: "Software ist wie Entropie: Es ist schwer zu fassen, wiegt nichts und gehorcht dem zweiten Hauptsatz der Thermodynamik.", author: "Norman Augustine" }, + { content: "Gute Software ist nicht die, die keine Bugs hat — sondern die, deren Bugs keine Rolle spielen.", author: "Bruce Eckel" }, + { content: "Der einzige Weg, schnell zu gehen, ist, gut zu gehen.", author: "Robert C. Martin" }, ], en: [ { content: "Computer Science is no more about computers than astronomy is about telescopes.", author: "Edsger W. Dijkstra" }, { content: "Simplicity is prerequisite for reliability.", author: "Edsger W. Dijkstra" }, { content: "If debugging is the process of removing software bugs, then programming must be the process of putting them in.", author: "Edsger W. Dijkstra" }, { content: "Deleted code is debugged code.", author: "Jeff Sickel" }, - { content: "First, solve the problem. Then, write the code.", author: "John Johnson" } + { content: "First, solve the problem. Then, write the code.", author: "John Johnson" }, + { content: "Any program can be simplified by at least a factor of two. Every program has at least one bug.", author: "Kernighan's Law" }, + { content: "It's harder to read code than to write it — that's why everyone rewrites.", author: "Joel Spolsky" }, + { content: "The best performance optimization is the transition from a non-working state to a working state.", author: "J. Osterhout" }, + { content: "Make it work, make it right, make it fast — in that order.", author: "Kent Beck" }, + { content: "Software is like entropy: it is difficult to grasp, weighs nothing, and obeys the second law of thermodynamics.", author: "Norman Augustine" }, + { content: "Good software isn't software with no bugs — it's software whose bugs don't matter.", author: "Bruce Eckel" }, + { content: "The only way to go fast is to go well.", author: "Robert C. Martin" }, ] }; @@ -39,30 +53,20 @@ function getSafeGamingText(details: string | number | undefined, state: string | return fallback; } -export default function ActivityFeed({ +export default function ActivityFeed({ onActivityChange, - idleQuote, locale = 'en' -}: { +}: { onActivityChange?: (active: boolean) => void; - idleQuote?: string; locale?: string; }) { const [data, setData] = useState(null); const [hasActivity, setHasActivity] = useState(false); - const [quoteIndex, setQuoteIndex] = useState(0); + const [quoteIndex, setQuoteIndex] = useState(() => Math.floor(Math.random() * (techQuotes[locale as keyof typeof techQuotes] || techQuotes.en).length)); const [loading, setLoading] = useState(true); const t = useTranslations("home.about.activity"); - const currentQuotes = techQuotes[locale as keyof typeof techQuotes] || techQuotes.en; - - // Combine CMS quote with tech quotes if available - const allQuotes = React.useMemo(() => { - if (idleQuote) { - return [{ content: idleQuote, author: "Dennis Konkol" }, ...currentQuotes]; - } - return currentQuotes; - }, [idleQuote, currentQuotes]); + const allQuotes = techQuotes[locale as keyof typeof techQuotes] || techQuotes.en; useEffect(() => { const fetchData = async () => { @@ -92,16 +96,20 @@ export default function ActivityFeed({ fetchData(); const statusInterval = setInterval(fetchData, 30000); - // Cycle quotes every 10 seconds + // Pick a random quote every 10 seconds (never the same one twice in a row) const quoteInterval = setInterval(() => { - setQuoteIndex((prev) => (prev + 1) % allQuotes.length); + setQuoteIndex((prev) => { + let next; + do { next = Math.floor(Math.random() * allQuotes.length); } while (next === prev && allQuotes.length > 1); + return next; + }); }, 10000); return () => { clearInterval(statusInterval); clearInterval(quoteInterval); }; - }, [onActivityChange, allQuotes.length]); + }, [onActivityChange]); if (loading) { return