Skip to content

Commit 7be925c

Browse files
committed
New Tenant Details Layouts
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent 4a59fba commit 7be925c

File tree

10 files changed

+540
-401
lines changed

10 files changed

+540
-401
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ WORKDIR /go/src/github.com/minio/console/
2828

2929
ENV CGO_ENABLED=0
3030

31+
COPY --from=uilayer /app/build /go/src/github.com/minio/console/portal-ui/build
3132
RUN go build -ldflags "-w -s" -a -o console ./cmd/console
3233

3334
FROM scratch
3435
MAINTAINER MinIO Development "dev@min.io"
3536
EXPOSE 9090
3637

38+
3739
COPY --from=golayer /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
3840
COPY --from=golayer /go/src/github.com/minio/console/console .
3941

models/tenant.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/src/screens/Console/Common/UsageBarWrapper/UsageBarWrapper.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
33
import { LinearProgress } from "@material-ui/core";
4-
import Paper from "@material-ui/core/Paper";
54
import Grid from "@material-ui/core/Grid";
65
import CircularProgress from "@material-ui/core/CircularProgress";
76
import ErrorBlock from "../../../shared/ErrorBlock";
@@ -47,6 +46,9 @@ const BorderLinearProgress = withStyles((theme) => ({
4746
borderRadius: 5,
4847
backgroundColor: "#081C42",
4948
},
49+
padChart: {
50+
padding: "5px",
51+
},
5052
}))(LinearProgress);
5153

5254
const UsageBarWrapper = ({
@@ -84,20 +86,18 @@ const UsageBarWrapper = ({
8486

8587
return (
8688
<React.Fragment>
87-
<Paper className={classes.paperContainer}>
88-
{loading && (
89-
<React.Fragment>
90-
<Grid item xs={12} className={classes.centerItem}>
91-
<CircularProgress
92-
color="primary"
93-
size={40}
94-
variant="indeterminate"
95-
/>
96-
</Grid>
97-
</React.Fragment>
98-
)}
99-
{renderComponent()}
100-
</Paper>
89+
{loading && (
90+
<div className={classes.padChart}>
91+
<Grid item xs={12} className={classes.centerItem}>
92+
<CircularProgress
93+
color="primary"
94+
size={40}
95+
variant="indeterminate"
96+
/>
97+
</Grid>
98+
</div>
99+
)}
100+
{renderComponent()}
101101
</React.Fragment>
102102
);
103103
};

portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ const ListTiersConfiguration = ({
8989
const [filter, setFilter] = useState<string>("");
9090
const [isLoading, setIsLoading] = useState<boolean>(true);
9191
const [currentPanel, setCurrentPanel] = useState<number>(0);
92-
const [updateCredentialsOpen, setUpdateCredentialsOpen] = useState<boolean>(
93-
false
94-
);
92+
const [updateCredentialsOpen, setUpdateCredentialsOpen] =
93+
useState<boolean>(false);
9594
const [selectedTier, setSelectedTier] = useState<ITierElement>({
9695
type: "unsupported",
9796
});
@@ -213,10 +212,6 @@ const ListTiersConfiguration = ({
213212
<SlideOptions
214213
slideOptions={[
215214
<Fragment>
216-
<Grid item xs={12} className={classes.customTitle}>
217-
Tiers
218-
</Grid>
219-
220215
<Grid item xs={12} className={classes.lambdaContainer}>
221216
<Grid item xs={12} className={classes.actionsTray}>
222217
<TextField

portal-ui/src/screens/Console/Tenants/ListTenants/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export interface ITenant {
7474
endpoints: IEndpoints;
7575
logEnabled: boolean;
7676
monitoringEnabled: boolean;
77+
encryptionEnabled: boolean;
7778
idpAdEnabled: boolean;
7879
idpOicEnabled: boolean;
7980
// computed
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
// This file is part of MinIO Console Server
2+
// Copyright (c) 2021 MinIO, Inc.
3+
//
4+
// This program is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Affero General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Affero General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Affero General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
import React, { useEffect, useState } from "react";
18+
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
19+
import Grid from "@material-ui/core/Grid";
20+
import { containerForHeader } from "../../Common/FormComponents/common/styleLibrary";
21+
import { Button, Typography } from "@material-ui/core";
22+
import { niceBytes } from "../../../../common/utils";
23+
import Moment from "react-moment";
24+
import { Link } from "react-router-dom";
25+
import Paper from "@material-ui/core/Paper";
26+
import { ITenant } from "../ListTenants/types";
27+
import { LicenseInfo } from "../../License/types";
28+
import api from "../../../../common/api";
29+
30+
interface ISubnetLicenseTenant {
31+
classes: any;
32+
tenant: ITenant | null;
33+
loadingActivateProduct: any;
34+
loadingLicenseInfo: boolean;
35+
licenseInfo: LicenseInfo | undefined;
36+
activateProduct: any;
37+
}
38+
39+
const styles = (theme: Theme) =>
40+
createStyles({
41+
paperContainer: {
42+
padding: "15px 15px 15px 50px",
43+
},
44+
licenseInfoValue: {
45+
textTransform: "none",
46+
fontSize: 14,
47+
fontWeight: "bold",
48+
},
49+
licenseContainer: {
50+
position: "relative",
51+
padding: "20px 52px 0px 28px",
52+
background: "#032F51",
53+
boxShadow: "0px 3px 7px #00000014",
54+
"& h2": {
55+
color: "#FFF",
56+
marginBottom: 67,
57+
},
58+
"& a": {
59+
textDecoration: "none",
60+
},
61+
"& h3": {
62+
color: "#FFFFFF",
63+
marginBottom: "30px",
64+
fontWeight: "bold",
65+
},
66+
"& h6": {
67+
color: "#FFFFFF !important",
68+
},
69+
},
70+
licenseInfo: { color: "#FFFFFF", position: "relative" },
71+
licenseInfoTitle: {
72+
textTransform: "none",
73+
color: "#BFBFBF",
74+
fontSize: 11,
75+
},
76+
verifiedIcon: {
77+
width: 96,
78+
position: "absolute",
79+
right: 0,
80+
bottom: 29,
81+
},
82+
noUnderLine: {
83+
textDecoration: "none",
84+
},
85+
...containerForHeader(theme.spacing(4)),
86+
});
87+
88+
const SubnetLicenseTenant = ({
89+
classes,
90+
tenant,
91+
loadingActivateProduct,
92+
loadingLicenseInfo,
93+
licenseInfo,
94+
activateProduct,
95+
}: ISubnetLicenseTenant) => {
96+
return (
97+
<Paper
98+
className={
99+
tenant && tenant.subnet_license ? classes.licenseContainer : ""
100+
}
101+
>
102+
{tenant && tenant.subnet_license ? (
103+
<React.Fragment>
104+
<Grid container className={classes.licenseInfo}>
105+
<Grid item xs={6}>
106+
<Typography
107+
variant="button"
108+
display="block"
109+
gutterBottom
110+
className={classes.licenseInfoTitle}
111+
>
112+
License
113+
</Typography>
114+
<Typography
115+
variant="overline"
116+
display="block"
117+
gutterBottom
118+
className={classes.licenseInfoValue}
119+
>
120+
Commercial License
121+
</Typography>
122+
<Typography
123+
variant="button"
124+
display="block"
125+
gutterBottom
126+
className={classes.licenseInfoTitle}
127+
>
128+
Organization
129+
</Typography>
130+
<Typography
131+
variant="overline"
132+
display="block"
133+
gutterBottom
134+
className={classes.licenseInfoValue}
135+
>
136+
{tenant.subnet_license.organization}
137+
</Typography>
138+
<Typography
139+
variant="button"
140+
display="block"
141+
gutterBottom
142+
className={classes.licenseInfoTitle}
143+
>
144+
Registered Capacity
145+
</Typography>
146+
<Typography
147+
variant="overline"
148+
display="block"
149+
gutterBottom
150+
className={classes.licenseInfoValue}
151+
>
152+
{niceBytes(
153+
(tenant.subnet_license.storage_capacity * 1099511627776) // 1 Terabyte = 1099511627776 Bytes
154+
.toString(10)
155+
)}
156+
</Typography>
157+
<Typography
158+
variant="button"
159+
display="block"
160+
gutterBottom
161+
className={classes.licenseInfoTitle}
162+
>
163+
Expiry Date
164+
</Typography>
165+
<Typography
166+
variant="overline"
167+
display="block"
168+
gutterBottom
169+
className={classes.licenseInfoValue}
170+
>
171+
<Moment format="YYYY-MM-DD">
172+
{tenant.subnet_license.expires_at}
173+
</Moment>
174+
</Typography>
175+
</Grid>
176+
<Grid item xs={6}>
177+
<Typography
178+
variant="button"
179+
display="block"
180+
gutterBottom
181+
className={classes.licenseInfoTitle}
182+
>
183+
Subscription Plan
184+
</Typography>
185+
<Typography
186+
variant="overline"
187+
display="block"
188+
gutterBottom
189+
className={classes.licenseInfoValue}
190+
>
191+
{tenant.subnet_license.plan}
192+
</Typography>
193+
<Typography
194+
variant="button"
195+
display="block"
196+
gutterBottom
197+
className={classes.licenseInfoTitle}
198+
>
199+
Requester
200+
</Typography>
201+
<Typography
202+
variant="overline"
203+
display="block"
204+
gutterBottom
205+
className={classes.licenseInfoValue}
206+
>
207+
{tenant.subnet_license.email}
208+
</Typography>
209+
</Grid>
210+
<img
211+
className={classes.verifiedIcon}
212+
src={"/verified.svg"}
213+
alt="verified"
214+
/>
215+
</Grid>
216+
</React.Fragment>
217+
) : (
218+
!loadingLicenseInfo && (
219+
<Grid className={classes.paperContainer}>
220+
{!licenseInfo && (
221+
<Link
222+
to={"/license"}
223+
onClick={(e) => {
224+
e.stopPropagation();
225+
}}
226+
className={classes.noUnderLine}
227+
>
228+
<Button
229+
className={classes.licenseButton}
230+
variant="contained"
231+
color="primary"
232+
>
233+
Activate Product
234+
</Button>
235+
</Link>
236+
)}
237+
{licenseInfo && tenant && (
238+
<Button
239+
disabled={loadingActivateProduct}
240+
className={classes.licenseButton}
241+
variant="contained"
242+
color="primary"
243+
onClick={() => activateProduct(tenant.namespace, tenant.name)}
244+
>
245+
Attach License
246+
</Button>
247+
)}
248+
</Grid>
249+
)
250+
)}
251+
</Paper>
252+
);
253+
};
254+
255+
export default withStyles(styles)(SubnetLicenseTenant);

0 commit comments

Comments
 (0)