Geräte-Tab: Verwaltungsart-Spalte und Autopilot-Zeitstempel

- Neue Spalte "Verwaltung" (Intune vs. Co-Managed) in der Geräteliste,
  abgeleitet aus managementAgent; farbige Badges, sortierbar, im CSV-Export
  und im Detail-Panel.
- Detail-Panel zeigt Autopilot-Daten (Registriert, Profil zugewiesen am,
  letzter Kontakt) per Lookup über die Seriennummer. Ein echtes Importdatum
  liefert Graph nicht; verfügbar sind nur diese Zeitstempel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-14 07:49:14 +02:00
co-authored by Claude Opus 4.8
parent e4efb0ac32
commit dfc1128f31
4 changed files with 64 additions and 5 deletions
+15 -2
View File
@@ -5872,12 +5872,20 @@ const DEV_COL_MAP = {
deviceName: 'DeviceName',
userDisplayName: 'UserDisplayName',
operatingSystem: 'OS',
managementType: 'ManagementType',
complianceState: 'ComplianceState',
lastSyncDateTime: 'LastSync',
enrolledDateTime: 'EnrolledDateTime',
};
const DEV_DATE_COLS = new Set(['LastSync', 'EnrolledDateTime']);
// Verwaltungsart als Badge: Co-Managed (ConfigMgr + Intune) vs. reines Intune.
function devMgmtBadge(type) {
if (type === 'Co-Managed') return '<span class="dev-badge dev-badge-comgmt">Co-Managed</span>';
if (type === 'Intune') return '<span class="dev-badge dev-badge-intune">Intune</span>';
return '<span class="dev-badge dev-badge-unk">—</span>';
}
function devFmtDate(iso) {
if (!iso) return '—';
const d = new Date(iso);
@@ -5941,6 +5949,7 @@ function devRender() {
<td>${escapeHtml(d.DeviceName || '—')}</td>
<td>${escapeHtml(d.UserDisplayName || '—')}</td>
<td>${escapeHtml(d.OS || '—')}</td>
<td>${devMgmtBadge(d.ManagementType)}</td>
<td><span class="dev-badge ${cmpCls}">${escapeHtml(d.ComplianceState || '—')}</span></td>
<td>${sync}</td>
</tr>`;
@@ -6018,12 +6027,16 @@ function devRenderDetail(d) {
['Benutzer', d.UserDisplayName],
['UPN', d.UserPrincipalName],
['OS', d.OS ? `${d.OS} ${d.OSVersion || ''}`.trim() : null],
['Verwaltung', d.ManagementType],
['Compliance', d.ComplianceState],
['Seriennummer', d.SerialNumber],
['IMEI', d.Imei],
['Wi-Fi MAC', d.WiFiMac],
['Speicher', storage],
['Eingeschrieben', enrolled],
['Autopilot', d.InAutopilot ? 'Registriert' : (d.InAutopilot === false ? 'Nicht in Autopilot' : null)],
['Autopilot-Profil zugewiesen', d.AutopilotProfileAssigned ? devFmtDate(d.AutopilotProfileAssigned) : null],
['Autopilot letzter Kontakt', d.AutopilotLastContacted ? devFmtDate(d.AutopilotLastContacted) : null],
['Letzter Sync', sync],
['Join-Typ', d.JoinType],
['Besitzertyp', d.OwnerType],
@@ -6222,12 +6235,12 @@ document.addEventListener('click', e => {
function devExportCsv() {
const items = DevState.filtered || [];
if (items.length === 0) { toast('Keine Geräte zum Exportieren.', 'warn'); return; }
const header = ['DeviceName','UserDisplayName','UserPrincipalName','OS','OSVersion','ComplianceState','SerialNumber','Model','Manufacturer','LastSync','EnrolledDateTime'];
const header = ['DeviceName','UserDisplayName','UserPrincipalName','OS','OSVersion','ManagementType','ComplianceState','SerialNumber','Model','Manufacturer','LastSync','EnrolledDateTime'];
const rows = [header];
for (const d of items) {
rows.push([
d.DeviceName || '', d.UserDisplayName || '', d.UserPrincipalName || '',
d.OS || '', d.OSVersion || '', d.ComplianceState || '',
d.OS || '', d.OSVersion || '', d.ManagementType || '', d.ComplianceState || '',
d.SerialNumber || '', d.Model || '', d.Manufacturer || '',
d.LastSync ? devFmtDate(d.LastSync) : '', d.EnrolledDateTime ? devFmtDate(d.EnrolledDateTime) : '',
]);
+1
View File
@@ -527,6 +527,7 @@
<th class="sortable" data-col="deviceName">Gerät <span class="sort-ico"></span></th>
<th class="sortable" data-col="userDisplayName">Benutzer <span class="sort-ico"></span></th>
<th class="sortable" data-col="operatingSystem">OS <span class="sort-ico"></span></th>
<th class="sortable" data-col="managementType">Verwaltung <span class="sort-ico"></span></th>
<th class="sortable" data-col="complianceState">Compliance <span class="sort-ico"></span></th>
<th class="sortable" data-col="lastSyncDateTime">Letzter Sync <span class="sort-ico"></span></th>
</tr>
+2
View File
@@ -5427,6 +5427,8 @@ body.read-only .app-row {
.dev-badge-ok { background: rgba(74,222,128,.15); color: #4ade80; }
.dev-badge-err { background: rgba(248,113,113,.15); color: #f87171; }
.dev-badge-unk { background: var(--hairline-soft); color: var(--muted); }
.dev-badge-intune { background: rgba(96,165,250,.15); color: #60a5fa; }
.dev-badge-comgmt { background: rgba(251,191,36,.15); color: #fbbf24; }
/* Detail-Panel */
.dev-detail {