mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 22:09:41 +02:00
feat(environments): create async edge [EE-4480] (#8527)
This commit is contained in:
parent
bc6a667a6b
commit
c819d4e7f7
59 changed files with 880 additions and 586 deletions
|
@ -1,4 +1,5 @@
|
|||
import { Formik } from 'formik';
|
||||
import { PropsWithChildren } from 'react';
|
||||
|
||||
import { OsSelector } from './OsSelector';
|
||||
import { CommandTab } from './scripts';
|
||||
|
@ -21,15 +22,16 @@ interface Props {
|
|||
edgeInfo: EdgeInfo;
|
||||
commands: CommandTab[] | Partial<Record<OS, CommandTab[]>>;
|
||||
isNomadTokenVisible?: boolean;
|
||||
hideAsyncMode?: boolean;
|
||||
asyncMode?: boolean;
|
||||
}
|
||||
|
||||
export function EdgeScriptForm({
|
||||
edgeInfo,
|
||||
commands,
|
||||
isNomadTokenVisible,
|
||||
hideAsyncMode,
|
||||
}: Props) {
|
||||
asyncMode,
|
||||
children,
|
||||
}: PropsWithChildren<Props>) {
|
||||
const showOsSelector = !(commands instanceof Array);
|
||||
|
||||
return (
|
||||
|
@ -41,6 +43,8 @@ export function EdgeScriptForm({
|
|||
>
|
||||
{({ values, setFieldValue }) => (
|
||||
<>
|
||||
{children}
|
||||
|
||||
<EdgeScriptSettingsFieldset
|
||||
isNomadTokenVisible={
|
||||
isNomadTokenVisible && values.platform === 'nomad'
|
||||
|
@ -63,7 +67,7 @@ export function EdgeScriptForm({
|
|||
onPlatformChange={(platform) =>
|
||||
setFieldValue('platform', platform)
|
||||
}
|
||||
hideAsyncMode={hideAsyncMode}
|
||||
asyncMode={asyncMode}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue