You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/docker/containers/CreateView/VolumesTab/toViewModel.ts

17 lines
490 B

import { ContainerDetailsJSON } from '../../queries/useContainer';
import { VolumeType, Values } from './types';
export function toViewModel(config: ContainerDetailsJSON): Values {
return Object.values(config.Mounts || {}).map((mount) => ({
type: (mount.Type || 'volume') as VolumeType,
name: mount.Name || mount.Source || '',
containerPath: mount.Destination || '',
readOnly: mount.RW === false,
}));
}
export function getDefaultViewModel(): Values {
return [];
}