Skip to content

Commit 64ffa03

Browse files
authored
Operator improvements (#1798)
Added new design to Tenants page list Added Pool details initial page Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 822724a commit 64ffa03

File tree

21 files changed

+2000
-250
lines changed

21 files changed

+2000
-250
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/minio/madmin-go v1.3.5
2323
github.com/minio/mc v0.0.0-20220302011226-f13defa54577
2424
github.com/minio/minio-go/v7 v7.0.23
25-
github.com/minio/operator v0.0.0-20220322220228-ae7a32a7c19e
25+
github.com/minio/operator v0.0.0-20220401213108-1e35dbf22c40
2626
github.com/minio/pkg v1.1.20
2727
github.com/minio/selfupdate v0.4.0
2828
github.com/mitchellh/go-homedir v1.1.0

go.sum

Lines changed: 965 additions & 2 deletions
Large diffs are not rendered by default.

models/tenant_list.go

Lines changed: 70 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/tenant_tier_element.go

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

operatorapi/embedded_spec.go

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

operatorapi/tenants.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,18 @@ func listTenants(ctx context.Context, operatorClient OperatorClientI, namespace
808808
deletion = tenant.ObjectMeta.DeletionTimestamp.Format(time.RFC3339)
809809
}
810810

811+
var tiers []*models.TenantTierElement
812+
813+
for _, tier := range tenant.Status.Usage.Tiers {
814+
tierItem := &models.TenantTierElement{
815+
Name: tier.Name,
816+
Type: tier.Type,
817+
Size: tier.TotalSize,
818+
}
819+
820+
tiers = append(tiers, tierItem)
821+
}
822+
811823
tenants = append(tenants, &models.TenantList{
812824
CreationDate: tenant.ObjectMeta.CreationTimestamp.Format(time.RFC3339),
813825
DeletionDate: deletion,
@@ -823,6 +835,7 @@ func listTenants(ctx context.Context, operatorClient OperatorClientI, namespace
823835
CapacityRawUsage: tenant.Status.Usage.RawUsage,
824836
Capacity: tenant.Status.Usage.Capacity,
825837
CapacityUsage: tenant.Status.Usage.Usage,
838+
Tiers: tiers,
826839
})
827840
}
828841

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// This file is part of MinIO Console Server
2+
// Copyright (c) 2022 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 * as React from "react";
18+
import { SVGProps } from "react";
19+
20+
const EditTenantIcon = (props: SVGProps<SVGSVGElement>) => (
21+
<svg
22+
xmlns="http://www.w3.org/2000/svg"
23+
className={`min-icon`}
24+
fill={"currentcolor"}
25+
viewBox="0 0 256 256"
26+
{...props}
27+
>
28+
<g transform="translate(0 -0.853)">
29+
<path d="M89.25,173.48c-2.67-.25-5.25-1.12-7.54-2.52-2.52-2.16-3.51-5.62-2.52-8.78l7.55-35.2L204.84,8.87C210.17,4.17,216.73,1.09,223.76,0c7.06-.19,13.88,2.53,18.86,7.54,10.33,11.14,9.77,28.52-1.26,38.97l-116.9,118.1-33.94,7.55-1.26,1.25v.07Zm12.58-37.71l-5.04,20.12,20.13-5.03L231.28,36.46c4.78-4.21,5.34-11.46,1.26-16.35-2.52-2.52-5.03-3.77-7.54-2.52-3.34-.09-6.56,1.3-8.8,3.78l-114.39,114.39h.01Z" />
30+
<path d="M179.76,227.54H23.88C10.69,227.54,0,216.84,0,203.65V47.78c0-13.19,10.69-23.88,23.88-23.88H108.1v15.07H23.88c-4.46,.46-7.77,4.34-7.54,8.81V203.65c-.24,4.47,3.08,8.34,7.54,8.8H179.76c4.75,.12,8.69-3.63,8.81-8.38,0-.14,0-.28,0-.42v-49.03h16.33v49.03c-1.03,13.25-11.92,23.57-25.21,23.88h.07Z" />
31+
</g>
32+
</svg>
33+
);
34+
35+
export default EditTenantIcon;

portal-ui/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,4 @@ export { default as SelectAllIcon } from "./SelectAllIcon";
182182
export { default as BackIcon } from "./BackIcon";
183183
export { default as DeleteNonCurrentIcon } from "./DeleteNonCurrentIcon";
184184
export { default as FilterIcon } from "./FilterIcon";
185+
export { default as EditTenantIcon } from "./EditTenantIcon";

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ const IconsScreen = ({ classes }: IIconsScreenSimple) => {
403403
EditIcon
404404
</Grid>
405405

406+
<Grid item xs={3} sm={2} md={1}>
407+
<cicons.EditTenantIcon />
408+
<br />
409+
EditTenantIcon
410+
</Grid>
411+
406412
<Grid item xs={3} sm={2} md={1}>
407413
<cicons.EditYamlIcon />
408414
<br />
@@ -1075,7 +1081,8 @@ const IconsScreen = ({ classes }: IIconsScreenSimple) => {
10751081
WatchIcon
10761082
</Grid>
10771083
<Grid item xs={3} sm={2} md={1}>
1078-
<cicons.AlertCloseIcon /> <br />
1084+
<cicons.AlertCloseIcon />
1085+
<br />
10791086
AlertCloseIcon
10801087
</Grid>
10811088
<Grid item xs={3} sm={2} md={1}>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// This file is part of MinIO Console Server
2+
// Copyright (c) 2022 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, { Fragment } from "react";
18+
19+
interface IInformationItemProps {
20+
label: string;
21+
value: string;
22+
unit?: string;
23+
}
24+
25+
const InformationItem = ({ label, value, unit }: IInformationItemProps) => {
26+
return (
27+
<div style={{ margin: "0px 20px" }}>
28+
<div style={{ textAlign: "center" }}>
29+
<span style={{ fontSize: 18, color: "#000", fontWeight: 400 }}>
30+
{value}
31+
</span>
32+
{unit && (
33+
<Fragment>
34+
{" "}
35+
<span
36+
style={{ fontSize: 12, color: "#8F9090", fontWeight: "bold" }}
37+
>
38+
{unit}
39+
</span>
40+
</Fragment>
41+
)}
42+
</div>
43+
<div
44+
style={{
45+
textAlign: "center",
46+
color: "#767676",
47+
fontSize: 12,
48+
whiteSpace: "nowrap",
49+
}}
50+
>
51+
{label}
52+
</div>
53+
</div>
54+
);
55+
};
56+
57+
export default InformationItem;

0 commit comments

Comments
 (0)