mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
fix(container): fix various creating container issues EE-6287 (#10595)
* fix(container): show placeholder for image field EE-6287 * fix(container): correct query params for search button field EE-6287 * fix(container): use btoa to encode registry credential EE-6287 * fix(container): allow creating non-existing option EE-6287 * fix(ui/forms): typeahead component * fix(container): select the default registry EE-6287 * fix(container): always enable deploy button when always pull is off EE-6287 * fix(container): reset command fields outside current event to avoid validation on broken values EE-6287 * fix(container): query registry with endpoint ID param EE-6287 --------- Co-authored-by: Chaim Lev-Ari <chaim.levi-ari@portainer.io>
This commit is contained in:
parent
e43d076269
commit
d089dfbca0
17 changed files with 190 additions and 137 deletions
|
@ -1,6 +1,7 @@
|
|||
import { FormikErrors } from 'formik';
|
||||
import _ from 'lodash';
|
||||
import { useMemo } from 'react';
|
||||
import { trimSHA, trimVersionTag } from 'Docker/filters/utils';
|
||||
|
||||
import DockerIcon from '@/assets/ico/vendor/docker.svg?c';
|
||||
import { useImages } from '@/react/docker/proxy/queries/images/useImages';
|
||||
|
@ -83,7 +84,9 @@ export function SimpleForm({
|
|||
title="Search image on Docker Hub"
|
||||
color="default"
|
||||
props={{
|
||||
href: 'https://hub.docker.com/search?type=image&q={ $ctrl.model.Image | trimshasum | trimversiontag }',
|
||||
href: `https://hub.docker.com/search?type=image&q=${trimVersionTag(
|
||||
trimSHA(values.image)
|
||||
)}`,
|
||||
target: '_blank',
|
||||
rel: 'noreferrer',
|
||||
}}
|
||||
|
@ -140,6 +143,14 @@ function RegistrySelector({
|
|||
label: registry.Name,
|
||||
value: registry.Id,
|
||||
})),
|
||||
onSuccess: (options) => {
|
||||
if (options && options.length) {
|
||||
const idx = options.findIndex((v) => v.value === value);
|
||||
if (idx === -1) {
|
||||
onChange(options[0].value);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
|
@ -164,7 +175,7 @@ function ImageField({
|
|||
onChange: (value: string) => void;
|
||||
registry?: Registry;
|
||||
autoComplete?: boolean;
|
||||
inputId?: string;
|
||||
inputId: string;
|
||||
}) {
|
||||
return autoComplete ? (
|
||||
<ImageFieldAutoComplete
|
||||
|
@ -191,7 +202,7 @@ function ImageFieldAutoComplete({
|
|||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
registry?: Registry;
|
||||
inputId?: string;
|
||||
inputId: string;
|
||||
}) {
|
||||
const environmentId = useEnvironmentId();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue