diff --git a/Dockerfile b/Dockerfile index 9df70fdad..fe87a02b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM node:20.5-slim WORKDIR /app # Define node.js environment variables +ARG PORT=7575 + ENV NEXT_TELEMETRY_DISABLED 1 ENV NODE_ENV production ENV NODE_OPTIONS '--no-experimental-fetch' @@ -22,11 +24,15 @@ RUN apt-get update -y && apt-get install -y openssl RUN yarn global add prisma # Expose the default application port -EXPOSE 7575 +EXPOSE $PORT +ENV PORT=${PORT} ENV DATABASE_URL "file:../database/db.sqlite" ENV NEXTAUTH_URL "http://localhost:3000" ENV PORT 7575 ENV NEXTAUTH_SECRET NOT_IN_USE_BECAUSE_JWTS_ARE_UNUSED +HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT} || exit 1 + CMD ["sh", "./scripts/run.sh"] diff --git a/public/locales/en/modules/dns-hole-controls.json b/public/locales/en/modules/dns-hole-controls.json index 1215356b0..279931f04 100644 --- a/public/locales/en/modules/dns-hole-controls.json +++ b/public/locales/en/modules/dns-hole-controls.json @@ -1,6 +1,12 @@ { "descriptor": { "name": "DNS hole controls", - "description": "Control PiHole or AdGuard from your dashboard" + "description": "Control PiHole or AdGuard from your dashboard", + "settings": { + "title": "DNS hole controls settings", + "showToggleAllButtons": { + "label": "Show 'Enable/Disable All' Buttons" + } + } } } \ No newline at end of file diff --git a/src/widgets/dnshole/DnsHoleControls.tsx b/src/widgets/dnshole/DnsHoleControls.tsx index fcef79034..664088088 100644 --- a/src/widgets/dnshole/DnsHoleControls.tsx +++ b/src/widgets/dnshole/DnsHoleControls.tsx @@ -25,7 +25,12 @@ import { useDnsHoleSummeryQuery } from './DnsHoleSummary'; const definition = defineWidget({ id: 'dns-hole-controls', icon: IconDeviceGamepad, - options: {}, + options: { + showToggleAllButtons: { + type: 'switch', + defaultValue: true, + }, + }, gridstack: { minWidth: 2, minHeight: 1, @@ -106,7 +111,7 @@ function DnsHoleControlsWidgetTile({ widget }: DnsHoleControlsWidgetProps) { return ( - {sessionData?.user?.isAdmin && ( + {sessionData?.user?.isAdmin && widget.properties.showToggleAllButtons && ( 275 ? 2 : 1} @@ -156,7 +161,14 @@ function DnsHoleControlsWidgetTile({ widget }: DnsHoleControlsWidgetProps) { )} - + {data.status.map((dnsHole, index) => { const app = config?.apps.find((x) => x.id === dnsHole.appId); @@ -165,7 +177,7 @@ function DnsHoleControlsWidgetTile({ widget }: DnsHoleControlsWidgetProps) { } return ( - + ({ @@ -182,15 +194,18 @@ function DnsHoleControlsWidgetTile({ widget }: DnsHoleControlsWidgetProps) { {app.name} { - await mutateAsync({ - action: dnsHole.status === 'enabled' ? 'disable' : 'enable', - configName, - appsToChange: [app.id], - },{ - onSettled: () => { - reFetchSummaryDns(); + await mutateAsync( + { + action: dnsHole.status === 'enabled' ? 'disable' : 'enable', + configName, + appsToChange: [app.id], + }, + { + onSettled: () => { + reFetchSummaryDns(); + }, } - }); + ); }} disabled={fetchingDnsSummary || changingStatus} >