Added tenant domains to summary page (#1864)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2022-04-19 22:31:53 -06:00
committed by GitHub
parent 6c123ce2b5
commit f15a7ff5f6
3 changed files with 96 additions and 39 deletions

View File

@@ -50,6 +50,11 @@ export interface IVolumeConfiguration {
labels?: any;
}
export interface IDomainsRequest {
console?: string;
minio?: string[];
}
export interface ITenantCreator {
name: string;
service_name: string;

View File

@@ -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;

View File

@@ -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<number>(0);
const [instances, setInstances] = useState<number>(0);
@@ -256,14 +256,41 @@ const TenantSummary = ({
<LabelValuePair
label={"Endpoint:"}
value={
<a
href={tenant?.endpoints?.minio}
target="_blank"
rel="noopener noreferrer"
className={classes.linkedSection}
>
{tenant?.endpoints?.minio || "-"}
</a>
<Fragment>
{!tenant?.domains?.minio && !tenant?.endpoints?.minio
? "-"
: ""}
{tenant?.endpoints?.minio && (
<Fragment>
<a
href={tenant?.endpoints?.minio}
target="_blank"
rel="noopener noreferrer"
className={`${classes.linkedSection} ${classes.autoGeneratedLink}`}
>
{tenant?.endpoints?.minio || "-"}
</a>
<br />
</Fragment>
)}
{tenant?.domains?.minio &&
tenant.domains.minio.map((domain) => {
return (
<Fragment>
<a
href={domain}
target="_blank"
rel="noopener noreferrer"
className={classes.linkedSection}
>
{domain}
</a>
<br />
</Fragment>
);
})}
</Fragment>
}
/>
</Grid>
@@ -271,14 +298,38 @@ const TenantSummary = ({
<LabelValuePair
label={"Console:"}
value={
<a
href={tenant?.endpoints?.console}
target="_blank"
rel="noopener noreferrer"
className={classes.linkedSection}
>
{tenant?.endpoints?.console || "-"}
</a>
<Fragment>
{(!tenant?.domains?.console ||
tenant?.domains?.console === "") &&
!tenant?.endpoints?.console
? "-"
: ""}
{tenant?.endpoints?.console && (
<Fragment>
<a
href={tenant?.endpoints?.console}
target="_blank"
rel="noopener noreferrer"
className={`${classes.linkedSection} ${classes.autoGeneratedLink}`}
>
{tenant?.endpoints?.console || "-"}
</a>
<br />
</Fragment>
)}
{tenant?.domains?.console && tenant?.domains?.console !== "" && (
<a
href={tenant?.domains?.console || ""}
target="_blank"
rel="noopener noreferrer"
className={classes.linkedSection}
>
{tenant?.domains?.console || ""}
</a>
)}
</Fragment>
}
/>
</Grid>
@@ -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),