24 lines
455 B
TypeScript
24 lines
455 B
TypeScript
|
export interface MetaTargetStatus {
|
||
|
id?: number;
|
||
|
key?: string;
|
||
|
name?: string;
|
||
|
createDate?: Date;
|
||
|
}
|
||
|
|
||
|
export enum MetaTargetStatusEnum {
|
||
|
UP = 'UP',
|
||
|
DOWN = 'DOWN',
|
||
|
WARN = 'WARN',
|
||
|
ERROR = 'ERROR',
|
||
|
}
|
||
|
|
||
|
export const toMetaTargetStatusEnum = (v: MetaTargetStatus): MetaTargetStatusEnum => {
|
||
|
return MetaTargetStatusEnum[v.key];
|
||
|
};
|
||
|
|
||
|
export const toMetaTargetStatus = (v: MetaTargetStatusEnum): MetaTargetStatus => {
|
||
|
return {
|
||
|
key: v,
|
||
|
};
|
||
|
};
|