Skip to content

Commit

Permalink
feat(ObjectSummary): add paths and shards limits (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raubzeug authored Sep 23, 2024
1 parent d448ace commit 61c3562
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions src/containers/Tenant/ObjectSummary/ObjectSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,31 @@ export function ObjectSummary({

const title = <EntityTitle data={PathDescription} />;

const getDatabaseOverview = () => [
{
label: i18n('summary.paths'),
value: PathDescription?.DomainDescription?.PathsInside,
},
{
label: i18n('summary.shards'),
value: PathDescription?.DomainDescription?.ShardsInside,
},
];
const getDatabaseOverview = () => {
const {PathsInside, ShardsInside, PathsLimit, ShardsLimit} =
PathDescription?.DomainDescription ?? {};
let paths = formatNumber(PathsInside);
let shards = formatNumber(ShardsInside);

if (paths && PathsLimit) {
paths = `${paths} / ${formatNumber(PathsLimit)}`;
}

if (shards && ShardsLimit) {
shards = `${shards} / ${formatNumber(ShardsLimit)}`;
}

return [
{
label: i18n('summary.paths'),
value: paths,
},
{
label: i18n('summary.shards'),
value: shards,
},
];
};

const getPathTypeOverview: Record<EPathType, (() => InfoViewerItem[]) | undefined> = {
[EPathType.EPathTypeInvalid]: undefined,
Expand Down

0 comments on commit 61c3562

Please sign in to comment.