Extract variables to utils/unit

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee
2025-03-03 16:57:25 +08:00
parent 8f76d5ad30
commit 8db4de1c4a
18 changed files with 57 additions and 34 deletions
@@ -25,6 +25,7 @@ import { isEmpty } from '@shell/utils/object';
import { HCI } from '../types';
import HarvesterUpgrade from '../components/HarvesterUpgrade';
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../config/harvester';
import { UNIT_SUFFIX } from '../utils/unit';
dayjs.extend(utc);
dayjs.extend(minMax);
@@ -32,13 +33,13 @@ dayjs.extend(minMax);
const PARSE_RULES = {
format: {
addSuffix: true,
firstSuffix: 'B',
firstSuffix: UNIT_SUFFIX,
increment: 1024,
maxExponent: 99,
maxPrecision: 2,
minExponent: 0,
startingExponent: 0,
suffix: 'i',
suffix: UNIT_SUFFIX,
}
};