import { RefreshCw } from 'lucide-react'; import { Registry } from '@/react/portainer/registries/types/registry'; import { Select } from '@@/form-components/ReactSelect'; import { FormControl } from '@@/form-components/FormControl'; import { Button } from '@@/buttons'; import { FormError } from '@@/form-components/FormError'; import { SwitchField } from '@@/form-components/SwitchField'; import { TextTip } from '@@/Tip/TextTip'; import { FormSection } from '@@/form-components/FormSection'; interface Props { value?: number; registries: Registry[]; onReload?: () => void; formInvalid?: boolean; errorMessage?: string; onChange: (value?: number) => void; method?: 'repository' | string; } export const REGISTRY_CREDENTIALS_ENABLED = -1; export function PrivateRegistryFieldset({ value, registries, onReload, formInvalid, errorMessage, onChange, method, }: Props) { const tooltipMessage = 'This allows you to provide credentials when using a private registry that requires authentication'; const isActive = !!value; return (
{isActive && ( <> {method !== 'repository' && ( If you make any changes to the image urls in your yaml, please reload or select registry manually )} {!errorMessage ? (