refactor(admin): ApiCore-Synchronisierung nur noch einmal auf dem Dashboard
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 2m25s
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 2m25s
Derselbe "Alles synchronisieren"-Knopf stand auf /admin/produkte und /admin/ernten und sah dadurch wie zwei verschiedene Abgleiche aus. Er sitzt jetzt einmal auf dem Dashboard, das Ergebnis des Laufs erscheint dort oben. Die Action springt standardmaessig nach /admin zurueck; die alten Ziele bleiben in der Whitelist erlaubt. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
11eccec01b
commit
ae2726b0ee
5 files changed
+21
-18
No files matched your search
+11
-1
@@ -1,4 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import { ApiCoreSyncPanel, ApiCoreSyncResult } from "@/components/apicore-sync-panel";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { formatPrice } from "@/lib/format";
|
||||
import { getLocale } from "@/i18n/locale";
|
||||
@@ -100,7 +101,8 @@ function daysAgo(n: number): Date {
|
||||
return d;
|
||||
}
|
||||
|
||||
export default async function AdminDashboardPage() {
|
||||
export default async function AdminDashboardPage(props: PageProps<"/admin">) {
|
||||
const searchParams = await props.searchParams;
|
||||
const locale = await getLocale();
|
||||
const t = getDictionary(locale);
|
||||
const [
|
||||
@@ -306,6 +308,9 @@ export default async function AdminDashboardPage() {
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
{/* Ergebnis des ApiCore-Laufs (nur direkt nach dem Klick sichtbar). */}
|
||||
<ApiCoreSyncResult searchParams={searchParams} />
|
||||
|
||||
{/* Fehlen Dateien, zu denen die Datenbank noch Pfade haelt, ist das
|
||||
fast immer ein nicht persistentes Upload-Verzeichnis (in Kubernetes
|
||||
ein "emptyDir" statt eines PersistentVolumeClaim). Ohne diesen
|
||||
@@ -576,6 +581,11 @@ export default async function AdminDashboardPage() {
|
||||
{t.adminDashboardPage.viewAllOrders}
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
{/* Der eine Sync-Knopf fuer Ernten, Chargen und Produkte. */}
|
||||
<div className="mt-10 max-w-3xl">
|
||||
<ApiCoreSyncPanel returnTo="/admin" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user