mirror of https://github.com/portainer/portainer
fix(edge/stacks): fix ui issues [EE-5578] (#9070)
parent
3d22cde096
commit
2cd5d55b00
|
@ -183,23 +183,31 @@ function InnerForm({
|
|||
/>
|
||||
{values.deploymentType === DeploymentType.Compose && (
|
||||
<>
|
||||
<SwitchField
|
||||
checked={values.prePullImage}
|
||||
name="prePullImage"
|
||||
label="Pre-pull images"
|
||||
tooltip="When enabled, redeployment will be executed when image(s) is pulled successfully"
|
||||
label-Class="col-sm-3 col-lg-2"
|
||||
onChange={(value) => setFieldValue('prePullImage', value)}
|
||||
/>
|
||||
<div className="form-group">
|
||||
<div className="col-sm-12">
|
||||
<SwitchField
|
||||
checked={values.prePullImage}
|
||||
name="prePullImage"
|
||||
label="Pre-pull images"
|
||||
tooltip="When enabled, redeployment will be executed when image(s) is pulled successfully"
|
||||
labelClass="col-sm-3 col-lg-2"
|
||||
onChange={(value) => setFieldValue('prePullImage', value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SwitchField
|
||||
checked={values.retryDeploy}
|
||||
name="retryDeploy"
|
||||
label="Retry deployment"
|
||||
tooltip="When enabled, this will allow edge agent keep retrying deployment if failure occur"
|
||||
label-Class="col-sm-3 col-lg-2"
|
||||
onChange={(value) => setFieldValue('retryDeploy', value)}
|
||||
/>
|
||||
<div className="form-group">
|
||||
<div className="col-sm-12">
|
||||
<SwitchField
|
||||
checked={values.retryDeploy}
|
||||
name="retryDeploy"
|
||||
label="Retry deployment"
|
||||
tooltip="When enabled, this will allow edge agent keep retrying deployment if failure occur"
|
||||
labelClass="col-sm-3 col-lg-2"
|
||||
onChange={(value) => setFieldValue('retryDeploy', value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { RefreshCw } from 'lucide-react';
|
||||
|
||||
import { Registry } from '@/react/portainer/registries/types';
|
||||
|
||||
|
@ -75,26 +76,34 @@ export function PrivateRegistryFieldset({
|
|||
{checked && (
|
||||
<>
|
||||
{method !== 'repository' && (
|
||||
<>
|
||||
<TextTip color="blue">
|
||||
If you make any changes to the image urls in your yaml, please
|
||||
reload or select registry manually
|
||||
</TextTip>
|
||||
|
||||
<Button onClick={reload}>Reload</Button>
|
||||
</>
|
||||
<TextTip color="blue">
|
||||
If you make any changes to the image urls in your yaml, please
|
||||
reload or select registry manually
|
||||
</TextTip>
|
||||
)}
|
||||
|
||||
{!errorMessage ? (
|
||||
<FormControl label="Registry" inputId="users-selector">
|
||||
<Select
|
||||
value={registries.filter(
|
||||
(registry) => registry.Id === selected
|
||||
<div className="flex">
|
||||
<Select
|
||||
value={registries.filter(
|
||||
(registry) => registry.Id === selected
|
||||
)}
|
||||
options={registries}
|
||||
getOptionLabel={(registry) => registry.Name}
|
||||
getOptionValue={(registry) => registry.Id.toString()}
|
||||
onChange={(value) => onSelect(value?.Id)}
|
||||
className="w-full"
|
||||
/>
|
||||
{method !== 'repository' && (
|
||||
<Button
|
||||
onClick={reload}
|
||||
title="Reload"
|
||||
icon={RefreshCw}
|
||||
color="light"
|
||||
/>
|
||||
)}
|
||||
options={registries}
|
||||
getOptionLabel={(registry) => registry.Name}
|
||||
getOptionValue={(registry) => registry.Id.toString()}
|
||||
onChange={(value) => onSelect(value?.Id)}
|
||||
/>
|
||||
</div>
|
||||
</FormControl>
|
||||
) : (
|
||||
<FormError>{errorMessage}</FormError>
|
||||
|
|
|
@ -31,9 +31,13 @@ export async function createStackFromFileContent({
|
|||
...payload
|
||||
}: FileContentPayload) {
|
||||
try {
|
||||
const { data } = await axios.post<EdgeStack>(buildUrl(), payload, {
|
||||
params: { method: 'string', dryrun: dryRun ? 'true' : 'false' },
|
||||
});
|
||||
const { data } = await axios.post<EdgeStack>(
|
||||
buildUrl(undefined, 'create/string'),
|
||||
payload,
|
||||
{
|
||||
params: { dryrun: dryRun ? 'true' : 'false' },
|
||||
}
|
||||
);
|
||||
return data;
|
||||
} catch (e) {
|
||||
throw parseAxiosError(e as Error);
|
||||
|
|
Loading…
Reference in New Issue