mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
refactor(containers): migrate create view to react [EE-2307] (#9175)
This commit is contained in:
parent
bc0050a7b4
commit
d970f0e2bc
71 changed files with 2612 additions and 1399 deletions
|
@ -1,12 +1,10 @@
|
|||
import { useState } from 'react';
|
||||
|
||||
import { EnvironmentVariablesPanel } from '@@/form-components/EnvironmentVariablesFieldset';
|
||||
import { ArrayError } from '@@/form-components/InputList/InputList';
|
||||
|
||||
import { Values } from './types';
|
||||
|
||||
export function EnvVarsTab({
|
||||
values: initialValues,
|
||||
values,
|
||||
onChange,
|
||||
errors,
|
||||
}: {
|
||||
|
@ -14,19 +12,18 @@ export function EnvVarsTab({
|
|||
onChange(value: Values): void;
|
||||
errors?: ArrayError<Values>;
|
||||
}) {
|
||||
const [values, setControlledValues] = useState(initialValues);
|
||||
|
||||
return (
|
||||
<EnvironmentVariablesPanel
|
||||
values={values}
|
||||
explanation="These values will be applied to the container when deployed"
|
||||
onChange={handleChange}
|
||||
errors={errors}
|
||||
/>
|
||||
<div className="form-group">
|
||||
<EnvironmentVariablesPanel
|
||||
values={values}
|
||||
explanation="These values will be applied to the container when deployed"
|
||||
onChange={handleChange}
|
||||
errors={errors}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
function handleChange(values: Values) {
|
||||
setControlledValues(values);
|
||||
onChange(values);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue