Skip to content

Commit 6204415

Browse files
committed
fix: honour metaName for page titles and show a loading state in requests
Two cases where the UI silently did nothing: - DashboardLayout declared a `metaName` prop and 18 settings pages pass it, but the component only destructured `children`, so the value was discarded. None of those pages render their own <Head> either, so every settings page fell back to the default title from _app. The layout now renders a <title>, using the whitelabeling app name so the suffix is correct on rebranded instances. - The requests table's fallback cell only rendered its message when `statsLogs?.data.length === 0`. While the query is in flight statsLogs is undefined, so that guard is false and the cell rendered nothing at all -- a blank panel, indistinguishable from a broken page. The query's isLoading flag wasn't even destructured. It now shows a spinner, matching the queue and deployments tables.
1 parent 1de7b51 commit 6204415

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎apps/dokploy/components/dashboard/requests/requests-table.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
Download,
1818
Globe,
1919
InfoIcon,
20+
Loader2,
2021
Server,
2122
TrendingUpIcon,
2223
} from "lucide-react";
@@ -100,7 +101,7 @@ export const RequestsTable = ({ dateRange }: RequestsTableProps) => {
100101
pageSize: 10,
101102
});
102103

103-
const { data: statsLogs } = api.settings.readStatsLogs.useQuery(
104+
const { data: statsLogs, isLoading } = api.settings.readStatsLogs.useQuery(
104105
{
105106
sort: sorting[0],
106107
page: pagination,
@@ -273,7 +274,12 @@ export const RequestsTable = ({ dateRange }: RequestsTableProps) => {
273274
colSpan={columns.length}
274275
className="h-24 text-center"
275276
>
276-
{statsLogs?.data.length === 0 && (
277+
{isLoading ? (
278+
<div className="w-full flex gap-4 items-center justify-center h-[55vh] text-muted-foreground">
279+
<Loader2 className="size-4 animate-spin" />
280+
<span>Loading requests...</span>
281+
</div>
282+
) : (
277283
<div className="w-full flex-col gap-2 flex items-center justify-center h-[55vh]">
278284
<span className="text-muted-foreground text-lg font-medium">
279285
No results.

‎apps/dokploy/components/layouts/dashboard-layout.tsx‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import Head from "next/head";
12
import { api } from "@/utils/api";
3+
import { useWhitelabeling } from "@/utils/hooks/use-whitelabeling";
24
import { ImpersonationBar } from "../dashboard/impersonation/impersonation-bar";
35
import { HubSpotWidget } from "../shared/HubSpotWidget";
46
import Page from "./side";
@@ -8,9 +10,11 @@ interface Props {
810
metaName?: string;
911
}
1012

11-
export const DashboardLayout = ({ children }: Props) => {
13+
export const DashboardLayout = ({ children, metaName }: Props) => {
1214
const { data: haveRootAccess } = api.user.haveRootAccess.useQuery();
1315
const { data: isCloud } = api.settings.isCloud.useQuery();
16+
const { config: whitelabeling } = useWhitelabeling();
17+
const appName = whitelabeling?.appName || "Dokploy";
1418
const { data: currentPlan } = api.stripe.getCurrentPlan.useQuery(undefined, {
1519
enabled: isCloud === true,
1620
refetchOnWindowFocus: false,
@@ -22,6 +26,13 @@ export const DashboardLayout = ({ children }: Props) => {
2226

2327
return (
2428
<>
29+
{metaName && (
30+
<Head>
31+
<title>
32+
{metaName} | {appName}
33+
</title>
34+
</Head>
35+
)}
2536
<Page>{children}</Page>
2637
{isChatEnabled && (
2738
<>

0 commit comments

Comments
 (0)