mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-11 06:25:17 +00:00
feat(requests): conditionally render traefik reload warning
This commit is contained in:
@@ -59,6 +59,25 @@ export const ShowRequests = () => {
|
|||||||
to: undefined,
|
to: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Check if logs exist to determine if traefik has been reloaded
|
||||||
|
// Only fetch when active to minimize network calls
|
||||||
|
const { data: statsLogsCheck } = api.settings.readStatsLogs.useQuery(
|
||||||
|
{
|
||||||
|
page: {
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
enabled: !!isActive,
|
||||||
|
refetchInterval: 5000, // Check every 5 seconds when active
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// Determine if warning should be shown
|
||||||
|
// Show warning only if active but no logs exist yet
|
||||||
|
const shouldShowWarning = isActive && (statsLogsCheck?.totalCount ?? 0) === 0;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (logCleanupStatus) {
|
if (logCleanupStatus) {
|
||||||
setCronExpression(logCleanupStatus.cronExpression || "0 0 * * *");
|
setCronExpression(logCleanupStatus.cronExpression || "0 0 * * *");
|
||||||
@@ -79,16 +98,18 @@ export const ShowRequests = () => {
|
|||||||
See all the incoming requests that pass trough Traefik
|
See all the incoming requests that pass trough Traefik
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
|
|
||||||
<AlertBlock type="warning">
|
{shouldShowWarning && (
|
||||||
When you activate, you need to reload traefik to apply the
|
<AlertBlock type="warning">
|
||||||
changes, you can reload traefik in{" "}
|
When you activate, you need to reload traefik to apply the
|
||||||
<Link
|
changes, you can reload traefik in{" "}
|
||||||
href="/dashboard/settings/server"
|
<Link
|
||||||
className="text-primary"
|
href="/dashboard/settings/server"
|
||||||
>
|
className="text-primary"
|
||||||
Settings
|
>
|
||||||
</Link>
|
Settings
|
||||||
</AlertBlock>
|
</Link>
|
||||||
|
</AlertBlock>
|
||||||
|
)}
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-2 py-8 border-t">
|
<CardContent className="space-y-2 py-8 border-t">
|
||||||
<div className="flex w-full gap-4 justify-end items-center">
|
<div className="flex w-full gap-4 justify-end items-center">
|
||||||
|
|||||||
Reference in New Issue
Block a user