forked from community/device-mgt-core
parent
c1bb3afc1f
commit
a5971e9d11
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
@ -1,267 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import axios from 'axios';
|
||||
import { Icon, message, notification, Table, Tag, Tooltip } from 'antd';
|
||||
import TimeAgo from 'javascript-time-ago';
|
||||
// Load locale-specific relative date/time formatting rules.
|
||||
import en from 'javascript-time-ago/locale/en';
|
||||
import { withConfigContext } from '../../context/ConfigContext';
|
||||
|
||||
let config = null;
|
||||
let apiUrl;
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Device',
|
||||
dataIndex: 'name',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: 'Type',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
// eslint-disable-next-line react/display-name
|
||||
render: type => {
|
||||
const defaultPlatformIcons = config.defaultPlatformIcons;
|
||||
let icon = defaultPlatformIcons.default.icon;
|
||||
let color = defaultPlatformIcons.default.color;
|
||||
let theme = defaultPlatformIcons.default.theme;
|
||||
|
||||
if (defaultPlatformIcons.hasOwnProperty(type)) {
|
||||
icon = defaultPlatformIcons[type].icon;
|
||||
color = defaultPlatformIcons[type].color;
|
||||
theme = defaultPlatformIcons[type].theme;
|
||||
}
|
||||
|
||||
return (
|
||||
<span style={{ fontSize: 20, color: color, textAlign: 'center' }}>
|
||||
<Icon type={icon} theme={theme} />
|
||||
</span>
|
||||
);
|
||||
},
|
||||
// todo add filtering options
|
||||
},
|
||||
{
|
||||
title: 'Owner',
|
||||
dataIndex: 'enrolmentInfo',
|
||||
key: 'owner',
|
||||
render: enrolmentInfo => enrolmentInfo.owner,
|
||||
// todo add filtering options
|
||||
},
|
||||
{
|
||||
title: 'Ownership',
|
||||
dataIndex: 'enrolmentInfo',
|
||||
key: 'ownership',
|
||||
render: enrolmentInfo => enrolmentInfo.ownership,
|
||||
// todo add filtering options
|
||||
},
|
||||
{
|
||||
title: 'Status',
|
||||
dataIndex: 'enrolmentInfo',
|
||||
key: 'status',
|
||||
// eslint-disable-next-line react/display-name
|
||||
render: enrolmentInfo => {
|
||||
const status = enrolmentInfo.status.toLowerCase();
|
||||
let color = '#f9ca24';
|
||||
switch (status) {
|
||||
case 'active':
|
||||
color = '#badc58';
|
||||
break;
|
||||
case 'created':
|
||||
color = '#6ab04c';
|
||||
break;
|
||||
case 'removed':
|
||||
color = '#ff7979';
|
||||
break;
|
||||
case 'inactive':
|
||||
color = '#f9ca24';
|
||||
break;
|
||||
case 'blocked':
|
||||
color = '#636e72';
|
||||
break;
|
||||
}
|
||||
return <Tag color={color}>{status}</Tag>;
|
||||
},
|
||||
// todo add filtering options
|
||||
},
|
||||
{
|
||||
title: 'Last Updated',
|
||||
dataIndex: 'enrolmentInfo',
|
||||
key: 'dateOfLastUpdate',
|
||||
// eslint-disable-next-line react/display-name
|
||||
render: data => {
|
||||
const { dateOfLastUpdate } = data;
|
||||
const timeAgoString = getTimeAgo(dateOfLastUpdate);
|
||||
return (
|
||||
<Tooltip title={new Date(dateOfLastUpdate).toString()}>
|
||||
{timeAgoString}
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
// todo add filtering options
|
||||
},
|
||||
];
|
||||
|
||||
const getTimeAgo = time => {
|
||||
const timeAgo = new TimeAgo('en-US');
|
||||
return timeAgo.format(time);
|
||||
};
|
||||
|
||||
class ReportDeviceTable extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
config = this.props.context;
|
||||
TimeAgo.addLocale(en);
|
||||
this.state = {
|
||||
data: [],
|
||||
pagination: {},
|
||||
loading: false,
|
||||
selectedRows: [],
|
||||
paramsObj: {},
|
||||
};
|
||||
}
|
||||
|
||||
rowSelection = {
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
this.setState({
|
||||
selectedRows: selectedRows,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.fetch();
|
||||
}
|
||||
|
||||
// Rerender component when parameters change
|
||||
componentDidUpdate(prevProps, prevState, snapshot) {
|
||||
if (prevProps.paramsObject !== this.props.paramsObject) {
|
||||
this.fetch();
|
||||
}
|
||||
}
|
||||
|
||||
// fetch data from api
|
||||
fetch = (params = {}) => {
|
||||
const config = this.props.context;
|
||||
this.setState({ loading: true });
|
||||
// get current page
|
||||
const currentPage = params.hasOwnProperty('page') ? params.page : 1;
|
||||
|
||||
this.props.paramsObject.offset = 10 * (currentPage - 1); // calculate the offset
|
||||
this.props.paramsObject.limit = 10;
|
||||
|
||||
const encodedExtraParams = Object.keys(this.props.paramsObject)
|
||||
.map(key => key + '=' + this.props.paramsObject[key])
|
||||
.join('&');
|
||||
|
||||
if (
|
||||
this.props.paramsObject.from == null &&
|
||||
this.props.paramsObject.to == null
|
||||
) {
|
||||
apiUrl =
|
||||
window.location.origin +
|
||||
config.serverConfig.invoker.uri +
|
||||
config.serverConfig.invoker.deviceMgt +
|
||||
'/devices?' +
|
||||
encodedExtraParams;
|
||||
} else {
|
||||
apiUrl =
|
||||
window.location.origin +
|
||||
config.serverConfig.invoker.uri +
|
||||
config.serverConfig.invoker.deviceMgt +
|
||||
'/reports/devices?' +
|
||||
encodedExtraParams;
|
||||
}
|
||||
|
||||
// send request to the invokerss
|
||||
axios
|
||||
.get(apiUrl)
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
const pagination = { ...this.state.pagination };
|
||||
this.setState({
|
||||
loading: false,
|
||||
data: res.data.data.devices,
|
||||
pagination,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.hasOwnProperty('response') && error.response.status === 401) {
|
||||
// todo display a popop with error
|
||||
message.error('You are not logged in');
|
||||
window.location.href = window.location.origin + '/entgra/login';
|
||||
} else {
|
||||
notification.error({
|
||||
message: 'There was a problem',
|
||||
duration: 0,
|
||||
description: 'Error occurred while trying to load devices.',
|
||||
});
|
||||
}
|
||||
|
||||
this.setState({ loading: false });
|
||||
});
|
||||
};
|
||||
|
||||
handleTableChange = (pagination, filters, sorter) => {
|
||||
const pager = { ...this.state.pagination };
|
||||
pager.current = pagination.current;
|
||||
this.setState({
|
||||
pagination: pager,
|
||||
});
|
||||
this.fetch({
|
||||
results: pagination.pageSize,
|
||||
page: pagination.current,
|
||||
sortField: sorter.field,
|
||||
sortOrder: sorter.order,
|
||||
...filters,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { data, pagination, loading } = this.state;
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
columns={columns}
|
||||
rowKey={record =>
|
||||
record.deviceIdentifier +
|
||||
record.enrolmentInfo.owner +
|
||||
record.enrolmentInfo.ownership
|
||||
}
|
||||
dataSource={data}
|
||||
pagination={{
|
||||
...pagination,
|
||||
size: 'small',
|
||||
// position: "top",
|
||||
showTotal: (total, range) =>
|
||||
`showing ${range[0]}-${range[1]} of ${total} devices`,
|
||||
// showQuickJumper: true
|
||||
}}
|
||||
loading={loading}
|
||||
onChange={this.handleTableChange}
|
||||
rowSelection={this.rowSelection}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withConfigContext(ReportDeviceTable);
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Select } from 'antd';
|
||||
|
||||
class Filter extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedItem: null,
|
||||
};
|
||||
}
|
||||
|
||||
// Send updated filter value to Reports.js
|
||||
onChange = value => {
|
||||
this.setState({ selectedItem: value }, () => {
|
||||
if (this.props.dropDownName == 'Device Status') {
|
||||
this.props.updateFiltersValue(this.state.selectedItem, 'Device Status');
|
||||
} else {
|
||||
this.props.updateFiltersValue(
|
||||
this.state.selectedItem,
|
||||
'Device Ownership',
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
// Dynamically generate dropdown items from dropDownItems array
|
||||
let item = this.props.dropDownItems.map(data => (
|
||||
<Select.Option value={data} key={data}>
|
||||
{data}
|
||||
</Select.Option>
|
||||
));
|
||||
return (
|
||||
<Select
|
||||
showSearch
|
||||
style={{ width: 200 }}
|
||||
placeholder={this.props.dropDownName}
|
||||
optionFilterProp="children"
|
||||
onChange={this.onChange}
|
||||
filterOption={(input, option) =>
|
||||
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
>
|
||||
{item}
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Filter;
|
@ -1,45 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Card, Col } from 'antd';
|
||||
|
||||
class CountWidget extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.routes = props.routes;
|
||||
this.state = {
|
||||
statArray: [],
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({ statArray: this.props.statArray });
|
||||
console.log('$$$$');
|
||||
console.log(this.props.statArray);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { statArray } = this.state;
|
||||
|
||||
let card = statArray.map(data => (
|
||||
<Col key={data.item} span={6}>
|
||||
<Card
|
||||
key={data.item}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<h2>
|
||||
<b>{data.item}</b>
|
||||
</h2>
|
||||
<h1>{data.count}</h1>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
));
|
||||
|
||||
return <div>{card}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default CountWidget;
|
@ -1,323 +0,0 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Chart,
|
||||
Geom,
|
||||
Axis,
|
||||
Tooltip,
|
||||
Coord,
|
||||
Label,
|
||||
Legend,
|
||||
Guide,
|
||||
} from 'bizcharts';
|
||||
import DataSet from '@antv/data-set';
|
||||
import axios from 'axios';
|
||||
import { message, notification } from 'antd';
|
||||
import { withConfigContext } from '../../../context/ConfigContext';
|
||||
|
||||
let config = null;
|
||||
|
||||
class PieChart extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
config = this.props.context;
|
||||
this.state = {
|
||||
loading: true,
|
||||
statArray: [],
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { reportData } = this.props;
|
||||
let params = {
|
||||
status: reportData.params[0],
|
||||
from: reportData.duration[0],
|
||||
to: reportData.duration[1],
|
||||
};
|
||||
|
||||
const urlSet = {
|
||||
paramsList: reportData.params,
|
||||
duration: reportData.duration,
|
||||
};
|
||||
|
||||
if (reportData.params[0] === 'Enrollments') {
|
||||
this.getEnrollmentsVsUnenrollmentsCount(params, urlSet);
|
||||
} else if (reportData.params[0] === 'BYOD') {
|
||||
this.getEnrollmentTypeCount(params, urlSet);
|
||||
} else {
|
||||
this.getCount(params, urlSet);
|
||||
}
|
||||
}
|
||||
|
||||
onChartChange = data => {
|
||||
this.props.onClickPieChart(data);
|
||||
};
|
||||
|
||||
statArray = [];
|
||||
|
||||
// Call count APIs and get count for given parameters, then create data object to build pie chart
|
||||
getCount = (params, urlSet) => {
|
||||
this.setState({ loading: true });
|
||||
|
||||
let { statArray } = this.state;
|
||||
|
||||
const urlArray = [];
|
||||
|
||||
urlSet.paramsList.map(data => {
|
||||
const paramsObj = {
|
||||
status: data,
|
||||
from: urlSet.duration[0],
|
||||
to: urlSet.duration[1],
|
||||
};
|
||||
const encodedExtraParams = Object.keys(paramsObj)
|
||||
.map(key => key + '=' + paramsObj[key])
|
||||
.join('&');
|
||||
const apiUrl =
|
||||
window.location.origin +
|
||||
config.serverConfig.invoker.uri +
|
||||
config.serverConfig.invoker.deviceMgt +
|
||||
'/reports/devices/count?' +
|
||||
encodedExtraParams;
|
||||
|
||||
urlArray.push(axios.get(apiUrl, data));
|
||||
});
|
||||
|
||||
axios
|
||||
.all(urlArray)
|
||||
.then(res => {
|
||||
res.map(response => {
|
||||
if (response.status === 200) {
|
||||
let countData = {
|
||||
item: response.config[0],
|
||||
// eslint-disable-next-line radix
|
||||
count: parseInt(response.data.data),
|
||||
};
|
||||
statArray.push(countData);
|
||||
}
|
||||
});
|
||||
this.setState({ statArray });
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.hasOwnProperty('response') && error.response.status === 401) {
|
||||
// todo display a popup with error
|
||||
message.error('You are not logged in');
|
||||
window.location.href = window.location.origin + '/entgra/login';
|
||||
} else {
|
||||
notification.error({
|
||||
message: 'There was a problem',
|
||||
duration: 0,
|
||||
description: 'Error occurred while trying to get device count.',
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Call count APIs and get count for given parameters, then create data object to build pie chart
|
||||
getEnrollmentsVsUnenrollmentsCount = (params, urlSet) => {
|
||||
this.setState({ loading: true });
|
||||
|
||||
let { statArray } = this.state;
|
||||
|
||||
const urlArray = [];
|
||||
|
||||
urlSet.paramsList.map(data => {
|
||||
const paramsObj = {
|
||||
from: urlSet.duration[0],
|
||||
to: urlSet.duration[1],
|
||||
};
|
||||
const encodedExtraParams = Object.keys(paramsObj)
|
||||
.map(key => key + '=' + paramsObj[key])
|
||||
.join('&');
|
||||
|
||||
let apiUrl;
|
||||
if (data === 'Enrollments') {
|
||||
apiUrl =
|
||||
window.location.origin +
|
||||
config.serverConfig.invoker.uri +
|
||||
config.serverConfig.invoker.deviceMgt +
|
||||
'/reports/devices/count?status=ACTIVE&status=INACTIVE&' +
|
||||
encodedExtraParams;
|
||||
} else {
|
||||
apiUrl =
|
||||
window.location.origin +
|
||||
config.serverConfig.invoker.uri +
|
||||
config.serverConfig.invoker.deviceMgt +
|
||||
'/reports/devices/count?status=REMOVED&' +
|
||||
encodedExtraParams;
|
||||
}
|
||||
|
||||
urlArray.push(axios.get(apiUrl, data));
|
||||
});
|
||||
|
||||
axios
|
||||
.all(urlArray)
|
||||
.then(res => {
|
||||
res.map(response => {
|
||||
if (response.status === 200) {
|
||||
let countData = {
|
||||
item: response.config[0],
|
||||
// eslint-disable-next-line radix
|
||||
count: parseInt(response.data.data),
|
||||
};
|
||||
statArray.push(countData);
|
||||
}
|
||||
});
|
||||
this.setState({ statArray });
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.hasOwnProperty('response') && error.response.status === 401) {
|
||||
// todo display a popup with error
|
||||
message.error('You are not logged in');
|
||||
window.location.href = window.location.origin + '/entgra/login';
|
||||
} else {
|
||||
notification.error({
|
||||
message: 'There was a problem',
|
||||
duration: 0,
|
||||
description: 'Error occurred while trying to get device count.',
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Call count APIs and get count for given parameters, then create data object to build pie chart
|
||||
getEnrollmentTypeCount = (params, urlSet) => {
|
||||
this.setState({ loading: true });
|
||||
|
||||
let { statArray } = this.state;
|
||||
|
||||
const urlArray = [];
|
||||
|
||||
urlSet.paramsList.map(data => {
|
||||
const paramsObj = {
|
||||
ownership: data,
|
||||
from: urlSet.duration[0],
|
||||
to: urlSet.duration[1],
|
||||
};
|
||||
const encodedExtraParams = Object.keys(paramsObj)
|
||||
.map(key => key + '=' + paramsObj[key])
|
||||
.join('&');
|
||||
const apiUrl =
|
||||
window.location.origin +
|
||||
config.serverConfig.invoker.uri +
|
||||
config.serverConfig.invoker.deviceMgt +
|
||||
'/reports/devices/count?' +
|
||||
encodedExtraParams;
|
||||
|
||||
urlArray.push(axios.get(apiUrl, data));
|
||||
});
|
||||
|
||||
axios
|
||||
.all(urlArray)
|
||||
.then(res => {
|
||||
res.map(response => {
|
||||
if (response.status === 200) {
|
||||
let countData = {
|
||||
item: response.config[0],
|
||||
// eslint-disable-next-line radix
|
||||
count: parseInt(response.data.data),
|
||||
};
|
||||
statArray.push(countData);
|
||||
}
|
||||
});
|
||||
this.setState({ statArray });
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.hasOwnProperty('response') && error.response.status === 401) {
|
||||
// todo display a popup with error
|
||||
message.error('You are not logged in');
|
||||
window.location.href = window.location.origin + '/entgra/login';
|
||||
} else {
|
||||
notification.error({
|
||||
message: 'There was a problem',
|
||||
duration: 0,
|
||||
description: 'Error occurred while trying to get device count.',
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { DataView } = DataSet;
|
||||
const { Html } = Guide;
|
||||
const { statArray } = this.state;
|
||||
|
||||
const dv = new DataView();
|
||||
dv.source(statArray).transform({
|
||||
type: 'percent',
|
||||
field: 'count',
|
||||
dimension: 'item',
|
||||
as: 'percent',
|
||||
});
|
||||
const cols = {
|
||||
percent: {
|
||||
formatter: val => {
|
||||
val = val * 100 + '%';
|
||||
return val;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Chart
|
||||
height={window.innerHeight / 2}
|
||||
data={dv}
|
||||
scale={cols}
|
||||
padding={[20, 25, 20, 20]}
|
||||
forceFit
|
||||
onPlotClick={this.onChartChange}
|
||||
animate={true}
|
||||
>
|
||||
<Coord type={'theta'} radius={0.75} innerRadius={0.6} />
|
||||
<Axis name="percent" />
|
||||
<Legend
|
||||
position="right"
|
||||
offsetY={-window.innerHeight / 2 + 120}
|
||||
offsetX={-100}
|
||||
/>
|
||||
<Tooltip
|
||||
showTitle={false}
|
||||
itemTpl='<li><span style="background-color:{color};" class="g2-tooltip-marker"></span>{name}: {value}</li>'
|
||||
/>
|
||||
<Guide>
|
||||
<Html
|
||||
position={['50%', '50%']}
|
||||
html='<div style="color:#8c8c8c;font-size:1.16em;text-align: center;width: 10em;">Total<br><span style="color:#262626;font-size:2.5em">200</span>台</div>'
|
||||
alignX="middle"
|
||||
alignY="middle"
|
||||
/>
|
||||
</Guide>
|
||||
<div onClick={this.clicked}>
|
||||
<Geom
|
||||
type="intervalStack"
|
||||
position="percent"
|
||||
color="item"
|
||||
tooltip={[
|
||||
'item*percent',
|
||||
(item, percent) => {
|
||||
percent = percent * 100 + '%';
|
||||
return {
|
||||
name: item,
|
||||
value: percent,
|
||||
};
|
||||
},
|
||||
]}
|
||||
style={{
|
||||
lineWidth: 1,
|
||||
stroke: '#fff',
|
||||
}}
|
||||
>
|
||||
<Label
|
||||
content="percent"
|
||||
formatter={(val, item) => {
|
||||
return item.point.item + ': ' + val;
|
||||
}}
|
||||
/>
|
||||
</Geom>
|
||||
</div>
|
||||
</Chart>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withConfigContext(PieChart);
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
Before Width: | Height: | Size: 2.6 KiB |
@ -1,185 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Icon, Col, Row, Card } from 'antd';
|
||||
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
class PolicyReportHome extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<div style={{ borderRadius: 5 }}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/policy/compliance',
|
||||
data: {
|
||||
name: 'all_policy_compliance_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Policy Compliance Report</b>
|
||||
</h2>
|
||||
<p>Policy compliance details of all enrolled devices</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/enrollments',
|
||||
data: {
|
||||
name: 'enrollments_vs_unenrollments_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Enrollments vs Unenrollments</b>
|
||||
</h2>
|
||||
<p>Details on device enrollments vs unenrollments</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/device-status',
|
||||
data: {
|
||||
name: 'enrollment_status_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Device Status Report</b>
|
||||
</h2>
|
||||
<p>Report based on device status</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/enrollment-type',
|
||||
data: {
|
||||
name: 'enrollemt_type_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Device Type Report</b>
|
||||
</h2>
|
||||
<p>Report for all device types</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/app-not-installed',
|
||||
data: {
|
||||
name: 'app_not_installed_devices_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>App NOT Installed Devices Report</b>
|
||||
</h2>
|
||||
<p>Report for all device types</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PolicyReportHome;
|
@ -1,329 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Icon, Col, Row, Card, PageHeader, Breadcrumb } from 'antd';
|
||||
|
||||
import { Link } from 'react-router-dom';
|
||||
import moment from 'moment';
|
||||
|
||||
class ReportDurationItemList extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
reportParams: ['ACTIVE', 'INACTIVE', 'REMOVED'],
|
||||
enrollmentsVsUnenrollmentsParams: ['Enrollments', 'Unenrollments'],
|
||||
enrollmentTypeParams: ['BYOD', 'COPE'],
|
||||
};
|
||||
}
|
||||
|
||||
// Array for pre defined date durations
|
||||
durationItemArray = [
|
||||
{
|
||||
name: 'Daily Report',
|
||||
description: 'Report of today',
|
||||
duration: [
|
||||
moment().format('YYYY-MM-DD'),
|
||||
moment()
|
||||
.add(1, 'days')
|
||||
.format('YYYY-MM-DD'),
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Weekly Report',
|
||||
description: 'Report of last 7 days',
|
||||
duration: [
|
||||
moment()
|
||||
.subtract(6, 'days')
|
||||
.format('YYYY-MM-DD'),
|
||||
moment()
|
||||
.add(1, 'days')
|
||||
.format('YYYY-MM-DD'),
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Monthly Report',
|
||||
description: 'Report of last month',
|
||||
duration: [
|
||||
moment()
|
||||
.subtract(29, 'days')
|
||||
.format('YYYY-MM-DD'),
|
||||
moment()
|
||||
.add(1, 'days')
|
||||
.format('YYYY-MM-DD'),
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// Map durationItemArray and additional parameters to antd cards
|
||||
mapDurationCards = data => {
|
||||
return this.durationItemArray.map(item => (
|
||||
<Col key={item.name} span={6}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/policy',
|
||||
reportData: {
|
||||
duration: item.duration,
|
||||
data: data,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={item.name}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>{item.name}</b>
|
||||
</h2>
|
||||
<p>{item.description}</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
));
|
||||
};
|
||||
|
||||
itemAllPolicyCompliance = this.durationItemArray.map(data => (
|
||||
<Col key={data.name} span={6}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/policyreport',
|
||||
reportData: {
|
||||
duration: data.duration,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={data.name}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon type="desktop" style={{ fontSize: '25px', color: '#08c' }} />
|
||||
<h2>
|
||||
<b>{data.name}</b>
|
||||
</h2>
|
||||
<p>{data.description}</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
));
|
||||
|
||||
itemPerPolicyCompliance = this.durationItemArray.map(data => (
|
||||
<Col key={data.name} span={6}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/policyreport',
|
||||
reportData: {
|
||||
duration: data.duration,
|
||||
policyId: 6,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={data.name}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon type="desktop" style={{ fontSize: '25px', color: '#08c' }} />
|
||||
<h2>
|
||||
<b>{data.name}</b>
|
||||
</h2>
|
||||
<p>{data.description}</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
));
|
||||
|
||||
render() {
|
||||
const { data } = this.props.location;
|
||||
|
||||
let itemStatus = this.durationItemArray.map(data => (
|
||||
<Col key={data.name} span={6}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/devicestatus',
|
||||
reportData: {
|
||||
duration: data.duration,
|
||||
reportType: data.reportType,
|
||||
params: this.state.reportParams,
|
||||
paramsType: data.paramsType,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={data.name}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>{data.name}</b>
|
||||
</h2>
|
||||
<p>{data.description}</p>
|
||||
{/* <p>{data.duration}</p>*/}
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
));
|
||||
|
||||
let itemEnrollmentsVsUnenrollments = this.durationItemArray.map(data => (
|
||||
<Col key={data.name} span={6}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/enrollmentsvsunenrollments',
|
||||
reportData: {
|
||||
duration: data.duration,
|
||||
reportType: data.reportType,
|
||||
params: this.state.enrollmentsVsUnenrollmentsParams,
|
||||
paramsType: data.paramsType,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={data.name}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>{data.name}</b>
|
||||
</h2>
|
||||
<p>{data.description}</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
));
|
||||
|
||||
let itemEnrollmentType = this.durationItemArray.map(data => (
|
||||
<Col key={data.name} span={6}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/enrollmenttype',
|
||||
reportData: {
|
||||
duration: data.duration,
|
||||
reportType: data.reportType,
|
||||
params: this.state.enrollmentTypeParams,
|
||||
paramsType: data.paramsType,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
key={data.name}
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>{data.name}</b>
|
||||
</h2>
|
||||
<p>{data.description}</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
));
|
||||
|
||||
let cardItem = this.itemAllPolicyCompliance;
|
||||
|
||||
switch (data.name) {
|
||||
case 'all_policy_compliance_report':
|
||||
cardItem = this.itemAllPolicyCompliance;
|
||||
// cardItem = this.mapDurationCards({});
|
||||
break;
|
||||
case 'per_policy_compliance_report':
|
||||
cardItem = this.itemPerPolicyCompliance;
|
||||
// cardItem = this.mapDurationCards({
|
||||
// policyId: 6,
|
||||
// });
|
||||
break;
|
||||
case 'enrollments_vs_unenrollments_report':
|
||||
cardItem = itemEnrollmentsVsUnenrollments;
|
||||
break;
|
||||
case 'enrollment_status_report':
|
||||
cardItem = itemStatus;
|
||||
break;
|
||||
case 'enrollemt_type_report':
|
||||
cardItem = itemEnrollmentType;
|
||||
break;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<PageHeader style={{ paddingTop: 0 }}>
|
||||
<Breadcrumb style={{ paddingBottom: 16 }}>
|
||||
<Breadcrumb.Item>
|
||||
<Link to="/entgra">
|
||||
<Icon type="home" /> Home
|
||||
</Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>Reports</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<div className="wrap">
|
||||
<h3>Reports</h3>
|
||||
<div style={{ borderRadius: 5 }}>
|
||||
<Row gutter={16}>{cardItem}</Row>
|
||||
</div>
|
||||
</div>
|
||||
</PageHeader>
|
||||
<div
|
||||
style={{ background: '#f0f2f5', padding: 24, minHeight: 720 }}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ReportDurationItemList;
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { PageHeader, Breadcrumb, Icon } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import PolicyReportHome from './PolicyReportHome';
|
||||
|
||||
class Reports extends React.Component {
|
||||
routes;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.routes = props.routes;
|
||||
this.state = {
|
||||
paramsObject: {},
|
||||
};
|
||||
}
|
||||
// Get modified value from datepicker and set it to paramsObject
|
||||
updateDurationValue = (modifiedFromDate, modifiedToDate) => {
|
||||
let tempParamObj = this.state.paramsObject;
|
||||
tempParamObj.from = modifiedFromDate;
|
||||
tempParamObj.to = modifiedToDate;
|
||||
this.setState({ paramsObject: tempParamObj });
|
||||
};
|
||||
|
||||
// Get modified value from filters and set it to paramsObject
|
||||
updateFiltersValue = (modifiedValue, filterType) => {
|
||||
let tempParamObj = this.state.paramsObject;
|
||||
if (filterType == 'Device Status') {
|
||||
tempParamObj.status = modifiedValue;
|
||||
if (modifiedValue == 'ALL' && tempParamObj.status) {
|
||||
delete tempParamObj.status;
|
||||
}
|
||||
} else {
|
||||
tempParamObj.ownership = modifiedValue;
|
||||
if (modifiedValue == 'ALL' && tempParamObj.ownership) {
|
||||
delete tempParamObj.ownership;
|
||||
}
|
||||
}
|
||||
this.setState({ paramsObject: tempParamObj });
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<PageHeader style={{ paddingTop: 0 }}>
|
||||
<Breadcrumb style={{ paddingBottom: 16 }}>
|
||||
<Breadcrumb.Item>
|
||||
<Link to="/entgra">
|
||||
<Icon type="home" /> Home
|
||||
</Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>Reports</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<div className="wrap">
|
||||
<h3>Reports</h3>
|
||||
<PolicyReportHome />
|
||||
</div>
|
||||
</PageHeader>
|
||||
<div
|
||||
style={{ background: '#f0f2f5', padding: 24, minHeight: 720 }}
|
||||
></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Reports;
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { PageHeader, Typography, Breadcrumb, Icon } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import AddDevice from '../../../components/Devices/Enroll-Device/AddDevice';
|
||||
import AddDevice from './components/AddDevice';
|
||||
|
||||
const { Paragraph } = Typography;
|
||||
|
@ -0,0 +1,229 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { PageHeader, Breadcrumb, Icon, Row, Col, Card } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
class Reports extends React.Component {
|
||||
routes;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.routes = props.routes;
|
||||
this.state = {
|
||||
paramsObject: {},
|
||||
};
|
||||
}
|
||||
// Get modified value from datepicker and set it to paramsObject
|
||||
updateDurationValue = (modifiedFromDate, modifiedToDate) => {
|
||||
let tempParamObj = this.state.paramsObject;
|
||||
tempParamObj.from = modifiedFromDate;
|
||||
tempParamObj.to = modifiedToDate;
|
||||
this.setState({ paramsObject: tempParamObj });
|
||||
};
|
||||
|
||||
// Get modified value from filters and set it to paramsObject
|
||||
updateFiltersValue = (modifiedValue, filterType) => {
|
||||
let tempParamObj = this.state.paramsObject;
|
||||
if (filterType == 'Device Status') {
|
||||
tempParamObj.status = modifiedValue;
|
||||
if (modifiedValue == 'ALL' && tempParamObj.status) {
|
||||
delete tempParamObj.status;
|
||||
}
|
||||
} else {
|
||||
tempParamObj.ownership = modifiedValue;
|
||||
if (modifiedValue == 'ALL' && tempParamObj.ownership) {
|
||||
delete tempParamObj.ownership;
|
||||
}
|
||||
}
|
||||
this.setState({ paramsObject: tempParamObj });
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<PageHeader style={{ paddingTop: 0 }}>
|
||||
<Breadcrumb style={{ paddingBottom: 16 }}>
|
||||
<Breadcrumb.Item>
|
||||
<Link to="/entgra">
|
||||
<Icon type="home" /> Home
|
||||
</Link>
|
||||
</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>Reports</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
<div className="wrap">
|
||||
<h3>Reports</h3>
|
||||
<div style={{ borderRadius: 5 }}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/policy/compliance',
|
||||
data: {
|
||||
name: 'all_policy_compliance_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Policy Compliance Report</b>
|
||||
</h2>
|
||||
<p>Policy compliance details of all enrolled devices</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/enrollments',
|
||||
data: {
|
||||
name: 'enrollments_vs_unenrollments_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Enrollments vs Unenrollments</b>
|
||||
</h2>
|
||||
<p>Details on device enrollments vs unenrollments</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/device-status',
|
||||
data: {
|
||||
name: 'enrollment_status_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Device Status Report</b>
|
||||
</h2>
|
||||
<p>Report based on device status</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/enrollment-type',
|
||||
data: {
|
||||
name: 'enrollemt_type_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>Device Type Report</b>
|
||||
</h2>
|
||||
<p>Report for all device types</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<Link
|
||||
to={{
|
||||
// Path to respective report page
|
||||
pathname: '/entgra/reports/app-not-installed',
|
||||
data: {
|
||||
name: 'app_not_installed_devices_report',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Card
|
||||
bordered={true}
|
||||
hoverable={true}
|
||||
style={{ borderRadius: 10, marginBottom: 16 }}
|
||||
>
|
||||
<div align="center">
|
||||
<Icon
|
||||
type="desktop"
|
||||
style={{ fontSize: '25px', color: '#08c' }}
|
||||
/>
|
||||
<h2>
|
||||
<b>App NOT Installed Devices Report</b>
|
||||
</h2>
|
||||
<p>Report for all device types</p>
|
||||
</div>
|
||||
</Card>
|
||||
</Link>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
</PageHeader>
|
||||
<div
|
||||
style={{ background: '#f0f2f5', padding: 24, minHeight: 720 }}
|
||||
></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Reports;
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
Loading…
Reference in new issue