mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-04 19:51:29 +02:00
Properly hide things with disable enterprise flag
This commit is contained in:
@@ -455,7 +455,7 @@ export default function GeneralForm() {
|
|||||||
)}
|
)}
|
||||||
{ !["tcp", "udp"].includes(
|
{ !["tcp", "udp"].includes(
|
||||||
resource.mode
|
resource.mode
|
||||||
) && (
|
) && !env.flags.disableEnterpriseFeatures && (
|
||||||
<>
|
<>
|
||||||
<SettingsFormCell span="full">
|
<SettingsFormCell span="full">
|
||||||
<SettingsSubsectionHeader>
|
<SettingsSubsectionHeader>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
} from "@app/components/ui/form";
|
} from "@app/components/ui/form";
|
||||||
import HeaderTitle from "@app/components/SettingsSectionTitle";
|
import HeaderTitle from "@app/components/SettingsSectionTitle";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { createElement, useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { Input } from "@app/components/ui/input";
|
import { Input } from "@app/components/ui/input";
|
||||||
@@ -37,15 +37,6 @@ import {
|
|||||||
InfoSections,
|
InfoSections,
|
||||||
InfoSectionTitle
|
InfoSectionTitle
|
||||||
} from "@app/components/InfoSection";
|
} from "@app/components/InfoSection";
|
||||||
import {
|
|
||||||
FaApple,
|
|
||||||
FaCubes,
|
|
||||||
FaDocker,
|
|
||||||
FaFreebsd,
|
|
||||||
FaWindows
|
|
||||||
} from "react-icons/fa";
|
|
||||||
import { SiNixos, SiKubernetes } from "react-icons/si";
|
|
||||||
import { Checkbox, CheckboxWithLabel } from "@app/components/ui/checkbox";
|
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert";
|
import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert";
|
||||||
import { generateKeypair } from "../[niceId]/wireguardConfig";
|
import { generateKeypair } from "../[niceId]/wireguardConfig";
|
||||||
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||||
|
|||||||
@@ -156,10 +156,11 @@ export const orgNavSections = (
|
|||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
// PaidFeaturesAlert
|
// PaidFeaturesAlert
|
||||||
...((build === "oss" && !env?.flags.disableEnterpriseFeatures) ||
|
...(!env?.flags.disableEnterpriseFeatures &&
|
||||||
build === "saas" ||
|
(build === "saas" ||
|
||||||
env?.app.identityProviderMode === "org" ||
|
env?.app.identityProviderMode === "org" ||
|
||||||
(env?.app.identityProviderMode === undefined && build !== "oss")
|
(env?.app.identityProviderMode === undefined &&
|
||||||
|
build !== "oss"))
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: "sidebarIdentityProviders",
|
title: "sidebarIdentityProviders",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
} from "react-icons/fa";
|
} from "react-icons/fa";
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
import { SiKubernetes, SiNixos } from "react-icons/si";
|
import { SiKubernetes, SiNixos } from "react-icons/si";
|
||||||
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
|
|
||||||
export type CommandItem = string | { title: string; command: string };
|
export type CommandItem = string | { title: string; command: string };
|
||||||
|
|
||||||
@@ -50,9 +51,12 @@ export function NewtSiteInstallCommands({
|
|||||||
version = "latest"
|
version = "latest"
|
||||||
}: NewtSiteInstallCommandsProps) {
|
}: NewtSiteInstallCommandsProps) {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
const [acceptClients, setAcceptClients] = useState(true);
|
const [acceptClients, setAcceptClients] = useState(true);
|
||||||
const [allowPangolinSsh, setAllowPangolinSsh] = useState(true);
|
const [allowPangolinSsh, setAllowPangolinSsh] = useState(
|
||||||
|
!env.flags.disableEnterpriseFeatures
|
||||||
|
);
|
||||||
const [platform, setPlatform] = useState<Platform>("linux");
|
const [platform, setPlatform] = useState<Platform>("linux");
|
||||||
const [architecture, setArchitecture] = useState(
|
const [architecture, setArchitecture] = useState(
|
||||||
() => getArchitectures(platform)[0]
|
() => getArchitectures(platform)[0]
|
||||||
@@ -306,27 +310,29 @@ WantedBy=default.target`
|
|||||||
>
|
>
|
||||||
{t("siteAcceptClientConnectionsDescription")}
|
{t("siteAcceptClientConnectionsDescription")}
|
||||||
</p>
|
</p>
|
||||||
{supportsSshOption && (
|
{supportsSshOption &&
|
||||||
<>
|
!env.flags.disableEnterpriseFeatures && (
|
||||||
<div className="flex items-center space-x-2 mb-2 mt-2">
|
<>
|
||||||
<CheckboxWithLabel
|
<div className="flex items-center space-x-2 mb-2 mt-2">
|
||||||
id="allowPangolinSsh"
|
<CheckboxWithLabel
|
||||||
checked={allowPangolinSsh}
|
id="allowPangolinSsh"
|
||||||
onCheckedChange={(checked) => {
|
checked={allowPangolinSsh}
|
||||||
const value = checked as boolean;
|
onCheckedChange={(checked) => {
|
||||||
setAllowPangolinSsh(value);
|
const value =
|
||||||
}}
|
checked as boolean;
|
||||||
label="Allow Pangolin SSH"
|
setAllowPangolinSsh(value);
|
||||||
/>
|
}}
|
||||||
</div>
|
label="Allow Pangolin SSH"
|
||||||
<p
|
/>
|
||||||
id="allowPangolinSsh-desc"
|
</div>
|
||||||
className="text-sm text-muted-foreground"
|
<p
|
||||||
>
|
id="allowPangolinSsh-desc"
|
||||||
{t("sitePangolinSshDescription")}
|
className="text-sm text-muted-foreground"
|
||||||
</p>
|
>
|
||||||
</>
|
{t("sitePangolinSshDescription")}
|
||||||
)}
|
</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user