1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00
portainer/app/react/docker/containers/CreateView/LabelsTab/toViewModel.ts

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

19 lines
417 B
TypeScript
Raw Permalink Normal View History

import { ContainerDetailsJSON } from '../../queries/useContainer';
import { Values } from './types';
export function toViewModel(config: ContainerDetailsJSON): Values {
if (!config || !config.Config || !config.Config.Labels) {
return [];
}
return Object.entries(config.Config.Labels).map(([name, value]) => ({
name,
value,
}));
}
export function getDefaultViewModel(): Values {
return [];
}