From bd8d680c1b6886f053f511793502c946f2c899e5 Mon Sep 17 00:00:00 2001 From: Roman Khachatryan Date: Fri, 22 Jan 2021 14:39:48 +0100 Subject: [PATCH] [hotfix][web] Show `-` in humanizeBytes for negative values --- .../web-dashboard/src/app/share/pipes/humanize-bytes.pipe.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flink-runtime-web/web-dashboard/src/app/share/pipes/humanize-bytes.pipe.ts b/flink-runtime-web/web-dashboard/src/app/share/pipes/humanize-bytes.pipe.ts index ac2b12a6d3e0d..5b9fc16f73332 100644 --- a/flink-runtime-web/web-dashboard/src/app/share/pipes/humanize-bytes.pipe.ts +++ b/flink-runtime-web/web-dashboard/src/app/share/pipes/humanize-bytes.pipe.ts @@ -24,9 +24,9 @@ import { isNil } from 'utils'; }) export class HumanizeBytesPipe implements PipeTransform { transform(value: number): any { - if (isNil(value)) { + if (isNil(value) || value < 0) { return '-'; - } + } const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']; const converter = (v: number, p: number): string => { const base = Math.pow(1024, p);