Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions portal-ui/src/common/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import {
} from "../utils";

test("A variety of formatting results", () => {
expect(niceBytes("1024")).toBe("1.0 KiB");
expect(niceBytes("1048576")).toBe("1.0 MiB");
expect(niceBytes("1073741824")).toBe("1.0 GiB");
expect(niceBytes("1024")).toBe("1.0 KB");
expect(niceBytes("1048576")).toBe("1.0 MB");
expect(niceBytes("1073741824")).toBe("1.0 GB");
});

test("From value and unit to a number of bytes", () => {
expect(getBytes("1", "KiB")).toBe("1024");
expect(getBytes("1", "MiB")).toBe("1048576");
expect(getBytes("1", "GiB")).toBe("1073741824");
expect(getBytes("1", "KB")).toBe("1024");
expect(getBytes("1", "MB")).toBe("1048576");
expect(getBytes("1", "GB")).toBe("1073741824");
});

test("From value and unit to a number of bytes for kubernetes", () => {
Expand Down
12 changes: 1 addition & 11 deletions portal-ui/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,7 @@ import { IPool } from "../screens/Console/Tenants/ListTenants/types";
const minStReq = 1073741824; // Minimal Space required for MinIO
const minMemReq = 2147483648; // Minimal Memory required for MinIO in bytes

export const units = [
"B",
"KiB",
"MiB",
"GiB",
"TiB",
"PiB",
"EiB",
"ZiB",
"YiB",
];
export const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
export const k8sUnits = ["Ki", "Mi", "Gi", "Ti", "Pi", "Ei"];
export const k8sCalcUnits = ["B", ...k8sUnits];

Expand Down
28 changes: 16 additions & 12 deletions portal-ui/src/screens/Console/License/License.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,60 +479,64 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
>
{niceBytes(
(licenseInfo.storage_capacity * 1099511627776) // 1 Terabyte = 1099511627776 Bytes
.toString(10)
.toString(10),
false
)}
</Typography>
</Grid>
<Grid item xs={6}>
<Typography
variant="button"
display="block"
gutterBottom
className={classes.licenseInfoTitle}
>
Expiry Date
Subscription Plan
</Typography>
<Typography
variant="overline"
display="block"
gutterBottom
className={classes.licenseInfoValue}
>
<Moment format="YYYY-MM-DD">
{licenseInfo.expires_at}
</Moment>
{licenseInfo.plan}
</Typography>
</Grid>
<Grid item xs={6}>
<Typography
variant="button"
display="block"
gutterBottom
className={classes.licenseInfoTitle}
>
Subscription Plan
Requestor
</Typography>
<Typography
variant="overline"
display="block"
gutterBottom
className={classes.licenseInfoValue}
>
{licenseInfo.plan}
{licenseInfo.email}
</Typography>
<Typography
variant="button"
display="block"
gutterBottom
className={classes.licenseInfoTitle}
>
Requester
Expiry Date
</Typography>
<Typography
variant="overline"
display="block"
gutterBottom
className={classes.licenseInfoValue}
>
{licenseInfo.email}
<Moment format="YYYY-MM-DD">
{licenseInfo.expires_at
.split(" ")
.slice(0, 1)
.join(" ")}
</Moment>
</Typography>
</Grid>
<img
Expand Down Expand Up @@ -624,7 +628,7 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
refreshLicense();
}}
>
Refresh Licence
Refresh License
</button>
{loadingRefreshLicense && (
<CircularProgress
Expand Down
6 changes: 3 additions & 3 deletions portal-ui/src/screens/Console/License/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const planDetails = [
{
id: 0,
title: "Community",
price: "FREE",
price: "N/A",
capacityMax: "Open Source",
},
{
Expand Down Expand Up @@ -98,14 +98,14 @@ export const planItems = [
id: 6,
field: "Annual Architecture Review",
community: "N/A",
standard: "Yes",
standard: "N/A",
enterprise: "Yes",
},
{
id: 7,
field: "Annual Performance Review",
community: "N/A",
standard: "Yes",
standard: "N/A",
enterprise: "Yes",
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const SubnetLicenseTenant = ({
gutterBottom
className={classes.licenseInfoTitle}
>
Requester
Requestor
</Typography>
<Typography
variant="overline"
Expand Down