Skip to content

Commit 45bf399

Browse files
committed
fix: show buttons
1 parent bed0fa5 commit 45bf399

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

admin-ui/app/routes/Dashboards/DashboardPage.js

+46
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import moment from 'moment'
44
import CustomBarGraph from './Grapths/CustomBarGraph'
55
import CustomLineChart from './Grapths/CustomLineChart'
66
import CustomBadgeRow from './Grapths/CustomBadgeRow'
7+
import DatePicker from 'react-datepicker'
78
import 'react-datepicker/dist/react-datepicker.css'
89
import GluuLoader from '../Apps/Gluu/GluuLoader'
910
import GluuViewWrapper from '../Apps/Gluu/GluuViewWrapper'
1011
import { getMau } from '../../redux/actions/MauActions'
1112
import { getClients } from '../../redux/actions/InitActions'
1213
import applicationstyle from '../Apps/Gluu/styles/applicationstyle'
14+
import GluuLabel from '../Apps/Gluu/GluuLabel'
1315
import GluuRibbon from '../Apps/Gluu/GluuRibbon'
1416
import {
1517
Button,
@@ -18,6 +20,7 @@ import {
1820
CardBody,
1921
FormGroup,
2022
Col,
23+
Row,
2124
} from '../../../app/components'
2225
import {
2326
hasBoth,
@@ -147,6 +150,49 @@ function DashboardPage({ statData, permissions, clients, loading, dispatch }) {
147150
<FormGroup row />
148151
<FormGroup row />
149152
<CardBody>
153+
<Row>
154+
<Col sm={2}></Col>
155+
<Col sm={10}>
156+
<GluuLabel label="Select a date range" size="4" />
157+
<DatePicker
158+
selected={startDate}
159+
onChange={(date) => setStartDate(date)}
160+
selectsStart
161+
isClearable
162+
startDate={startDate}
163+
dateFormat="MM/yyyy"
164+
showMonthYearPicker
165+
endDate={endDate}
166+
customInput={<CustomButton />}
167+
/>
168+
&nbsp;&nbsp;
169+
<DatePicker
170+
selected={endDate}
171+
onChange={(date) => setEndDate(date)}
172+
selectsEnd
173+
isClearable
174+
startDate={startDate}
175+
endDate={endDate}
176+
dateFormat="MM/yyyy"
177+
showMonthYearPicker
178+
minDate={startDate}
179+
maxDate={new Date()}
180+
customInput={<CustomButton />}
181+
/>
182+
&nbsp;&nbsp;
183+
<Button
184+
style={applicationstyle.customButtonStyle}
185+
color="primary"
186+
onClick={search}
187+
>
188+
<i className="fa fa-search mr-2"></i>
189+
{t('actions.view')}
190+
</Button>
191+
</Col>
192+
</Row>
193+
<FormGroup row />
194+
<FormGroup row />
195+
150196
<FormGroup row>
151197
<Col sm={6}>
152198
<CustomBarGraph data={statData} />

admin-ui/plugins/admin/components/MAU/MauGraph.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ function MauGraph({ statData, permissions, clients, loading, dispatch }) {
6262
if (stat && stat.length >= 1) {
6363
let flattendStat = stat.map((entry) => entry['month'])
6464
let aRange = generateDateRange(moment(startDate), moment(endDate))
65+
console.log(moment(startDate).format())
66+
console.log(moment(endDate).format())
6567
for (const ele of aRange) {
6668
const currentMonth = getYearMonth(new Date(ele))
6769
if (flattendStat.indexOf(parseInt(currentMonth, 10)) === -1) {
@@ -175,16 +177,9 @@ function MauGraph({ statData, permissions, clients, loading, dispatch }) {
175177
<FormGroup row />
176178
<FormGroup row />
177179
<FormGroup row>
178-
<Col sm={6}>
180+
<Col sm={12}>
179181
<ActiveUsersGraph data={doDataAugmentation(statData)} />
180182
</Col>
181-
<Col sm={6}>
182-
<CustomPieGraph
183-
data={statData.filter((entry) => entry.mau !== 0)}
184-
dataKey="mau"
185-
nameKey="month"
186-
/>
187-
</Col>
188183
</FormGroup>
189184
</CardBody>
190185
<CardFooter className="p-4 bt-0"></CardFooter>

0 commit comments

Comments
 (0)