Skip to content

Commit 3a16410

Browse files
committed
examples: real-time dashboard example update
1 parent 89ef61e commit 3a16410

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Real-Time Dashboard
2+
3+
A real-time demo dashboard with MongoDB and React. You can follow [this guide](https://real-time-dashboard.cube.dev/) to
4+
learn more about building a real-time dashboard with Cube.js

examples/real-time-dashboard/dashboard-app/src/App.css

+24-5
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ body {
4848
color: #43436B;
4949
font-size: 16px;
5050
height: 32px;
51-
line-height: 1.5;
51+
line-height: 1;
5252
padding: 0 15px;
5353
border: 0.5px solid rgba(67,67,107,0.4);
5454
box-sizing: border-box;
5555
border-radius: 4px;
5656
transition: border-color .25s ease-in-out;
57+
display: flex;
58+
align-items: center;
5759
}
5860

5961
.top-menu a i {
@@ -68,10 +70,6 @@ body {
6870
margin-left: 10px;
6971
}
7072

71-
.top-menu a span {
72-
vertical-align: sub;
73-
}
74-
7573
.top-menu a:hover i {
7674
opacity: 0.6;
7775
}
@@ -84,3 +82,24 @@ body {
8482
.top-menu a i {
8583
margin-right: 5px;
8684
}
85+
86+
@media only screen and (max-width: 600px) {
87+
.ant-layout-header {
88+
height: 100%;
89+
}
90+
91+
.top-menu {
92+
display: block;
93+
}
94+
95+
.top-menu a {
96+
padding: 0;
97+
border: 0;
98+
font-size: 20px;
99+
display: inline;
100+
}
101+
102+
.top-menu a span {
103+
display: none;
104+
}
105+
}

examples/real-time-dashboard/dashboard-app/src/components/Header.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,12 @@ const Header = ({ location }) => {
4444
</Button>
4545
<Divider type="vertical" />
4646
<a href="https://github.com/cube-js/cube.js/tree/master/examples/real-time-dashboard">
47-
<span>
48-
<Icon type="github" />
49-
Github
50-
</span>
47+
<Icon type="github" />
48+
<span>Github</span>
5149
</a>
5250
<a href="https://slack.cube.dev">
53-
<span>
54-
<Icon type="slack" />
55-
Slack
56-
</span>
51+
<Icon type="slack" />
52+
<span>Slack</span>
5753
</a>
5854
</div>
5955
</Layout.Header>

examples/real-time-dashboard/dashboard-app/src/pages/DashboardPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const DashboardItems = [
8181
order: {
8282
"Events.minutesAgo": "desc"
8383
},
84-
limit: 10
84+
limit: 11
8585
},
8686
chartType: "bar"
8787
},

0 commit comments

Comments
 (0)