|
| 1 | +import { EyeIcon } 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 | + |
| 6 | +const Page = () => { |
| 7 | + const pageTitle = "Work from anywhere Report"; |
| 8 | + const tenantFilter = useSettings().currentTenant; |
| 9 | + |
| 10 | + // Actions from the source file |
| 11 | + const actions = [ |
| 12 | + { |
| 13 | + label: "View in Intune", |
| 14 | + link: `https://intune.microsoft.com/${tenantFilter}/#view/Microsoft_Intune_Devices/DeviceSettingsMenuBlade/~/overview/mdmDeviceId/[id]`, |
| 15 | + color: "info", |
| 16 | + icon: <EyeIcon />, |
| 17 | + target: "_blank", |
| 18 | + multiPost: false, |
| 19 | + external: true, |
| 20 | + }, |
| 21 | + ]; |
| 22 | + |
| 23 | + // OffCanvas details based on the source file |
| 24 | + const offCanvas = { |
| 25 | + extendedInfoFields: [ |
| 26 | + "id", |
| 27 | + "deviceName", |
| 28 | + "serialNumber", |
| 29 | + "model", |
| 30 | + "manufacturer", |
| 31 | + "ownership", |
| 32 | + "upgradeEligibility", |
| 33 | + ], |
| 34 | + actions: actions, |
| 35 | + }; |
| 36 | + |
| 37 | + // Columns to be displayed in the table |
| 38 | + const simpleColumns = [ |
| 39 | + "deviceName", |
| 40 | + "serialNumber", |
| 41 | + "model", |
| 42 | + "manufacturer", |
| 43 | + "ownership", |
| 44 | + "managedBy", |
| 45 | + "osVersion", |
| 46 | + "upgradeEligibility", |
| 47 | + "ramCheckFailed", |
| 48 | + "storageCheckFailed", |
| 49 | + "processorCoreCountCheckFailed", |
| 50 | + "processorSpeedCheckFailed", |
| 51 | + "tpmCheckFailed", |
| 52 | + "secureBootCheckFailed", |
| 53 | + "processorFamilyCheckFailed", |
| 54 | + "processor64BitCheckFailed", |
| 55 | + "osCheckFailed", |
| 56 | + ]; |
| 57 | + |
| 58 | + // Predefined filters to be applied to the table |
| 59 | + const filterList = [ |
| 60 | + { |
| 61 | + filterName: "Upgrade not eligible", |
| 62 | + value: [{ id: "upgradeEligibility", value: "notCapable" }], |
| 63 | + type: "column", |
| 64 | + }, |
| 65 | + ]; |
| 66 | + |
| 67 | + return ( |
| 68 | + <CippTablePage |
| 69 | + title={pageTitle} |
| 70 | + apiUrl="/api/ListGraphRequest" |
| 71 | + apiData={{ |
| 72 | + Endpoint: "deviceManagement/userExperienceAnalyticsWorkFromAnywhereMetrics('allDevices')/metricDevices", |
| 73 | + manualPagination: true, |
| 74 | + $top: 999, |
| 75 | + }} |
| 76 | + apiDataKey="Results" |
| 77 | + actions={actions} |
| 78 | + offCanvas={offCanvas} |
| 79 | + simpleColumns={simpleColumns} |
| 80 | + filters={filterList} |
| 81 | + /> |
| 82 | + ); |
| 83 | +}; |
| 84 | + |
| 85 | +Page.getLayout = (page) => <DashboardLayout>{page}</DashboardLayout>; |
| 86 | + |
| 87 | +export default Page; |
0 commit comments