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"
|
v-if="!isConnected"
|
||||||
class="mt-3 text-sm text-gray-600 dark:text-gray-300 flex items-start gap-2"
|
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" />
|
<UIcon
|
||||||
<span>Verbinde dein iPhone mit USB, um den Schutz zu vervollständigen.</span>
|
: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>
|
</div>
|
||||||
|
|
||||||
<!-- Backend-MDM always visible; local USB only when connected -->
|
<!-- Backend-MDM always visible; local USB only when connected -->
|
||||||
@ -190,8 +194,8 @@
|
|||||||
:variant="action.variant"
|
:variant="action.variant"
|
||||||
size="sm"
|
size="sm"
|
||||||
:icon="action.icon"
|
:icon="action.icon"
|
||||||
:loading="manualSyncing || autoSyncing"
|
:loading="manualSyncing || autoSyncing || isSearching"
|
||||||
:disabled="autoSyncing"
|
:disabled="autoSyncing || isSearching"
|
||||||
@click="onActionClick"
|
@click="onActionClick"
|
||||||
>
|
>
|
||||||
{{ action.label }}
|
{{ action.label }}
|
||||||
@ -222,6 +226,7 @@ const props = defineProps<{
|
|||||||
device: ComputedDevice;
|
device: ComputedDevice;
|
||||||
iphone: IphoneDeviceState | null;
|
iphone: IphoneDeviceState | null;
|
||||||
isConnected: boolean;
|
isConnected: boolean;
|
||||||
|
isSearching?: boolean;
|
||||||
inGracePeriod?: boolean;
|
inGracePeriod?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
@ -232,6 +237,7 @@ const emit = defineEmits<{
|
|||||||
(e: "sync", device: ComputedDevice): void;
|
(e: "sync", device: ComputedDevice): void;
|
||||||
(e: "open", device: ComputedDevice): void;
|
(e: "open", device: ComputedDevice): void;
|
||||||
(e: "remove", device: ComputedDevice): void;
|
(e: "remove", device: ComputedDevice): void;
|
||||||
|
(e: "connect", device: ComputedDevice): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const ENROLLMENT_PROFILE_ID = "org.rebreak.mdm.enrollment";
|
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) {
|
if (!props.isConnected || !props.iphone) {
|
||||||
return {
|
return {
|
||||||
label: "iPhone verbinden, um ReBreak Cloud zu synchronisieren",
|
label: "iPhone verbinden, um ReBreak Cloud zu synchronisieren",
|
||||||
icon: "i-heroicons-link",
|
icon: "i-heroicons-link",
|
||||||
color: "primary",
|
color: "primary",
|
||||||
variant: "solid",
|
variant: "solid",
|
||||||
to: "/detect",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,6 +629,11 @@ function onActionClick() {
|
|||||||
|
|
||||||
if (autoSyncing.value) return;
|
if (autoSyncing.value) return;
|
||||||
|
|
||||||
|
if (!props.isConnected || !props.iphone) {
|
||||||
|
emit("connect", props.device);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
manualSyncing.value = true;
|
manualSyncing.value = true;
|
||||||
emit("sync", props.device);
|
emit("sync", props.device);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user