2024-06-10 18:54:31 +00:00
|
|
|
import { ContainerDetailsJSON } from '../../queries/useContainer';
|
2023-09-26 10:54:45 +00:00
|
|
|
|
|
|
|
import { Values } from './types';
|
|
|
|
|
2024-06-10 18:54:31 +00:00
|
|
|
export function toViewModel(config: ContainerDetailsJSON): Values {
|
2023-09-26 10:54:45 +00:00
|
|
|
if (!config || !config.Config || !config.Config.Labels) {
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
return Object.entries(config.Config.Labels).map(([name, value]) => ({
|
|
|
|
name,
|
|
|
|
value,
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getDefaultViewModel(): Values {
|
|
|
|
return [];
|
|
|
|
}
|