mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-06 12:19:50 +00:00
Add watermark on missing login pages
This commit is contained in:
@@ -35,6 +35,7 @@ import {
|
|||||||
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
||||||
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
||||||
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
||||||
|
import AuthPageFooterNotices from "@app/components/AuthPageFooterNotices";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
declare module "react" {
|
declare module "react" {
|
||||||
@@ -443,6 +444,7 @@ export default function RdpClient({
|
|||||||
</Form>
|
</Form>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
<AuthPageFooterNotices />
|
||||||
</BrandedAuthSurface>
|
</BrandedAuthSurface>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import type { SignSshKeyResponse } from "@server/routers/ssh/types";
|
|||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
||||||
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
||||||
|
import AuthPageFooterNotices from "@app/components/AuthPageFooterNotices";
|
||||||
|
|
||||||
type AuthTab = "password" | "privateKey";
|
type AuthTab = "password" | "privateKey";
|
||||||
|
|
||||||
@@ -618,6 +619,7 @@ export default function SshClient({
|
|||||||
</Form>
|
</Form>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
<AuthPageFooterNotices />
|
||||||
</BrandedAuthSurface>
|
</BrandedAuthSurface>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import {
|
|||||||
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
||||||
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
||||||
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
||||||
|
import AuthPageFooterNotices from "@app/components/AuthPageFooterNotices";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
type VncCredentialsForm = {
|
type VncCredentialsForm = {
|
||||||
@@ -242,6 +243,7 @@ export default function VncClient({
|
|||||||
</Form>
|
</Form>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
<AuthPageFooterNotices />
|
||||||
</BrandedAuthSurface>
|
</BrandedAuthSurface>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
40
src/components/AuthPageFooterNotices.tsx
Normal file
40
src/components/AuthPageFooterNotices.tsx
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useSupporterStatusContext } from "@app/hooks/useSupporterStatusContext";
|
||||||
|
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
import { build } from "@server/build";
|
||||||
|
|
||||||
|
export default function AuthPageFooterNotices() {
|
||||||
|
const t = useTranslations();
|
||||||
|
const { supporterStatus } = useSupporterStatusContext();
|
||||||
|
const { isUnlocked, licenseStatus } = useLicenseStatusContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{supporterStatus?.visible && (
|
||||||
|
<div className="text-center mt-2">
|
||||||
|
<span className="text-sm text-muted-foreground opacity-50">
|
||||||
|
{t("noSupportKey")}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{build === "enterprise" && !isUnlocked() ? (
|
||||||
|
<div className="text-center mt-2">
|
||||||
|
<span className="text-sm font-medium text-muted-foreground">
|
||||||
|
{t("instanceIsUnlicensed")}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
{build === "enterprise" &&
|
||||||
|
isUnlocked() &&
|
||||||
|
licenseStatus?.tier === "personal" ? (
|
||||||
|
<div className="text-center mt-2">
|
||||||
|
<span className="text-sm font-medium text-muted-foreground">
|
||||||
|
{t("loginPageLicenseWatermark")}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ import { toast } from "@app/hooks/useToast";
|
|||||||
import BrandingLogo from "@app/components/BrandingLogo";
|
import BrandingLogo from "@app/components/BrandingLogo";
|
||||||
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
import BrandedAuthSurface from "@app/components/BrandedAuthSurface";
|
||||||
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
import PoweredByPangolin from "@app/components/PoweredByPangolin";
|
||||||
import { useSupporterStatusContext } from "@app/hooks/useSupporterStatusContext";
|
import AuthPageFooterNotices from "@app/components/AuthPageFooterNotices";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
||||||
@@ -124,8 +124,6 @@ export default function ResourceAuthPortal(props: ResourceAuthPortalProps) {
|
|||||||
|
|
||||||
const { env } = useEnvContext();
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
const { supporterStatus } = useSupporterStatusContext();
|
|
||||||
|
|
||||||
function getDefaultSelectedMethod() {
|
function getDefaultSelectedMethod() {
|
||||||
if (props.methods.sso) {
|
if (props.methods.sso) {
|
||||||
return "sso";
|
return "sso";
|
||||||
@@ -727,29 +725,7 @@ export default function ResourceAuthPortal(props: ResourceAuthPortalProps) {
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
{supporterStatus?.visible && (
|
<AuthPageFooterNotices />
|
||||||
<div className="text-center mt-2">
|
|
||||||
<span className="text-sm text-muted-foreground opacity-50">
|
|
||||||
{t("noSupportKey")}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{build === "enterprise" && !isUnlocked() ? (
|
|
||||||
<div className="text-center mt-2">
|
|
||||||
<span className="text-sm font-medium text-muted-foreground">
|
|
||||||
{t("instanceIsUnlicensed")}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
{build === "enterprise" &&
|
|
||||||
isUnlocked() &&
|
|
||||||
licenseStatus?.tier === "personal" ? (
|
|
||||||
<div className="text-center mt-2">
|
|
||||||
<span className="text-sm font-medium text-muted-foreground">
|
|
||||||
{t("loginPageLicenseWatermark")}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<ResourceAccessDenied />
|
<ResourceAccessDenied />
|
||||||
|
|||||||
Reference in New Issue
Block a user