fix(magic): inline iPhone search in device card instead of detect page
This commit is contained in:
parent
5117c7b37c
commit
ac7bd800bc
@ -58,8 +58,12 @@
|
||||
v-if="!isConnected"
|
||||
class="mt-3 text-sm text-gray-600 dark:text-gray-300 flex items-start gap-2"
|
||||
>
|
||||
<UIcon name="i-heroicons-information-circle" class="w-5 h-5 text-[var(--rebreak-primary)] shrink-0 mt-0.5" />
|
||||
<span>Verbinde dein iPhone mit USB, um den Schutz zu vervollständigen.</span>
|
||||
<UIcon
|
||||
:name="isSearching ? 'i-heroicons-arrow-path' : 'i-heroicons-information-circle'"
|
||||
:class="isSearching ? 'animate-spin' : ''"
|
||||
class="w-5 h-5 text-[var(--rebreak-primary)] shrink-0 mt-0.5"
|
||||
/>
|
||||
<span>{{ isSearching ? "Suche nach verbundenem iPhone…" : "Verbinde dein iPhone mit USB, um den Schutz zu vervollständigen." }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Backend-MDM always visible; local USB only when connected -->
|
||||
@ -190,8 +194,8 @@
|
||||
:variant="action.variant"
|
||||
size="sm"
|
||||
:icon="action.icon"
|
||||
:loading="manualSyncing || autoSyncing"
|
||||
:disabled="autoSyncing"
|
||||
:loading="manualSyncing || autoSyncing || isSearching"
|
||||
:disabled="autoSyncing || isSearching"
|
||||
@click="onActionClick"
|
||||
>
|
||||
{{ action.label }}
|
||||
@ -222,6 +226,7 @@ const props = defineProps<{
|
||||
device: ComputedDevice;
|
||||
iphone: IphoneDeviceState | null;
|
||||
isConnected: boolean;
|
||||
isSearching?: boolean;
|
||||
inGracePeriod?: boolean;
|
||||
}>();
|
||||
|
||||
@ -232,6 +237,7 @@ const emit = defineEmits<{
|
||||
(e: "sync", device: ComputedDevice): void;
|
||||
(e: "open", device: ComputedDevice): void;
|
||||
(e: "remove", device: ComputedDevice): void;
|
||||
(e: "connect", device: ComputedDevice): void;
|
||||
}>();
|
||||
|
||||
const ENROLLMENT_PROFILE_ID = "org.rebreak.mdm.enrollment";
|
||||
@ -472,13 +478,21 @@ const action = computed<IosAction>(() => {
|
||||
};
|
||||
}
|
||||
|
||||
if (props.isSearching) {
|
||||
return {
|
||||
label: "iPhone suchen…",
|
||||
icon: "i-heroicons-arrow-path",
|
||||
color: "neutral",
|
||||
variant: "soft",
|
||||
};
|
||||
}
|
||||
|
||||
if (!props.isConnected || !props.iphone) {
|
||||
return {
|
||||
label: "iPhone verbinden, um ReBreak Cloud zu synchronisieren",
|
||||
icon: "i-heroicons-link",
|
||||
color: "primary",
|
||||
variant: "solid",
|
||||
to: "/detect",
|
||||
};
|
||||
}
|
||||
|
||||
@ -615,6 +629,11 @@ function onActionClick() {
|
||||
|
||||
if (autoSyncing.value) return;
|
||||
|
||||
if (!props.isConnected || !props.iphone) {
|
||||
emit("connect", props.device);
|
||||
return;
|
||||
}
|
||||
|
||||
manualSyncing.value = true;
|
||||
emit("sync", props.device);
|
||||
setTimeout(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user