mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 21:26:08 +08:00
Extract variables to utils/unit
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { GIBIBYTE } from '../utils/unit';
|
||||
|
||||
export function volumeSize(size, getters, errors, validatorArgs, displayKey, value) {
|
||||
if (!size) {
|
||||
const key = getters['i18n/t']('harvester.volume.size');
|
||||
@@ -6,7 +8,7 @@ export function volumeSize(size, getters, errors, validatorArgs, displayKey, val
|
||||
}
|
||||
|
||||
if (size && !/^([0-9][0-9]{0,8})[a-zA-Z]+$/.test(size)) {
|
||||
const message = getters['i18n/t']('harvester.validation.generic.maximumSize', { max: '999999999 Gi' });
|
||||
const message = getters['i18n/t']('harvester.validation.generic.maximumSize', { max: `999999999 ${ GIBIBYTE }` });
|
||||
|
||||
errors.push(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user