mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
refactor(containers): migrate resources tab to react [EE-5214] (#10355)
This commit is contained in:
parent
ec091efe3b
commit
ffac83864d
28 changed files with 1114 additions and 537 deletions
|
@ -0,0 +1,31 @@
|
|||
import { useInfo } from '@/react/docker/proxy/queries/useInfo';
|
||||
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
|
||||
|
||||
import { PortainerSelect } from '@@/form-components/PortainerSelect';
|
||||
|
||||
export function RuntimeSelector({
|
||||
value,
|
||||
onChange,
|
||||
}: {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
}) {
|
||||
const environmentId = useEnvironmentId();
|
||||
const infoQuery = useInfo(environmentId, (info) => [
|
||||
{ label: 'Default', value: '' },
|
||||
...Object.keys(info?.Runtimes || {}).map((runtime) => ({
|
||||
label: runtime,
|
||||
value: runtime,
|
||||
})),
|
||||
]);
|
||||
|
||||
return (
|
||||
<PortainerSelect
|
||||
onChange={onChange}
|
||||
value={value}
|
||||
options={infoQuery.data || []}
|
||||
isLoading={infoQuery.isLoading}
|
||||
disabled={infoQuery.isLoading}
|
||||
/>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue