From f15a7ff5f6f1a45639e242366e7d6ddaaa428d88 Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Tue, 19 Apr 2022 22:31:53 -0600 Subject: [PATCH] Added tenant domains to summary page (#1864) Signed-off-by: Benjamin Perez --- portal-ui/src/common/types.ts | 5 + .../Console/Tenants/ListTenants/types.ts | 38 ++++---- .../Tenants/TenantDetails/TenantSummary.tsx | 92 ++++++++++++++----- 3 files changed, 96 insertions(+), 39 deletions(-) diff --git a/portal-ui/src/common/types.ts b/portal-ui/src/common/types.ts index eb2e35d04..cc26f2f4c 100644 --- a/portal-ui/src/common/types.ts +++ b/portal-ui/src/common/types.ts @@ -50,6 +50,11 @@ export interface IVolumeConfiguration { labels?: any; } +export interface IDomainsRequest { + console?: string; + minio?: string[]; +} + export interface ITenantCreator { name: string; service_name: string; diff --git a/portal-ui/src/screens/Console/Tenants/ListTenants/types.ts b/portal-ui/src/screens/Console/Tenants/ListTenants/types.ts index b27e6cbad..95eb17f9f 100644 --- a/portal-ui/src/screens/Console/Tenants/ListTenants/types.ts +++ b/portal-ui/src/screens/Console/Tenants/ListTenants/types.ts @@ -17,6 +17,7 @@ import { SubnetInfo } from "../../License/types"; import { IAffinityModel, + IDomainsRequest, IResourceModel, ITolerationModel, } from "../../../../common/types"; @@ -115,24 +116,24 @@ export interface ITenantEncryptionResponse { server: ICertificateInfo[]; client: ICertificateInfo[]; /* - gemalto: - type: object - $ref: "#/definitions/gemaltoConfiguration" - aws: - type: object - $ref: "#/definitions/awsConfiguration" - vault: - type: object - $ref: "#/definitions/vaultConfiguration" - gcp: - type: object - $ref: "#/definitions/gcpConfiguration" - azure: - type: object - $ref: "#/definitions/azureConfiguration" - securityContext: - type: object - $ref: "#/definitions/securityContext"*/ + gemalto: + type: object + $ref: "#/definitions/gemaltoConfiguration" + aws: + type: object + $ref: "#/definitions/awsConfiguration" + vault: + type: object + $ref: "#/definitions/vaultConfiguration" + gcp: + type: object + $ref: "#/definitions/gcpConfiguration" + azure: + type: object + $ref: "#/definitions/azureConfiguration" + securityContext: + type: object + $ref: "#/definitions/securityContext"*/ } export interface ITenantTier { @@ -170,6 +171,7 @@ export interface ITenant { capacity?: number; capacity_usage?: number; tiers?: ITenantTier[]; + domains?: IDomainsRequest; // computed total_capacity: string; subnet_license: SubnetInfo; diff --git a/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantSummary.tsx b/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantSummary.tsx index 35c12e9be..9c3f731fb 100644 --- a/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantSummary.tsx +++ b/portal-ui/src/screens/Console/Tenants/TenantDetails/TenantSummary.tsx @@ -46,7 +46,6 @@ interface ITenantsSummary { consoleEnabled: boolean; adEnabled: boolean; oidcEnabled: boolean; - loadingTenant: boolean; } const styles = (theme: Theme) => @@ -108,6 +107,10 @@ const styles = (theme: Theme) => }, linkedSection: { color: theme.palette.info.main, + fontFamily: "'Lato', sans-serif", + }, + autoGeneratedLink: { + fontStyle: "italic", }, ...containerForHeader(theme.spacing(4)), }); @@ -188,11 +191,8 @@ const TenantSummary = ({ monitoringEnabled, encryptionEnabled, minioTLS, - consoleTLS, - consoleEnabled, adEnabled, oidcEnabled, - loadingTenant, }: ITenantsSummary) => { const [poolCount, setPoolCount] = useState(0); const [instances, setInstances] = useState(0); @@ -256,14 +256,41 @@ const TenantSummary = ({ - {tenant?.endpoints?.minio || "-"} - + + {!tenant?.domains?.minio && !tenant?.endpoints?.minio + ? "-" + : ""} + {tenant?.endpoints?.minio && ( + + + {tenant?.endpoints?.minio || "-"} + +
+
+ )} + + {tenant?.domains?.minio && + tenant.domains.minio.map((domain) => { + return ( + + + {domain} + +
+
+ ); + })} +
} /> @@ -271,14 +298,38 @@ const TenantSummary = ({ - {tenant?.endpoints?.console || "-"} - + + {(!tenant?.domains?.console || + tenant?.domains?.console === "") && + !tenant?.endpoints?.console + ? "-" + : ""} + + {tenant?.endpoints?.console && ( + + + {tenant?.endpoints?.console || "-"} + +
+
+ )} + + {tenant?.domains?.console && tenant?.domains?.console !== "" && ( + + {tenant?.domains?.console || ""} + + )} +
} /> @@ -398,7 +449,6 @@ const TenantSummary = ({ }; const mapState = (state: AppState) => ({ - loadingTenant: state.tenants.tenantDetails.loadingTenant, selectedTenant: state.tenants.tenantDetails.currentTenant, tenant: state.tenants.tenantDetails.tenantInfo, logEnabled: get(state.tenants.tenantDetails.tenantInfo, "logEnabled", false),