Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Comment thread
smitajoshi12 marked this conversation as resolved.
Outdated
Comment thread
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) {
Comment thread
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) {
Comment thread
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) {
Comment thread
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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.dataSize && summaryResponse.objectInfo.dataSize !== -1) {
if (summaryResponse.objectInfo?.dataSize !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.encInfo && summaryResponse.objectInfo.encInfo !== -1) {
if (summaryResponse.objectInfo?.encInfo !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.fileName && summaryResponse.objectInfo.fileName !== -1) {
if (summaryResponse.objectInfo?.fileName !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.keyName && summaryResponse.objectInfo.keyName !== -1) {
if (summaryResponse.objectInfo?.keyName !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.modificationTime && summaryResponse.objectInfo.modificationTime !== -1) {
if (summaryResponse.objectInfo?.modificationTime !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.name && summaryResponse.objectInfo.name !== -1) {
if (summaryResponse.objectInfo?.name !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.owner && summaryResponse.objectInfo.owner !== -1) {
if (summaryResponse.objectInfo?.owner !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.quotaInBytes && summaryResponse.objectInfo.quotaInBytes !== -1) {
if (summaryResponse.objectInfo?.quotaInBytes !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.quotaInNamespace && summaryResponse.objectInfo.quotaInNamespace !== -1) {
if (summaryResponse.objectInfo?.quotaInNamespace !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.replicationFactor && summaryResponse.objectInfo.replicationConfig.replicationFactor !== -1) {
if (summaryResponse.objectInfo?.replicationConfig?.replicationFactor !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.replicationType && summaryResponse.objectInfo.replicationConfig.replicationType !== -1) {
if (summaryResponse.objectInfo?.replicationConfig?.replicationType !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.replicationConfig && summaryResponse.objectInfo.replicationConfig.requiredNodes && summaryResponse.objectInfo.replicationConfig.requiredNodes !== -1) {
if (summaryResponse.objectInfo?.replicationConfig?.requiredNodes !== -1) {

keys.push('Replication Required Nodes');
values.push(summaryResponse.objectInfo.replicationConfig.requiredNodes);
}
if (summaryResponse.objectInfo.sourceBucket && summaryResponse.objectInfo.sourceBucket !== -1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.sourceBucket && summaryResponse.objectInfo.sourceBucket !== -1) {
if (summaryResponse.objectInfo?.sourceBucket !== -1) {

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (summaryResponse.objectInfo.sourceVolume && summaryResponse.objectInfo.sourceVolume !== -1) {
if (summaryResponse.objectInfo?.sourceVolume !== -1) {

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) {
Comment thread
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) {
Comment thread
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) {
Comment thread
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) {
Comment thread
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) {
Comment thread
smitajoshi12 marked this conversation as resolved.
Outdated
keys.push('Volume');
values.push(summaryResponse.objectInfo.volume);
}
}

// Show the right drawer
Expand Down Expand Up @@ -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) {
Expand Down