-
Notifications
You must be signed in to change notification settings - Fork 624
HDDS-11023. Recon Disk Usage null conditions not handled properly for null response #6894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a52b62c
8b26870
4b9b4b9
c93eb78
23ede04
f05387d
2b1a5ee
9f676e3
b62fbdb
a4d50e2
f19dcc0
910c42f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -295,165 +295,167 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState> | |||||
| keys.push('Entity Type'); | ||||||
| values.push(summaryResponse.type); | ||||||
|
|
||||||
| if (summaryResponse.countStats.type === 'KEY') { | ||||||
| const keyEndpoint = `/api/v1/namespace/du?path=${path}&replica=true`; | ||||||
| const { request: metadataRequest, controller: metadataNewController } = AxiosGetHelper(keyEndpoint, cancelKeyMetadataSignal); | ||||||
| cancelKeyMetadataSignal = metadataNewController; | ||||||
| metadataRequest.then(response => { | ||||||
| keys.push('File Size'); | ||||||
| values.push(byteToSize(response.data.size, 3)); | ||||||
| keys.push('File Size With Replication'); | ||||||
| values.push(byteToSize(response.data.sizeWithReplica, 3)); | ||||||
| console.log(values); | ||||||
|
|
||||||
| this.setState({ | ||||||
| showPanel: true, | ||||||
| panelKeys: keys, | ||||||
| panelValues: values | ||||||
| if (summaryResponse.status !== 'INITIALIZING') { | ||||||
| if (summaryResponse.countStats.type === 'KEY') { | ||||||
| const keyEndpoint = `/api/v1/namespace/du?path=${path}&replica=true`; | ||||||
|
smitajoshi12 marked this conversation as resolved.
|
||||||
| const { request: metadataRequest, controller: metadataNewController } = AxiosGetHelper(keyEndpoint, cancelKeyMetadataSignal); | ||||||
| cancelKeyMetadataSignal = metadataNewController; | ||||||
| metadataRequest.then(response => { | ||||||
| keys.push('File Size'); | ||||||
| values.push(byteToSize(response.data.size, 3)); | ||||||
| keys.push('File Size With Replication'); | ||||||
| values.push(byteToSize(response.data.sizeWithReplica, 3)); | ||||||
| console.log(values); | ||||||
|
|
||||||
| this.setState({ | ||||||
| showPanel: true, | ||||||
| panelKeys: keys, | ||||||
| panelValues: values | ||||||
| }); | ||||||
| }).catch(error => { | ||||||
| this.setState({ | ||||||
| isLoading: false, | ||||||
| showPanel: false | ||||||
| }); | ||||||
| showDataFetchError(error.toString()); | ||||||
| }); | ||||||
| }).catch(error => { | ||||||
| this.setState({ | ||||||
| isLoading: false, | ||||||
| showPanel: false | ||||||
| }); | ||||||
| showDataFetchError(error.toString()); | ||||||
| }); | ||||||
| return; | ||||||
| } | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.countStats.status === 'PATH_NOT_FOUND') { | ||||||
| showDataFetchError(`Invalid Path: ${path}`); | ||||||
| return; | ||||||
| } | ||||||
| if (summaryResponse.countStats.status === 'PATH_NOT_FOUND') { | ||||||
| showDataFetchError(`Invalid Path: ${path}`); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.countStats.numVolume !== -1) { | ||||||
| keys.push('Volumes'); | ||||||
| values.push(summaryResponse.countStats.numVolume); | ||||||
| } | ||||||
| if (summaryResponse.countStats.numVolume !== -1) { | ||||||
| keys.push('Volumes'); | ||||||
| values.push(summaryResponse.countStats.numVolume); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.countStats.numBucket !== -1) { | ||||||
| keys.push('Buckets'); | ||||||
| values.push(summaryResponse.countStats.numBucket); | ||||||
| } | ||||||
| if (summaryResponse.countStats.numBucket !== -1) { | ||||||
| keys.push('Buckets'); | ||||||
| values.push(summaryResponse.countStats.numBucket); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.countStats.numDir !== -1) { | ||||||
| keys.push('Total Directories'); | ||||||
| values.push(summaryResponse.countStats.numDir); | ||||||
| } | ||||||
| if (summaryResponse.countStats.numDir !== -1) { | ||||||
| keys.push('Total Directories'); | ||||||
| values.push(summaryResponse.countStats.numDir); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.countStats.numKey !== -1) { | ||||||
| keys.push('Total Keys'); | ||||||
| values.push(summaryResponse.countStats.numKey); | ||||||
| } | ||||||
| if (summaryResponse.countStats.numKey !== -1) { | ||||||
| keys.push('Total Keys'); | ||||||
| values.push(summaryResponse.countStats.numKey); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.bucketName && summaryResponse.objectInfo.bucketName !== -1) { | ||||||
| keys.push('Bucket Name'); | ||||||
| values.push(summaryResponse.objectInfo.bucketName); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.bucketName && summaryResponse.objectInfo.bucketName !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Bucket Name'); | ||||||
| values.push(summaryResponse.objectInfo.bucketName); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.bucketLayout && summaryResponse.objectInfo.bucketLayout !== -1) { | ||||||
| keys.push('Bucket Layout'); | ||||||
| values.push(summaryResponse.objectInfo.bucketLayout); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.bucketLayout && summaryResponse.objectInfo.bucketLayout !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Bucket Layout'); | ||||||
| values.push(summaryResponse.objectInfo.bucketLayout); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.creationTime && summaryResponse.objectInfo.creationTime !== -1) { | ||||||
| keys.push('Creation Time'); | ||||||
| values.push(moment(summaryResponse.objectInfo.creationTime).format('ll LTS')); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.creationTime && summaryResponse.objectInfo.creationTime !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Creation Time'); | ||||||
| values.push(moment(summaryResponse.objectInfo.creationTime).format('ll LTS')); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.dataSize && summaryResponse.objectInfo.dataSize !== -1) { | ||||||
| keys.push('Data Size'); | ||||||
| values.push(byteToSize(summaryResponse.objectInfo.dataSize, 3)); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.dataSize && summaryResponse.objectInfo.dataSize !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Data Size'); | ||||||
| values.push(byteToSize(summaryResponse.objectInfo.dataSize, 3)); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.encInfo && summaryResponse.objectInfo.encInfo !== -1) { | ||||||
| keys.push('ENC Info'); | ||||||
| values.push(summaryResponse.objectInfo.encInfo); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.encInfo && summaryResponse.objectInfo.encInfo !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('ENC Info'); | ||||||
| values.push(summaryResponse.objectInfo.encInfo); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.fileName && summaryResponse.objectInfo.fileName !== -1) { | ||||||
| keys.push('File Name'); | ||||||
| values.push(summaryResponse.objectInfo.fileName); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.fileName && summaryResponse.objectInfo.fileName !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('File Name'); | ||||||
| values.push(summaryResponse.objectInfo.fileName); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.keyName && summaryResponse.objectInfo.keyName !== -1) { | ||||||
| keys.push('Key Name'); | ||||||
| values.push(summaryResponse.objectInfo.keyName); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.keyName && summaryResponse.objectInfo.keyName !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Key Name'); | ||||||
| values.push(summaryResponse.objectInfo.keyName); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.modificationTime && summaryResponse.objectInfo.modificationTime !== -1) { | ||||||
| keys.push('Modification Time'); | ||||||
| values.push(moment(summaryResponse.objectInfo.modificationTime).format('ll LTS')); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.modificationTime && summaryResponse.objectInfo.modificationTime !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Modification Time'); | ||||||
| values.push(moment(summaryResponse.objectInfo.modificationTime).format('ll LTS')); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.name && summaryResponse.objectInfo.name !== -1) { | ||||||
| keys.push('Name'); | ||||||
| values.push(summaryResponse.objectInfo.name); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.name && summaryResponse.objectInfo.name !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Name'); | ||||||
| values.push(summaryResponse.objectInfo.name); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.owner && summaryResponse.objectInfo.owner !== -1) { | ||||||
| keys.push('Owner'); | ||||||
| values.push(summaryResponse.objectInfo.owner); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.owner && summaryResponse.objectInfo.owner !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Owner'); | ||||||
| values.push(summaryResponse.objectInfo.owner); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.quotaInBytes && summaryResponse.objectInfo.quotaInBytes !== -1) { | ||||||
| keys.push('Quota In Bytes'); | ||||||
| values.push(byteToSize(summaryResponse.objectInfo.quotaInBytes, 3)); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.quotaInBytes && summaryResponse.objectInfo.quotaInBytes !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Quota In Bytes'); | ||||||
| values.push(byteToSize(summaryResponse.objectInfo.quotaInBytes, 3)); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.quotaInNamespace && summaryResponse.objectInfo.quotaInNamespace !== -1) { | ||||||
| keys.push('Quota In Namespace'); | ||||||
| values.push(byteToSize(summaryResponse.objectInfo.quotaInNamespace, 3)); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.quotaInNamespace && summaryResponse.objectInfo.quotaInNamespace !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Quota In Namespace'); | ||||||
| values.push(byteToSize(summaryResponse.objectInfo.quotaInNamespace, 3)); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.replicationFactor && summaryResponse.objectInfo.replicationConfig.replicationFactor !== -1) { | ||||||
| keys.push('Replication Factor'); | ||||||
| values.push(summaryResponse.objectInfo.replicationConfig.replicationFactor); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.replicationFactor && summaryResponse.objectInfo.replicationConfig.replicationFactor !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Replication Factor'); | ||||||
| values.push(summaryResponse.objectInfo.replicationConfig.replicationFactor); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.replicationType && summaryResponse.objectInfo.replicationConfig.replicationType !== -1) { | ||||||
| keys.push('Replication Type'); | ||||||
| values.push(summaryResponse.objectInfo.replicationConfig.replicationType); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.replicationType && summaryResponse.objectInfo.replicationConfig.replicationType !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Replication Type'); | ||||||
| values.push(summaryResponse.objectInfo.replicationConfig.replicationType); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.requiredNodes && summaryResponse.objectInfo.replicationConfig.requiredNodes !== -1) { | ||||||
| keys.push('Replication Required Nodes'); | ||||||
| values.push(summaryResponse.objectInfo.replicationConfig.requiredNodes); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.sourceBucket && summaryResponse.objectInfo.sourceBucket !== -1) { | ||||||
| keys.push('Source Bucket'); | ||||||
| values.push(summaryResponse.objectInfo.sourceBucket); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.requiredNodes && summaryResponse.objectInfo.replicationConfig.requiredNodes !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Replication Required Nodes'); | ||||||
| values.push(summaryResponse.objectInfo.replicationConfig.requiredNodes); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.sourceBucket && summaryResponse.objectInfo.sourceBucket !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Source Bucket'); | ||||||
| values.push(summaryResponse.objectInfo.sourceBucket); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.sourceVolume && summaryResponse.objectInfo.sourceVolume !== -1) { | ||||||
| keys.push('Source Volume'); | ||||||
| values.push(summaryResponse.objectInfo.sourceVolume); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.sourceVolume && summaryResponse.objectInfo.sourceVolume !== -1) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| keys.push('Source Volume'); | ||||||
| values.push(summaryResponse.objectInfo.sourceVolume); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.storageType && summaryResponse.objectInfo.storageType !== -1) { | ||||||
| keys.push('Storage Type'); | ||||||
| values.push(summaryResponse.objectInfo.storageType); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.storageType && summaryResponse.objectInfo.storageType !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Storage Type'); | ||||||
| values.push(summaryResponse.objectInfo.storageType); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.usedBytes && summaryResponse.objectInfo.usedBytes !== -1) { | ||||||
| keys.push('Used Bytes'); | ||||||
| values.push(summaryResponse.objectInfo.usedBytes); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.usedBytes && summaryResponse.objectInfo.usedBytes !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Used Bytes'); | ||||||
| values.push(summaryResponse.objectInfo.usedBytes); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.usedNamespace && summaryResponse.objectInfo.usedNamespace !== -1) { | ||||||
| keys.push('Used NameSpaces'); | ||||||
| values.push(summaryResponse.objectInfo.usedNamespace); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.usedNamespace && summaryResponse.objectInfo.usedNamespace !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Used NameSpaces'); | ||||||
| values.push(summaryResponse.objectInfo.usedNamespace); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.volumeName && summaryResponse.objectInfo.volumeName !== -1) { | ||||||
| keys.push('Volume Name'); | ||||||
| values.push(summaryResponse.objectInfo.volumeName); | ||||||
| } | ||||||
| if (summaryResponse.objectInfo.volumeName && summaryResponse.objectInfo.volumeName !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Volume Name'); | ||||||
| values.push(summaryResponse.objectInfo.volumeName); | ||||||
| } | ||||||
|
|
||||||
| if (summaryResponse.objectInfo.volume && summaryResponse.objectInfo.volume !== -1) { | ||||||
| keys.push('Volume'); | ||||||
| values.push(summaryResponse.objectInfo.volume); | ||||||
| if (summaryResponse.objectInfo.volume && summaryResponse.objectInfo.volume !== -1) { | ||||||
|
smitajoshi12 marked this conversation as resolved.
Outdated
|
||||||
| keys.push('Volume'); | ||||||
| values.push(summaryResponse.objectInfo.volume); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| // Show the right drawer | ||||||
|
|
@@ -486,6 +488,10 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState> | |||||
| return; | ||||||
| } | ||||||
|
|
||||||
| if (quotaResponse.status === 'INITIALIZING') { | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // Append quota information | ||||||
| // In case the object's quota isn't set | ||||||
| if (quotaResponse.allowed !== -1) { | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.