Merge branch 'dev-ms' of github.com:fosrl/pangolin into dev-ms

This commit is contained in:
Owen
2025-11-13 21:44:23 -05:00
2 changed files with 37 additions and 28 deletions

View File

@@ -2142,5 +2142,9 @@
"maintenanceTime": "e.g., 2 hours, Nov 1 at 5:00 PM", "maintenanceTime": "e.g., 2 hours, Nov 1 at 5:00 PM",
"maintenanceEstimatedTimeDescription": "When you expect maintenance to be completed", "maintenanceEstimatedTimeDescription": "When you expect maintenance to be completed",
"editDomain": "Edit Domain", "editDomain": "Edit Domain",
"editDomainDescription": "Select a domain for your resource" "editDomainDescription": "Select a domain for your resource",
"maintenanceModeDisabledTooltip": "This feature requires a valid license to enable.",
"maintenanceScreenTitle": "Service Temporarily Unavailable",
"maintenanceScreenMessage": "We are currently experiencing technical difficulties. Please check back soon.",
"maintenanceScreenEstimatedCompletion": "Estimated Completion:"
} }

View File

@@ -1,15 +1,23 @@
import { headers } from "next/headers"; import { headers } from "next/headers";
import { priv } from "@app/lib/api"; import { priv } from "@app/lib/api";
import { GetMaintenanceInfoResponse } from "@server/routers/resource/types"; import { GetMaintenanceInfoResponse } from "@server/routers/resource/types";
import { getTranslations } from "next-intl/server";
import {
Card,
CardContent,
CardHeader,
CardTitle
} from "@app/components/ui/card";
import { Alert, AlertTitle, AlertDescription } from "@app/components/ui/alert";
import { Clock } from "lucide-react";
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";
export const revalidate = 0;
export default async function MaintenanceScreen() { export default async function MaintenanceScreen() {
let title = "Service Temporarily Unavailable"; const t = await getTranslations();
let message =
"We are currently experiencing technical difficulties. Please check back soon."; let title = t("maintenanceScreenTitle");
let message = t("maintenanceScreenMessage");
let estimatedTime: string | null = null; let estimatedTime: string | null = null;
try { try {
@@ -28,36 +36,33 @@ export default async function MaintenanceScreen() {
estimatedTime = maintenanceInfo?.maintenanceEstimatedTime || null; estimatedTime = maintenanceInfo?.maintenanceEstimatedTime || null;
} }
} catch (err) { } catch (err) {
console.warn( console.error(
"Failed to fetch maintenance info", "Failed to fetch maintenance info",
err instanceof Error ? err.message : String(err) err instanceof Error ? err.message : String(err)
); );
} }
return ( return (
<div className="min-h-screen flex items-center justify-center bg-gray-100"> <div className="min-h-screen flex items-center justify-center p-4">
<div className="max-w-2xl w-full bg-white/10 backdrop-blur-lg rounded-3xl p-8 shadow-2xl border border-white/20"> <Card className="w-full max-w-md">
<div className="text-center"> <CardHeader>
<div className="text-6xl mb-6 animate-pulse">🔧</div> <CardTitle>{title}</CardTitle>
</CardHeader>
<h1 className="text-4xl font-bold text-black mb-4"> <CardContent className="space-y-4">
{title} <p>{message}</p>
</h1>
<p className="text-xl text-black/90 mb-6">{message}</p>
{estimatedTime && ( {estimatedTime && (
<div className="mt-8 p-4 bg-white/15 rounded-xl"> <Alert className="w-full" variant="neutral">
<p className="text-black font-semibold"> <Clock className="h-5 w-5" />
Estimated completion: <AlertTitle>
</p> {t("maintenanceScreenEstimatedCompletion")}
<p className="text-black/90 mt-2"> </AlertTitle>
<AlertDescription className="flex flex-col space-y-2">
{estimatedTime} {estimatedTime}
</p> </AlertDescription>
</div> </Alert>
)} )}
</div> </CardContent>
</div> </Card>
</div> </div>
); );
} }