-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathDashboardPage.tsx
More file actions
106 lines (98 loc) · 2.84 KB
/
DashboardPage.tsx
File metadata and controls
106 lines (98 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import React from 'react';
import { AppContainer, Wrap, spacing } from '@scality/core-ui';
import { SyncedCursorCharts } from '@scality/core-ui/dist/components/vegachartv2/SyncedCursorCharts';
import styled from 'styled-components';
import DashboardMetrics from '../components/DashboardMetrics';
import DashboardInventory from '../components/DashboardInventory';
import DashboardServices from '../components/DashboardServices';
import DashboardGlobalHealth from '../components/DashboardGlobalHealth';
import TimespanSelector from './TimespanSelector';
import DashboardNetwork from '../components/DashboardNetwork';
const DashboardGrid = styled.div`
display: grid;
gap: ${AppContainer.sectionDistance};
grid-template:
'inventory network network metrics metrics' auto
/ 1fr 1fr 1fr 1fr 1fr;
overflow: hidden;
flex: 1;
> div {
background-color: ${(props) => {
return props.theme.backgroundLevel3;
}};
color: ${(props) => props.theme.textPrimary};
padding: 2px ${spacing.r4};
.sc-vegachart svg {
background-color: inherit !important;
}
}
.inventory {
grid-area: inventory;
padding: ${spacing.r8} ${spacing.r12};
}
.alerts {
grid-area: alerts;
}
.services {
grid-area: services;
}
.network {
grid-area: network;
display: flex;
}
.metrics {
grid-area: metrics;
display: flex;
flex-direction: column;
// Needed to avoid dynamically sized charts to expand infinitely on refresh
// more info here: https://www.w3.org/TR/css3-grid-layout/#min-size-auto
min-width: 0;
min-height: 0;
}
`;
export const DashboardScrollableArea = styled.div`
overflow-y: auto;
overflow-x: hidden;
`;
const SelectorPositioning = styled.div`
.sc-dropdown {
position: absolute;
right: 1rem;
}
`;
const DashboardPage = () => {
return (
<>
<AppContainer.ContextContainer>
<Wrap>
<p></p>
<SelectorPositioning>
<TimespanSelector />
</SelectorPositioning>
</Wrap>
</AppContainer.ContextContainer>
<SyncedCursorCharts>
<>
<AppContainer.OverallSummary>
<DashboardGlobalHealth />
</AppContainer.OverallSummary>
<AppContainer.MainContent background="backgroundLevel1">
<DashboardGrid>
<DashboardScrollableArea className="inventory">
<DashboardInventory />
<DashboardServices />
</DashboardScrollableArea>
<DashboardScrollableArea className="network">
<DashboardNetwork />
</DashboardScrollableArea>
<div className="metrics">
<DashboardMetrics />
</div>
</DashboardGrid>
</AppContainer.MainContent>
</>
</SyncedCursorCharts>
</>
);
};
export default DashboardPage;