License Tweaks (#1188)
* License Tweaks Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> * Address comments Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> * Fix react tests Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
This commit is contained in:
@@ -22,15 +22,15 @@ import {
|
|||||||
} from "../utils";
|
} from "../utils";
|
||||||
|
|
||||||
test("A variety of formatting results", () => {
|
test("A variety of formatting results", () => {
|
||||||
expect(niceBytes("1024")).toBe("1.0 KiB");
|
expect(niceBytes("1024")).toBe("1.0 KB");
|
||||||
expect(niceBytes("1048576")).toBe("1.0 MiB");
|
expect(niceBytes("1048576")).toBe("1.0 MB");
|
||||||
expect(niceBytes("1073741824")).toBe("1.0 GiB");
|
expect(niceBytes("1073741824")).toBe("1.0 GB");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("From value and unit to a number of bytes", () => {
|
test("From value and unit to a number of bytes", () => {
|
||||||
expect(getBytes("1", "KiB")).toBe("1024");
|
expect(getBytes("1", "KB")).toBe("1024");
|
||||||
expect(getBytes("1", "MiB")).toBe("1048576");
|
expect(getBytes("1", "MB")).toBe("1048576");
|
||||||
expect(getBytes("1", "GiB")).toBe("1073741824");
|
expect(getBytes("1", "GB")).toBe("1073741824");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("From value and unit to a number of bytes for kubernetes", () => {
|
test("From value and unit to a number of bytes for kubernetes", () => {
|
||||||
|
|||||||
@@ -21,17 +21,7 @@ import { IPool } from "../screens/Console/Tenants/ListTenants/types";
|
|||||||
const minStReq = 1073741824; // Minimal Space required for MinIO
|
const minStReq = 1073741824; // Minimal Space required for MinIO
|
||||||
const minMemReq = 2147483648; // Minimal Memory required for MinIO in bytes
|
const minMemReq = 2147483648; // Minimal Memory required for MinIO in bytes
|
||||||
|
|
||||||
export const units = [
|
export const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
||||||
"B",
|
|
||||||
"KiB",
|
|
||||||
"MiB",
|
|
||||||
"GiB",
|
|
||||||
"TiB",
|
|
||||||
"PiB",
|
|
||||||
"EiB",
|
|
||||||
"ZiB",
|
|
||||||
"YiB",
|
|
||||||
];
|
|
||||||
export const k8sUnits = ["Ki", "Mi", "Gi", "Ti", "Pi", "Ei"];
|
export const k8sUnits = ["Ki", "Mi", "Gi", "Ti", "Pi", "Ei"];
|
||||||
export const k8sCalcUnits = ["B", ...k8sUnits];
|
export const k8sCalcUnits = ["B", ...k8sUnits];
|
||||||
|
|
||||||
|
|||||||
@@ -479,27 +479,10 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
|
|||||||
>
|
>
|
||||||
{niceBytes(
|
{niceBytes(
|
||||||
(licenseInfo.storage_capacity * 1099511627776) // 1 Terabyte = 1099511627776 Bytes
|
(licenseInfo.storage_capacity * 1099511627776) // 1 Terabyte = 1099511627776 Bytes
|
||||||
.toString(10)
|
.toString(10),
|
||||||
|
false
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
|
||||||
variant="button"
|
|
||||||
display="block"
|
|
||||||
gutterBottom
|
|
||||||
className={classes.licenseInfoTitle}
|
|
||||||
>
|
|
||||||
Expiry Date
|
|
||||||
</Typography>
|
|
||||||
<Typography
|
|
||||||
variant="overline"
|
|
||||||
display="block"
|
|
||||||
gutterBottom
|
|
||||||
className={classes.licenseInfoValue}
|
|
||||||
>
|
|
||||||
<Moment format="YYYY-MM-DD">
|
|
||||||
{licenseInfo.expires_at}
|
|
||||||
</Moment>
|
|
||||||
</Typography>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<Typography
|
<Typography
|
||||||
@@ -524,7 +507,7 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
|
|||||||
gutterBottom
|
gutterBottom
|
||||||
className={classes.licenseInfoTitle}
|
className={classes.licenseInfoTitle}
|
||||||
>
|
>
|
||||||
Requester
|
Requestor
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
variant="overline"
|
variant="overline"
|
||||||
@@ -534,6 +517,27 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
|
|||||||
>
|
>
|
||||||
{licenseInfo.email}
|
{licenseInfo.email}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="button"
|
||||||
|
display="block"
|
||||||
|
gutterBottom
|
||||||
|
className={classes.licenseInfoTitle}
|
||||||
|
>
|
||||||
|
Expiry Date
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="overline"
|
||||||
|
display="block"
|
||||||
|
gutterBottom
|
||||||
|
className={classes.licenseInfoValue}
|
||||||
|
>
|
||||||
|
<Moment format="YYYY-MM-DD">
|
||||||
|
{licenseInfo.expires_at
|
||||||
|
.split(" ")
|
||||||
|
.slice(0, 1)
|
||||||
|
.join(" ")}
|
||||||
|
</Moment>
|
||||||
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<img
|
<img
|
||||||
className={classes.verifiedIcon}
|
className={classes.verifiedIcon}
|
||||||
@@ -624,7 +628,7 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
|
|||||||
refreshLicense();
|
refreshLicense();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Refresh Licence
|
Refresh License
|
||||||
</button>
|
</button>
|
||||||
{loadingRefreshLicense && (
|
{loadingRefreshLicense && (
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const planDetails = [
|
|||||||
{
|
{
|
||||||
id: 0,
|
id: 0,
|
||||||
title: "Community",
|
title: "Community",
|
||||||
price: "FREE",
|
price: "N/A",
|
||||||
capacityMax: "Open Source",
|
capacityMax: "Open Source",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -98,14 +98,14 @@ export const planItems = [
|
|||||||
id: 6,
|
id: 6,
|
||||||
field: "Annual Architecture Review",
|
field: "Annual Architecture Review",
|
||||||
community: "N/A",
|
community: "N/A",
|
||||||
standard: "Yes",
|
standard: "N/A",
|
||||||
enterprise: "Yes",
|
enterprise: "Yes",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 7,
|
id: 7,
|
||||||
field: "Annual Performance Review",
|
field: "Annual Performance Review",
|
||||||
community: "N/A",
|
community: "N/A",
|
||||||
standard: "Yes",
|
standard: "N/A",
|
||||||
enterprise: "Yes",
|
enterprise: "Yes",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ const SubnetLicenseTenant = ({
|
|||||||
gutterBottom
|
gutterBottom
|
||||||
className={classes.licenseInfoTitle}
|
className={classes.licenseInfoTitle}
|
||||||
>
|
>
|
||||||
Requester
|
Requestor
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
variant="overline"
|
variant="overline"
|
||||||
|
|||||||
Reference in New Issue
Block a user