mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 05:49:40 +02:00
refactor(edge/stacks): migrate edit view to react [EE-2222] (#11648)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
This commit is contained in:
parent
27e309754e
commit
cd5f342da0
31 changed files with 847 additions and 499 deletions
|
@ -0,0 +1,58 @@
|
|||
interface Props {
|
||||
versions?: number[];
|
||||
onChange(value: number): void;
|
||||
}
|
||||
|
||||
export function StackVersionSelector({ versions, onChange }: Props) {
|
||||
if (!versions || versions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const showSelector = versions.length > 1;
|
||||
|
||||
const versionOptions = versions.map((version) => ({
|
||||
value: version,
|
||||
label: version.toString(),
|
||||
}));
|
||||
|
||||
return (
|
||||
<div className="flex">
|
||||
{!showSelector && (
|
||||
<>
|
||||
<label className="text-muted mr-2" htmlFor="version_id">
|
||||
<span>Version:</span>
|
||||
</label>
|
||||
<span className="text-muted" id="version_id">
|
||||
{versions[0]}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
|
||||
{showSelector && (
|
||||
<div className="text-muted">
|
||||
<label className="mr-2" htmlFor="version_id">
|
||||
<span>Version:</span>
|
||||
</label>
|
||||
<select
|
||||
className="form-select"
|
||||
data-cy="version-selector"
|
||||
style={{
|
||||
width: '60px',
|
||||
height: '24px',
|
||||
borderRadius: '4px',
|
||||
borderColor: 'hsl(0, 0%, 80%)',
|
||||
padding: '2px 8px',
|
||||
}}
|
||||
onChange={(e) => onChange(parseInt(e.target.value, 10))}
|
||||
>
|
||||
{versionOptions.map((option) => (
|
||||
<option key={option.value} value={option.value}>
|
||||
{option.value}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue