mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-28 06:29:06 +01:00
Fix #3950
This commit is contained in:
@@ -40,6 +40,7 @@ import type { ResourceContextType } from "@app/contexts/resourceContext";
|
|||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
import { toast } from "@app/hooks/useToast";
|
import { toast } from "@app/hooks/useToast";
|
||||||
import { createApiClient } from "@app/lib/api";
|
import { createApiClient } from "@app/lib/api";
|
||||||
|
import { cn } from "@app/lib/cn";
|
||||||
import { formatAxiosError } from "@app/lib/api/formatAxiosError";
|
import { formatAxiosError } from "@app/lib/api/formatAxiosError";
|
||||||
import { DockerManager, DockerState } from "@app/lib/docker";
|
import { DockerManager, DockerState } from "@app/lib/docker";
|
||||||
import { orgQueries, resourceQueries, aiProviderQueries } from "@app/lib/queries";
|
import { orgQueries, resourceQueries, aiProviderQueries } from "@app/lib/queries";
|
||||||
@@ -959,28 +960,32 @@ export const ProxyResourceTargetsForm = forwardRef<
|
|||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
{hasTargets && (
|
{/* The empty state (and its add button) is hidden on mobile, so always show the add button there */}
|
||||||
<div className="flex items-center justify-between mb-4">
|
<div
|
||||||
<div className="flex items-center justify-between w-full gap-2">
|
className={cn(
|
||||||
{addTargetButton}
|
"flex items-center justify-between mb-4",
|
||||||
{!disableAdvancedMode && (
|
!hasTargets && "sm:hidden"
|
||||||
<div className="flex items-center gap-2">
|
)}
|
||||||
<Switch
|
>
|
||||||
id={advancedModeToggleId}
|
<div className="flex items-center justify-between w-full gap-2">
|
||||||
checked={isAdvancedMode}
|
{addTargetButton}
|
||||||
onCheckedChange={setIsAdvancedMode}
|
{hasTargets && !disableAdvancedMode && (
|
||||||
/>
|
<div className="flex items-center gap-2">
|
||||||
<label
|
<Switch
|
||||||
htmlFor={advancedModeToggleId}
|
id={advancedModeToggleId}
|
||||||
className="text-sm"
|
checked={isAdvancedMode}
|
||||||
>
|
onCheckedChange={setIsAdvancedMode}
|
||||||
{t("advancedMode")}
|
/>
|
||||||
</label>
|
<label
|
||||||
</div>
|
htmlFor={advancedModeToggleId}
|
||||||
)}
|
className="text-sm"
|
||||||
</div>
|
>
|
||||||
|
{t("advancedMode")}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
{build === "saas" &&
|
{build === "saas" &&
|
||||||
!isAiProvider &&
|
!isAiProvider &&
|
||||||
targets.length > 1 &&
|
targets.length > 1 &&
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import {
|
|||||||
import { UseFormReturn, useForm, useWatch } from "react-hook-form";
|
import { UseFormReturn, useForm, useWatch } from "react-hook-form";
|
||||||
import { useResourcePolicyContext } from "@app/providers/ResourcePolicyProvider";
|
import { useResourcePolicyContext } from "@app/providers/ResourcePolicyProvider";
|
||||||
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||||
|
import { cn } from "@app/lib/cn";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
import { resourceQueries } from "@app/lib/queries";
|
import { resourceQueries } from "@app/lib/queries";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
@@ -174,7 +175,10 @@ function PolicyAccessRulesSectionLayout({
|
|||||||
resourceOverlayMode={resourceOverlayMode}
|
resourceOverlayMode={resourceOverlayMode}
|
||||||
emptyStateAction={addRuleButton}
|
emptyStateAction={addRuleButton}
|
||||||
/>
|
/>
|
||||||
{hasRules && addRuleButton}
|
{/* The empty state (and its add button) is hidden on mobile, so always show the add button there */}
|
||||||
|
<div className={cn(!hasRules && "sm:hidden")}>
|
||||||
|
{addRuleButton}
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user