fix(containers/labels): apply labels tab change fix(container/labels): fix validation fix(containers/labels): error type refactor(containers): tabs view models fix(docker/containers): control values fix(containers): fix style issues
19 lines
400 B
TypeScript
19 lines
400 B
TypeScript
import { ContainerJSON } from '../../queries/container';
|
|
|
|
import { Values } from './types';
|
|
|
|
export function toViewModel(config: ContainerJSON): 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 [];
|
|
}
|