|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
import { MultiValue } from 'react-select';
|
|
|
|
|
|
|
|
|
|
import { Registry } from '@/react/portainer/registries/types';
|
|
|
|
|
import { useCurrentUser } from '@/react/hooks/useUser';
|
|
|
|
|
|
|
|
|
|
import { Select } from '@@/form-components/ReactSelect';
|
|
|
|
|
import { Link } from '@@/Link';
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
value: MultiValue<Registry>;
|
|
|
|
@ -17,7 +19,28 @@ export function RegistriesSelector({
|
|
|
|
|
options,
|
|
|
|
|
inputId,
|
|
|
|
|
}: Props) {
|
|
|
|
|
const { isAdmin } = useCurrentUser();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{options.length === 0 && (
|
|
|
|
|
<p className="text-muted text-xs mb-1 mt-2">
|
|
|
|
|
{isAdmin ? (
|
|
|
|
|
<span>
|
|
|
|
|
No registries available. Head over to the{' '}
|
|
|
|
|
<Link to="portainer.registries" target="_blank">
|
|
|
|
|
registry view
|
|
|
|
|
</Link>{' '}
|
|
|
|
|
to define a container registry.
|
|
|
|
|
</span>
|
|
|
|
|
) : (
|
|
|
|
|
<span>
|
|
|
|
|
No registries available. Contact your administrator to create a
|
|
|
|
|
container registry.
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
<Select
|
|
|
|
|
isMulti
|
|
|
|
|
getOptionLabel={(option) => option.Name}
|
|
|
|
@ -30,5 +53,6 @@ export function RegistriesSelector({
|
|
|
|
|
data-cy="namespaceCreate-registrySelect"
|
|
|
|
|
placeholder="Select one or more registries"
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|