Alter Maintenance-Screen hinzugefügt

This commit is contained in:
PxlLoewe
2025-07-03 21:17:23 -07:00
parent 2ff2c3274a
commit 7c050cf42e
16 changed files with 168 additions and 199 deletions

View File

@@ -0,0 +1,17 @@
/*
Warnings:
- You are about to drop the column `active` on the `Notam` table. All the data in the column will be lost.
- You are about to drop the column `showUntil` on the `Notam` table. All the data in the column will be lost.
- You are about to drop the column `updatedAt` on the `Notam` table. All the data in the column will be lost.
- You are about to drop the column `wartungsmodus` on the `Notam` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Notam" DROP COLUMN "active",
DROP COLUMN "showUntil",
DROP COLUMN "updatedAt",
DROP COLUMN "wartungsmodus",
ADD COLUMN "maintenanceEnabled" BOOLEAN NOT NULL DEFAULT false,
ALTER COLUMN "color" DROP NOT NULL,
ALTER COLUMN "message" SET DEFAULT '';

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `showUntilActive` on the `Notam` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Notam" DROP COLUMN "showUntilActive";

View File

@@ -8,14 +8,10 @@ enum GlobalColor {
}
model Notam {
id Int @id @default(autoincrement())
color GlobalColor
message String
showUntil DateTime
showUntilActive Boolean @default(false)
wartungsmodus Boolean @default(false)
disableHPG Boolean @default(false)
active Boolean
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
color GlobalColor?
message String @default("")
maintenanceEnabled Boolean @default(false)
disableHPG Boolean @default(false)
createdAt DateTime @default(now())
}

View File

@@ -0,0 +1,46 @@
"use client";
import { useEffect, useState } from "react";
export const Maintenance = ({ message }: { message?: string }) => {
const [rotationSpeed, setRotationSpeed] = useState(0);
const [rotationDeg, setRotationDeg] = useState(0);
useEffect(() => {
const interval = setInterval(() => {
setRotationDeg(rotationDeg + rotationSpeed);
});
return () => {
clearInterval(interval);
};
}, [rotationDeg, rotationSpeed]);
return (
<div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-[10px] min-h-0 bg-base-300 shadow-lg p-8">
<h1 className="text-4xl font-bold text-center">Wartungsarbeiten</h1>
<p className="text-base text-center mx-6">
{message || "Unsere Website wird derzeit gewartet. Bitte versuchen Sie es später erneut."}
</p>
<div className="flex flex-col items-center gap-6 mt-6">
<img
src={`${process.env.NEXT_PUBLIC_HUB_URL}/logo.png`}
width={150}
alt="logo"
style={{
transform: `rotate(${rotationDeg}deg)`,
cursor: "pointer",
boxShadow: `0 0 ${rotationSpeed * 20}px rgba(255, 0, 0, ${rotationSpeed - 0})`,
borderRadius: "50%",
}}
onClick={() => {
setRotationSpeed(rotationSpeed + 0.1);
}}
onContextMenu={(e) => {
e.preventDefault();
setRotationSpeed(Math.max(rotationSpeed - 0.1, 0));
}}
/>
</div>
</div>
);
};

View File

@@ -1,2 +1,3 @@
export * from "./Badge";
export * from "./PenaltyDropdown";
export * from "./Maintenance";