fix: fix the backup size quota check when create backup
Disable to click submit button when the remaining backup size is zero Change-Id: I9c5b6995100262edd9be4f941dd6d905fccb4e30
This commit is contained in:
parent
28846810e2
commit
4ccb380ff4
@ -169,8 +169,10 @@ export const getAdd = (cinderQuota) => {
|
|||||||
const { left = 0 } = backups || {};
|
const { left = 0 } = backups || {};
|
||||||
const { left: sizeLeft = 0, limit } = gigabytes || {};
|
const { left: sizeLeft = 0, limit } = gigabytes || {};
|
||||||
const { currentVolumeSize = 0 } = globalBackupStore;
|
const { currentVolumeSize = 0 } = globalBackupStore;
|
||||||
const add =
|
const leftOk = left !== 0;
|
||||||
left !== 0 && (limit === -1 || sizeLeft >= currentVolumeSize) ? 1 : 0;
|
const sizeOk =
|
||||||
|
sizeLeft !== 0 && (limit === -1 || sizeLeft >= currentVolumeSize);
|
||||||
|
const add = leftOk && sizeOk ? 1 : 0;
|
||||||
return {
|
return {
|
||||||
add,
|
add,
|
||||||
addSize: add === 1 ? currentVolumeSize : 0,
|
addSize: add === 1 ? currentVolumeSize : 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user