diff --git a/client/ui/frontend/src/modules/main/advanced/Navigation.tsx b/client/ui/frontend/src/modules/main/advanced/Navigation.tsx
index d839f04d4..9e434f88a 100644
--- a/client/ui/frontend/src/modules/main/advanced/Navigation.tsx
+++ b/client/ui/frontend/src/modules/main/advanced/Navigation.tsx
@@ -4,6 +4,8 @@ import { Layers3Icon, LucideProps, MonitorSmartphoneIcon } from "lucide-react";
import { cn } from "@/lib/cn";
import { useNavSection, type NavSection } from "@/contexts/NavSectionContext";
import { useStatus } from "@/contexts/StatusContext";
+import { useRestrictions } from "@/contexts/RestrictionsContext";
+import { useEffect } from "react";
type TabEntry = {
value: NavSection;
@@ -15,20 +17,30 @@ export const Navigation = () => {
const { t } = useTranslation();
const { section, setSection } = useNavSection();
const { status } = useStatus();
+ const { features } = useRestrictions();
const isConnected = status?.status === "Connected";
+ // Reset back to peers tab if mdm or feature flag flipped it
+ useEffect(() => {
+ if (features.disableNetworks && section === "networks") {
+ setSection("peers");
+ }
+ }, [features.disableNetworks, section, setSection]);
+
const tabs: TabEntry[] = [
{
value: "peers",
label: t("nav.peers.title"),
icon: MonitorSmartphoneIcon,
},
- {
+ ];
+ if (!features.disableNetworks) {
+ tabs.push({
value: "networks",
label: t("nav.resources.title"),
icon: Layers3Icon,
- },
- ];
+ });
+ }
return (
diff --git a/client/ui/frontend/src/modules/profiles/ProfileCreationModal.tsx b/client/ui/frontend/src/modules/profiles/ProfileCreationModal.tsx
index dfcf2712b..20a62346b 100644
--- a/client/ui/frontend/src/modules/profiles/ProfileCreationModal.tsx
+++ b/client/ui/frontend/src/modules/profiles/ProfileCreationModal.tsx
@@ -14,6 +14,7 @@ import {
isValidManagementUrl,
normalizeManagementUrl,
} from "@/hooks/useManagementUrl";
+import { useRestrictions } from "@/contexts/RestrictionsContext.tsx";
type Props = {
open: boolean;
@@ -31,6 +32,8 @@ const sanitizeProfileInput = (value: string): string =>
export const ProfileCreationModal = ({ open, onOpenChange, onCreate }: Props) => {
const { t } = useTranslation();
+ const { mdm } = useRestrictions();
+ const managedManagementUrl = mdm.managementURL;
const [name, setName] = useState("");
const [nameError, setNameError] = useState(null);
const nameRef = useRef(null);
@@ -70,6 +73,12 @@ export const ProfileCreationModal = ({ open, onOpenChange, onCreate }: Props) =>
return;
}
+ if (managedManagementUrl) {
+ onCreate(sanitized, managedManagementUrl);
+ onOpenChange(false);
+ return;
+ }
+
if (mode === ManagementMode.Cloud) {
onCreate(sanitized, CLOUD_MANAGEMENT_URL);
onOpenChange(false);
@@ -145,35 +154,41 @@ export const ProfileCreationModal = ({ open, onOpenChange, onCreate }: Props) =>
/>
-
-
-
-
- {t("profile.dialog.managementHelp")}
-
-
-
-
- {mode === ManagementMode.SelfHosted && (
-
setUrl(e.target.value)}
- error={urlInputError}
- warning={urlInputWarning}
- spellCheck={false}
- autoComplete="off"
- autoCapitalize="off"
+ {!managedManagementUrl && (
+
+
+
+
+ {t("profile.dialog.managementHelp")}
+
+
+
+
- )}
+ {mode === ManagementMode.SelfHosted && (
+ setUrl(e.target.value)}
+ error={urlInputError}
+ warning={urlInputWarning}
+ spellCheck={false}
+ autoComplete="off"
+ autoCapitalize="off"
+ />
+ )}
+
-
+ )}