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: Azure AD Device List + Version Number Add #106

Merged
merged 1 commit into from
Oct 22, 2021
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
90 changes: 90 additions & 0 deletions DeviceList.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<main>
<header class="page-header page-header-compact page-header-light border-bottom bg-white mb-4">
<div class="container-fluid px-4">
<div class="page-header-content">
<div class="row align-items-center justify-content-between pt-3">
<div class="col-auto mb-3">
<h1 class="page-header-title">
<div class="page-header-icon"><i data-feather="user"></i></div>
Azure AD Device List
</h1>
</div>
<div class="col-12 col-xl-auto mb-3">
<a class="btn btn-sm btn-light text-primary" href="index.html?page=users.html">
<i class="me-1" data-feather="users"></i>
Manage Users
</a>
<a class="btn btn-sm btn-light text-primary" href="index.html?page=users.html">
<i class="me-1" data-feather="user-plus"></i>
Manage Groups
</a>
</div>
</div>
</div>
</div>
</header>
<!-- Main page content-->
<div class="container-fluid px-4">
<div><label for="exampleDataList" class="form-label">Tenant Selector</label>
<input class="form-control" list="datalistOptions" id="exampleDataList" placeholder="Type to search..."
style="width: 50%;" oninput='onInput()'>
<datalist id="datalistOptions">
<option value="Select a tenant" text="Select a tenant">
</datalist>
</div><br>
<div class="card">
<div class="card-header">Azure AD Device List</div>
<div class="card-body">
<table id="datatablesSimple">
<table cellpadding="0" cellspacing="0" class="datatable-1 table table-striped" width="100%">
<thead>
<tr>
<th>Display Name</th>
<th>Enabled</th>
<th>Compliant</th>
<th>Manufacturer</th>
<th>Model</th>
<th>Operating System</th>
<th>Operating System Version</th>
<th>Created</th>
<th>Approx Last SignIn</th>
<th>Ownership</th>
<th>Enrollment Type</th>
<th>Management Type</th>
<th>On-Premises Sync Enabled</th>
<th>Trust Type</th>
</tr>
</thead>
<tbody id='AccountTable'>
</tbody>
<tfoot>
<tr>
<th>Display Name</th>
<th>Enabled</th>
<th>Compliant</th>
<th>Manufacturer</th>
<th>Model</th>
<th>Operating System</th>
<th>Operating System Version</th>
<th>Created</th>
<th>Approx Last SignIn</th>
<th>Ownership</th>
<th>Enrollment Type</th>
<th>Management Type</th>
<th>On-Premises Sync Enabled</th>
<th>Trust Type</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</main>
<script src="js/datatables/jquery.dataTables.js"></script>
<script src="js/tenantlist.js"></script>
<script src="js/datatables/datatablesDevices.js"></script>

</body>


</html>
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ <h6 class="dropdown-header d-flex align-items-center">
<section class="SpecialNavLink">
<div class="collapse" id="collapseIDReports" data-bs-parent="#accordionSidenav">
<nav class="sidenav-menu-nested nav accordion" id="accordionSidenavPages">
<a class="nav-link" href="devicelist">Devices</a>
<a class="nav-link" href="MFAReport">MFA Report</a>
<a class="nav-link" href="BasicAuth">Basic Auth Report</a>

Expand Down
105 changes: 105 additions & 0 deletions js/datatables/datatablesDevices.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
$(document).ready(function () {
let searchParams = new URLSearchParams(window.location.search)
var TenantID = '';
if (searchParams.has('Tenantfilter')) {
TenantID = searchParams.get('Tenantfilter')
}

var todayDate = new Date().toISOString().slice(0, 10);
if (TenantID !== '') {
$('.datatable-1').dataTable(
{
language: {
paginate: {
next: '<i class="fas fa-arrow-right"></i>',
previous: '<i class="fas fa-arrow-left"></i>'
}
},
"columnDefs": [
{ "className": "dt-center", "targets": [-1] },

],
"deferRender": true,
"pageLength": 25,
responsive: true,
"ajax": {

"url": "/api/ListDevices?Tenantfilter=" + TenantID,
"dataSrc": ""
},
dom: 'fBlrtip',
"columns": [
{ "data": "displayName" },
{
"data": "accountEnabled",
"render": function (data, type, row) {
if (type === "export" || type === "sort" || type === "filter") {
return data;
}
if (data === true) {
return '<i class="fas fa-check-circle text-success fa-2x"></i>';
} else {
return '<i class="fas fa-times-circle text-danger fa-2x"></i></a>';
}
}
},
{
"data": "isCompliant",
"render": function (data, type, row) {
if (type === "export" || type === "sort" || type === "filter") {
return data;
}
if (data === true) {
return '<i class="fas fa-check-circle text-success fa-2x"></i>';
} else {
return '<i class="fas fa-times-circle text-danger fa-2x"></i></a>';
}
}
},
{ "data": "manufacturer" },
{ "data": "model" },
{ "data": "operatingSystem" },
{ "data": "operatingSystemVersion" },
{ "data": "createdDateTime" },
{ "data": "approximateLastSignInDateTime" },
{ "data": "deviceOwnership" },
{ "data": "enrollmentType" },
{ "data": "managementType" },
{
"data": "onPremisesSyncEnabled",
"render": function (data, type, row) {
if (type === "export" || type === "sort" || type === "filter") {
return data;
}
if (data === true) {
return '<i class="fas fa-check-circle text-success fa-2x"></i>';
} else {
return '<i class="fas fa-times-circle text-danger fa-2x"></i></a>';
}
}
},
{ "data": "trustType" }
],
'columnDefs': [
{
"targets": [1, 2, 3, 4, 5, 9, 11, 12, 13], // your case first column
"className": "text-center"
}
],
buttons: [
{ extend: 'copyHtml5', className: 'btn btn-primary btn-sm' },
{ extend: 'excelHtml5', className: 'btn btn-primary btn-sm', title: 'Device List - ' + TenantID + " - " + todayDate, exportOptions: {orthogonal: "export"} },
{ extend: 'csvHtml5', className: 'btn btn-primary btn-sm', title: 'Device List - ' + TenantID + " - " + todayDate, exportOptions: {orthogonal: "export"} },
{ extend: 'pdfHtml5', className: 'btn btn-primary btn-sm', pageSize: 'A2', orientation: 'landscape', title: 'Device List - ' + TenantID + " - " + todayDate, exportOptions: { columns: [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], orthogonal: "export" } },
],
"order": [[0, "asc"]],
}
);
}
else {
$("#AccountTable").append("<tr><td colspan='8'>Select a Tenant to get started.</td></tr>")
}

$('.dataTables_paginate').addClass("btn-group datatable-pagination");
$('.dataTables_paginate > a').wrapInner('<span />');
});
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.4
1.1.5