mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-31 03:51:29 +02:00
fix mdm allowserverssh
This commit is contained in:
@@ -19,6 +19,7 @@ export const SettingsNavigation = () => {
|
||||
const { t } = useTranslation();
|
||||
const { updateAvailable } = useClientVersion();
|
||||
const { mdm, features } = useRestrictions();
|
||||
const showSsh = mdm.allowServerSSH || !features.disableUpdateSettings;
|
||||
|
||||
const aboutAdornment = updateAvailable ? (
|
||||
<Tooltip content={t("settings.tabs.updateAvailable")} side={"right"}>
|
||||
@@ -55,21 +56,19 @@ export const SettingsNavigation = () => {
|
||||
title={t("settings.tabs.profiles")}
|
||||
/>
|
||||
)}
|
||||
{showSsh && (
|
||||
<VerticalTabs.Trigger
|
||||
value={"ssh"}
|
||||
icon={SquareTerminalIcon}
|
||||
title={t("settings.tabs.ssh")}
|
||||
/>
|
||||
)}
|
||||
{!features.disableUpdateSettings && (
|
||||
<>
|
||||
{!mdm.allowServerSSH && (
|
||||
<VerticalTabs.Trigger
|
||||
value={"ssh"}
|
||||
icon={SquareTerminalIcon}
|
||||
title={t("settings.tabs.ssh")}
|
||||
/>
|
||||
)}
|
||||
<VerticalTabs.Trigger
|
||||
value={"advanced"}
|
||||
icon={BoltIcon}
|
||||
title={t("settings.tabs.advanced")}
|
||||
/>
|
||||
</>
|
||||
<VerticalTabs.Trigger
|
||||
value={"advanced"}
|
||||
icon={BoltIcon}
|
||||
title={t("settings.tabs.advanced")}
|
||||
/>
|
||||
)}
|
||||
<VerticalTabs.Trigger
|
||||
value={"troubleshooting"}
|
||||
|
||||
@@ -54,7 +54,7 @@ export const SettingsPage = () => {
|
||||
[Tab.Network]: editable,
|
||||
[Tab.Security]: editable,
|
||||
[Tab.Profiles]: !features.disableProfiles,
|
||||
[Tab.SSH]: editable && !mdm.allowServerSSH,
|
||||
[Tab.SSH]: mdm.allowServerSSH || editable,
|
||||
[Tab.Advanced]: editable,
|
||||
[Tab.Troubleshooting]: true,
|
||||
[Tab.About]: true,
|
||||
|
||||
@@ -235,6 +235,10 @@ func (s *Settings) GetRestrictions(ctx context.Context) (Restrictions, error) {
|
||||
if v.Field(i).Kind() != reflect.Bool {
|
||||
continue
|
||||
}
|
||||
// AllowServerSSH carries the resolved value (like ManagementURL), not the is-managed flag.
|
||||
if t.Field(i).Name == "AllowServerSSH" {
|
||||
continue
|
||||
}
|
||||
if _, ok := set[t.Field(i).Tag.Get("json")]; ok {
|
||||
v.Field(i).SetBool(true)
|
||||
}
|
||||
@@ -242,6 +246,9 @@ func (s *Settings) GetRestrictions(ctx context.Context) (Restrictions, error) {
|
||||
if _, ok := set["managementURL"]; ok {
|
||||
r.MDM.ManagementURL = cfgResp.GetManagementUrl()
|
||||
}
|
||||
if _, ok := set["allowServerSSH"]; ok {
|
||||
r.MDM.AllowServerSSH = cfgResp.GetServerSSHAllowed()
|
||||
}
|
||||
}
|
||||
r.MDM.DisableAdvancedView = featResp.GetDisableAdvancedView()
|
||||
return r, nil
|
||||
|
||||
Reference in New Issue
Block a user