1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00
portainer/app/react/docker/containers/CreateView/VolumesTab/toViewModel.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
490 B
TypeScript
Raw Normal View History

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 [];
}