Skip to content

Commit d8d2535

Browse files
author
Benjamin Perez
committed
Updated styles in Prometheus dashboard
Signed-off-by: Benjamin Perez <[email protected]>
1 parent 951a041 commit d8d2535

File tree

17 files changed

+700
-760
lines changed

17 files changed

+700
-760
lines changed

portal-ui/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"@types/react-router": "^5.1.3",
2323
"@types/react-router-dom": "^5.1.2",
2424
"@types/react-virtualized": "^9.21.10",
25-
"@types/recharts": "^1.8.19",
2625
"@types/superagent": "^4.1.12",
2726
"@types/webpack-env": "^1.14.1",
2827
"@types/websocket": "^1.0.0",
@@ -49,7 +48,7 @@
4948
"react-scripts": "4.0.3",
5049
"react-virtualized": "^9.22.2",
5150
"react-window-infinite-loader": "^1.0.5",
52-
"recharts": "^2.0.3",
51+
"recharts": "^2.1.1",
5352
"redux": "^4.0.5",
5453
"redux-thunk": "^2.3.0",
5554
"superagent": "^6.1.0",

portal-ui/src/screens/Console/Common/FormComponents/DateTimePickerWrapper/DateTimePickerWrapper.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ interface IDateTimePicker {
3434
tooltip?: string;
3535
id: string;
3636
disabled?: boolean;
37+
noInputIcon?: boolean;
3738
}
3839

3940
const styles = (theme: Theme) =>
@@ -93,18 +94,27 @@ const DateTimePickerWrapper = ({
9394
required,
9495
id,
9596
disabled = false,
97+
noInputIcon = false,
9698
}: IDateTimePicker) => {
99+
let adornment = {};
100+
101+
if (!noInputIcon) {
102+
adornment = {
103+
startAdornment: (
104+
<InputAdornment position="start">
105+
<ScheduleIcon />
106+
</InputAdornment>
107+
),
108+
};
109+
}
110+
97111
const inputItem = (
98112
<MuiPickersUtilsProvider utils={MomentUtils}>
99113
<DateTimePicker
100114
value={value}
101115
onChange={onChange}
102116
InputProps={{
103-
startAdornment: (
104-
<InputAdornment position="start">
105-
<ScheduleIcon />
106-
</InputAdornment>
107-
),
117+
...adornment,
108118
className: forSearchBlock ? classes.dateSelectorOverride : "",
109119
}}
110120
label=""

portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,17 @@ export const containerForHeader = (bottomSpacing: any) => ({
148148
});
149149

150150
export const actionsTray = {
151+
filterTitle: {
152+
color: "#848484",
153+
fontSize: 13,
154+
alignSelf: "center" as const,
155+
whiteSpace: "nowrap" as const,
156+
"&:not(:first-of-type)": {
157+
marginLeft: 10,
158+
},
159+
},
151160
label: {
152-
color: "#393939",
153-
fontWeight: 600,
161+
color: "#07193E",
154162
fontSize: 13,
155163
alignSelf: "center" as const,
156164
whiteSpace: "nowrap" as const,
@@ -160,6 +168,7 @@ export const actionsTray = {
160168
},
161169
timeContainers: {
162170
height: 40,
171+
maxWidth: 1185,
163172
},
164173
actionsTray: {
165174
display: "flex" as const,
@@ -399,29 +408,29 @@ export const logsCommon = {
399408

400409
export const widgetCommon = {
401410
singleValueContainer: {
402-
position: "relative" as const,
403-
flexGrow: 1,
411+
height: 200,
412+
minWidth: 280,
413+
maxWidth: 1185,
414+
border: "#eef1f4 2px solid",
415+
borderRadius: 10,
404416
width: "100%",
405-
height: "100%",
406-
border: "#EAEAEA 1px solid",
407-
borderRadius: 5,
408-
backgroundColor: "#fff",
417+
padding: 16,
409418
},
410419
titleContainer: {
411-
color: "#393939",
412-
fontWeight: 600,
413-
height: 15,
414-
textAlign: "center" as const,
415-
fontSize: 10,
420+
color: "#404143",
421+
fontSize: 14,
422+
textTransform: "uppercase" as const,
423+
fontWeight: 800,
424+
borderBottom: "#eef1f4 1px solid",
425+
paddingBottom: 14,
426+
marginBottom: 5,
416427
},
417428
contentContainer: {
418-
flexGrow: 2,
419429
justifyContent: "center" as const,
420430
alignItems: "center" as const,
421431
display: "flex" as const,
422-
position: "absolute" as const,
423432
width: "100%",
424-
height: "calc(100% - 15px)",
433+
height: 140,
425434
},
426435
contentContainerWithLabel: {
427436
height: "calc(100% - 25px)",
@@ -445,7 +454,6 @@ export const widgetCommon = {
445454
width: 8,
446455
height: 8,
447456
minWidth: 8,
448-
borderRadius: "100%",
449457
marginRight: 5,
450458
},
451459
legendLabel: {

portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,19 @@ const BasicDashboard = ({ classes, usage }: IDashboardProps) => {
133133
</Grid>
134134
<Grid item xs={12} className={classes.generalStatusCards}>
135135
<CommonCard
136-
avatar={<BucketsIcon />}
137136
title={"All Buckets"}
138137
metricValue={usage ? prettyNumber(usage.buckets) : 0}
139138
/>
140139
<CommonCard
141-
avatar={<ReportedUsageIcon />}
142140
title={"Usage"}
143141
metricValue={usageToRepresent.total}
144142
metricUnit={usageToRepresent.unit}
145143
/>
146144
<CommonCard
147-
avatar={<TotalObjectsIcon />}
148145
title={"Total Objects"}
149146
metricValue={usage ? prettyNumber(usage.objects) : 0}
150147
/>
151148
<CommonCard
152-
avatar={<TotalObjectsIcon />}
153149
title={"Servers"}
154150
metricValue={usage ? prettyNumber(serverArray.length) : 0}
155151
subMessage={{ message: "Total" }}

portal-ui/src/screens/Console/Dashboard/CommonCard.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ import {
2323
makeStyles,
2424
} from "@material-ui/core/styles";
2525
import React, { Fragment } from "react";
26+
import { widgetCommon } from "../Common/FormComponents/common/styleLibrary";
2627

2728
export interface ISubInterface {
2829
message: string;
2930
fontWeight?: "normal" | "bold";
3031
}
3132

3233
interface ICommonCard {
33-
avatar: any;
3434
title: string;
3535
metricValue: any;
3636
metricUnit?: string;
@@ -42,12 +42,10 @@ interface ICommonCard {
4242

4343
const styles = (theme: Theme) =>
4444
createStyles({
45+
...widgetCommon,
4546
cardRoot: {
46-
border: "#eef1f4 2px solid",
47-
borderRadius: 10,
47+
...widgetCommon.singleValueContainer,
4848
maxWidth: 280,
49-
width: "100%",
50-
margin: 10,
5149
},
5250
cardsContainer: {
5351
maxHeight: 440,
@@ -94,23 +92,16 @@ const styles = (theme: Theme) =>
9492
});
9593

9694
const cardSubStyles = makeStyles({
97-
root: { backgroundColor: "#fff" },
95+
root: { backgroundColor: "#fff", padding: 0 },
9896
title: {
99-
color: "#404144",
100-
fontSize: 14,
101-
textTransform: "uppercase",
102-
fontWeight: "bold",
103-
borderBottom: "#eef1f4 1px solid",
104-
paddingBottom: 14,
105-
marginBottom: 5,
97+
...widgetCommon.titleContainer
10698
},
10799
content: {
108100
maxWidth: "100%",
109101
},
110102
});
111103

112104
const CommonCard = ({
113-
avatar,
114105
title,
115106
metricValue,
116107
metricUnit,
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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, { Fragment } from "react";
18+
import CommonCard from "../CommonCard";
19+
20+
interface IMergedWidgets {
21+
title: string;
22+
leftComponent: any;
23+
rightComponent: any;
24+
}
25+
26+
const MergedWidgets = ({
27+
title,
28+
leftComponent,
29+
rightComponent,
30+
}: IMergedWidgets) => {
31+
return (
32+
<Fragment>
33+
<CommonCard
34+
title={title}
35+
metricValue={leftComponent}
36+
rightComponent={rightComponent}
37+
/>
38+
</Fragment>
39+
);
40+
};
41+
42+
export default MergedWidgets;

0 commit comments

Comments
 (0)