From 6245fc4573909aba43f6c9e1ca95d4dc303bf365 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Wed, 17 Jun 2026 23:47:33 +0200 Subject: [PATCH] fix(magic): real MDM supervised state, mdmId matching, MDM status for unknown USB devices --- .../app/components/IosDeviceCard.vue | 2 +- .../app/components/IosDeviceSection.vue | 1 + .../app/components/UnknownIosDeviceCard.vue | 94 ++++++++++++++++++- .../app/composables/useDeviceStatus.ts | 2 + .../rebreak-magic/app/composables/useTauri.ts | 13 +++ .../src-tauri/src/backend/api.rs | 32 +++++++ apps/rebreak-magic/src-tauri/src/lib.rs | 13 ++- backend/server/api/magic/devices.get.ts | 3 + .../api/magic/devices/[deviceId]/mdm.get.ts | 2 +- backend/server/api/magic/mdm/by-udid.get.ts | 44 +++++++++ backend/server/db/devices.ts | 3 + backend/server/db/mdm.ts | 18 ++-- 12 files changed, 215 insertions(+), 12 deletions(-) create mode 100644 backend/server/api/magic/mdm/by-udid.get.ts diff --git a/apps/rebreak-magic/app/components/IosDeviceCard.vue b/apps/rebreak-magic/app/components/IosDeviceCard.vue index cac9abb..862c15d 100644 --- a/apps/rebreak-magic/app/components/IosDeviceCard.vue +++ b/apps/rebreak-magic/app/components/IosDeviceCard.vue @@ -467,7 +467,7 @@ const action = computed(() => { if (!props.isConnected || !props.iphone) { return { - label: "iPhone verbinden", + label: "iPhone verbinden, um ReBreak Cloud zu synchronisieren", icon: "i-heroicons-link", color: "primary", variant: "solid", diff --git a/apps/rebreak-magic/app/components/IosDeviceSection.vue b/apps/rebreak-magic/app/components/IosDeviceSection.vue index 7ea1ac3..282b069 100644 --- a/apps/rebreak-magic/app/components/IosDeviceSection.vue +++ b/apps/rebreak-magic/app/components/IosDeviceSection.vue @@ -61,6 +61,7 @@ const emit = defineEmits<{ }>(); function matchesIphone(device: ComputedDevice, iphone: IphoneDeviceState): boolean { + if (device.mdmId && device.mdmId === iphone.udid) return true; const modelMatch = (device.model ?? "").toLowerCase() === iphone.productType.toLowerCase(); const nameMatch = (device.name ?? "").toLowerCase() === iphone.name.toLowerCase(); return modelMatch || nameMatch; diff --git a/apps/rebreak-magic/app/components/UnknownIosDeviceCard.vue b/apps/rebreak-magic/app/components/UnknownIosDeviceCard.vue index d43bb3a..969a44f 100644 --- a/apps/rebreak-magic/app/components/UnknownIosDeviceCard.vue +++ b/apps/rebreak-magic/app/components/UnknownIosDeviceCard.vue @@ -26,6 +26,79 @@

UDID: {{ iphone.udid }}

+ +
+
+

+ ReBreak Cloud-Status +

+ + Lädt… + + + Enrolled + + + Nicht enrolled + +
+ +

+ {{ mdmError }} +

+ +
    +
  • + Enrollment + Ja +
  • +
  • + Supervised + + {{ mdmStatus.supervised ? "Ja" : "Nein" }} + +
  • +
  • + Organisation + {{ mdmStatus.company ?? "—" }} +
  • +
  • + ReBreak App + + {{ mdmStatus.lastAppPushAt ? "Gepusht" : "Nicht gepusht" }} + +
  • +
+ +
+ Dieses iPhone ist noch nicht in der ReBreak Cloud. Folge den Schritten unten, um es zu verwalten. +
+
+

So kannst du es verwalten:

    @@ -40,12 +113,31 @@