Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW FEATURE: Multi-Tenant Device Compliance List #728

Merged
merged 1 commit into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ const _nav = [
name: 'List Alerts',
to: '/security/reports/list-alerts',
},
{
component: CNavItem,
name: 'Device Compliance',
to: '/security/reports/list-device-compliance',
},
],
},
{
Expand Down
8 changes: 8 additions & 0 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const BasicAuthReport = React.lazy(() => import('src/views/identity/reports/Basi
const AzureADConnectReport = React.lazy(() =>
import('src/views/identity/reports/AzureADConnectReport'),
)
const DeviceComplianceReport = React.lazy(() =>
import('src/views/security/reports/ListDeviceComplianceReport'),
)
const BestPracticeAnalyzer = React.lazy(() =>
import('src/views/tenant/standards/BestPracticeAnalyser'),
)
Expand Down Expand Up @@ -310,6 +313,11 @@ const routes = [
path: '/security/reports/list-alerts',
component: SecurityComplianceAlerts,
},
{
name: 'List Device Compliance Report',
path: '/security/reports/list-device-compliance',
component: DeviceComplianceReport,
},
{
name: 'License',
path: '/license',
Expand Down
84 changes: 84 additions & 0 deletions src/views/security/reports/ListDeviceComplianceReport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import React from 'react'
import { useSelector } from 'react-redux'
import { CippPageList } from 'src/components/layout'
import { cellDateFormatter } from 'src/components/tables'
import { StatusIcon } from 'src/components/utilities'
const columns = [
{
name: 'Tenant',
selector: (row) => row['tenantDisplayName'],
sortable: true,
exportSelector: 'tenantDisplayName',
},
{
name: 'Device Name',
selector: (row) => row['managedDeviceName'],
sortable: true,
exportSelector: 'managedDeviceName',
},
{
name: 'Compliant',
selector: (row) => row['complianceStatus'],
sortable: true,
cell: (row, index, column) => {
const cell = column.selector(row)
if (cell === 'Compliant') {
return <StatusIcon type="finalstate" finalState="Pass" />
}
if (cell === 'Noncompliant') {
return <StatusIcon type="finalstate" finalState="Fail" />
}
return <StatusIcon type="finalstate" finalState="Warn" />
},
exportSelector: 'complianceStatus',
},
{
name: 'Ownership',
selector: (row) => row['ownerType'],
sortable: true,
exportSelector: 'ownerType',
},
{
name: 'OS',
selector: (row) => row['osDescription'],
sortable: true,
exportSelector: 'osDescription',
},
{
name: 'Manufacturer',
selector: (row) => row['manufacturer'],
sortable: true,
exportSelector: 'manufacturer',
},
{
name: 'Model',
selector: (row) => row['model'],
sortable: true,
exportSelector: 'model',
},
{
name: 'Last Sync',
selector: (row) => row['lastSyncDateTime'],
sortable: true,
cell: cellDateFormatter(),
exportSelector: 'lastSyncDateTime',
},
]

const LighthouseDeviceComplianceReport = () => {
const tenant = useSelector((state) => state.app.currentTenant)
return (
<CippPageList
title="Lighthouse - Device Compliance"
showAllTenantSelector={true}
datatable={{
columns,
path: '/api/ListAllTenantDeviceCompliance',
reportName: `${tenant?.defaultDomainName}-Lighthouse-Device-Compliance-Report`,
params: { TenantFilter: tenant?.customerId },
}}
/>
)
}

export default LighthouseDeviceComplianceReport