1+ import { EyeIcon , DocumentTextIcon } from "@heroicons/react/24/outline" ;
2+ import { Layout as DashboardLayout } from "/src/layouts/index.js" ;
3+ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx" ;
4+ import { useSettings } from "/src/hooks/use-settings" ;
5+ import { CheckCircle , Error , Warning , Refresh } from "@mui/icons-material" ;
6+
7+ const Page = ( ) => {
8+ const pageTitle = "Autopilot Deployments" ;
9+ const tenantFilter = useSettings ( ) . currentTenant ;
10+
11+ // Actions for viewing device in Intune and deployment details
12+ const actions = [
13+ {
14+ label : "View Device in Intune" ,
15+ link : `https://intune.microsoft.com/${ tenantFilter } /#view/Microsoft_Intune_Devices/DeviceSettingsMenuBlade/~/overview/mdmDeviceId/[deviceId]` ,
16+ color : "info" ,
17+ icon : < EyeIcon /> ,
18+ target : "_blank" ,
19+ multiPost : false ,
20+ external : true ,
21+ } ,
22+ {
23+ label : "View Deployment Details" ,
24+ link : `https://intune.microsoft.com/${ tenantFilter } /#view/Microsoft_Intune_DeviceSettings/DeploymentOverviewMenuBlade/~/autopilotDeployment/deploymentProfileId/[windowsAutopilotDeploymentProfileDisplayName]` ,
25+ color : "info" ,
26+ icon : < DocumentTextIcon /> ,
27+ target : "_blank" ,
28+ multiPost : false ,
29+ external : true ,
30+ } ,
31+ ] ;
32+
33+ // Extended info fields for the off-canvas panel
34+ const offCanvas = {
35+ extendedInfoFields : [
36+ "id" ,
37+ "deviceId" ,
38+ "userId" ,
39+ "eventDateTime" ,
40+ "deviceRegisteredDateTime" ,
41+ "enrollmentStartDateTime" ,
42+ "enrollmentType" ,
43+ "deviceSerialNumber" ,
44+ "managedDeviceName" ,
45+ "userPrincipalName" ,
46+ "windowsAutopilotDeploymentProfileDisplayName" ,
47+ "enrollmentState" ,
48+ "windows10EnrollmentCompletionPageConfigurationDisplayName" ,
49+ "deploymentState" ,
50+ "deviceSetupStatus" ,
51+ "accountSetupStatus" ,
52+ "osVersion" ,
53+ "deploymentDuration" ,
54+ "deploymentTotalDuration" ,
55+ "deviceSetupDuration" ,
56+ "accountSetupDuration" ,
57+ "deploymentStartDateTime" ,
58+ "deploymentEndDateTime" ,
59+ "enrollmentFailureDetails" ,
60+ ] ,
61+ actions : actions ,
62+ } ;
63+
64+ // Columns to be displayed in the table (most important first)
65+ const simpleColumns = [
66+ "managedDeviceName" ,
67+ "eventDateTime" ,
68+ "deviceSerialNumber" ,
69+ "userPrincipalName" ,
70+ "deploymentState" ,
71+ "enrollmentState" ,
72+ "enrollmentType" ,
73+ "deploymentTotalDuration" ,
74+ "windowsAutopilotDeploymentProfileDisplayName" ,
75+ "enrollmentFailureDetails" ,
76+ ] ;
77+
78+ // Predefined filters for common deployment scenarios
79+ const filterList = [
80+ {
81+ filterName : "Failed Deployments" ,
82+ value : [ { id : "deploymentState" , value : "failed" } ] ,
83+ type : "column" ,
84+ } ,
85+ {
86+ filterName : "Successful Deployments" ,
87+ value : [ { id : "deploymentState" , value : "success" } ] ,
88+ type : "column" ,
89+ } ,
90+ ] ;
91+
92+ return (
93+ < CippTablePage
94+ title = { pageTitle }
95+ apiUrl = "/api/ListGraphRequest"
96+ apiData = { {
97+ endpoint : "deviceManagement/autopilotEvents" ,
98+ $orderBy : "enrollmentStartDateTime desc" ,
99+ $top : 999 ,
100+ } }
101+ apiDataKey = "Results"
102+ actions = { actions }
103+ offCanvas = { offCanvas }
104+ simpleColumns = { simpleColumns }
105+ filters = { filterList }
106+ />
107+ ) ;
108+ } ;
109+
110+ Page . getLayout = ( page ) => < DashboardLayout > { page } </ DashboardLayout > ;
111+
112+ export default Page ;
0 commit comments