@aixnn/aixautots 0.6.17 → 0.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{automation-queue-DO8fOG6l.d.ts → automation-queue-GhfQtZLm.d.ts} +2 -2
- package/dist/{chunk-TJ2QIP5M.js → chunk-4NRIEM5Z.js} +249 -33
- package/dist/chunk-6IH74UX6.js +1693 -0
- package/dist/{chunk-WOPEKCVC.js → chunk-DAU3FVCV.js} +2 -2
- package/dist/chunk-DTXXQPOU.js +693 -0
- package/dist/{chunk-7BJPVSEZ.js → chunk-ED6CB3B4.js} +222 -12
- package/dist/{chunk-NIEGPH3E.js → chunk-FJKMRWYC.js} +55 -23
- package/dist/{chunk-ZDCTHR7D.js → chunk-H7KZUU67.js} +2 -2
- package/dist/{chunk-FJPIY4YI.js → chunk-HQ2L4NQ2.js} +262 -10
- package/dist/{chunk-LOKPZ677.js → chunk-JQBSGFAR.js} +2 -2
- package/dist/{chunk-2KPZSPV6.js → chunk-OJK35AQD.js} +105 -17
- package/dist/{chunk-KASSYUGM.js → chunk-RFOJSDYI.js} +2 -2
- package/dist/{chunk-QEK25NUA.js → chunk-UEZVXYGP.js} +12 -5
- package/dist/{config-CBUhr4Gl.d.ts → config-C79rcedl.d.ts} +52 -10
- package/dist/core/index.d.ts +13 -9
- package/dist/core/index.js +2 -2
- package/dist/core/network-adb-node.d.ts +23 -0
- package/dist/core/network-adb-node.js +171 -0
- package/dist/{script-debugger-DoT02din.d.ts → device-channel-OiZwAqNQ.d.ts} +41 -55
- package/dist/{device-normalize-Vl5JYbAI.d.ts → device-normalize-ODrxJb-a.d.ts} +1 -1
- package/dist/device-session-PVHD6PNR.js +1 -0
- package/dist/i18n/index.js +1 -1
- package/dist/{mirror-session-Y1InpkUY.d.ts → mirror-session-DifANocH.d.ts} +2 -2
- package/dist/react/index.d.ts +19 -12
- package/dist/react/index.js +3 -3
- package/dist/script-debugger-DjxpvdaN.d.ts +56 -0
- package/dist/{task-agent-runner-Cl2ickJ1.d.ts → task-agent-runner-CAt-z8gr.d.ts} +3 -3
- package/dist/{types-Cp1ohbTb.d.ts → types-CBI5SIH5.d.ts} +102 -4
- package/dist/ui/billing.d.ts +43 -6
- package/dist/ui/billing.js +190 -309
- package/dist/ui/device-create.d.ts +1 -1
- package/dist/ui/device-create.js +7 -7
- package/dist/ui/device-mirror.js +5 -5
- package/dist/ui/devices.d.ts +5 -5
- package/dist/ui/devices.js +9 -9
- package/dist/ui/editor.d.ts +2 -2
- package/dist/ui/editor.js +5 -5
- package/dist/ui/index.d.ts +6 -4
- package/dist/ui/index.js +13 -492
- package/dist/ui/inspector.js +4 -4
- package/dist/ui/ip-commerce.d.ts +2 -2
- package/dist/ui/ip-commerce.js +5 -5
- package/dist/ui/market.js +4 -4
- package/dist/ui/mirror.d.ts +3 -3
- package/dist/ui/script-studio.js +4 -4
- package/dist/ui/scripts.d.ts +1 -1
- package/dist/ui/scripts.js +4 -4
- package/dist/ui/settings.d.ts +164 -0
- package/dist/ui/settings.js +10 -0
- package/dist/ui/tasks.js +9 -9
- package/package.json +9 -1
- package/dist/device-session-3XK2SZDF.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as Script } from './types-
|
|
1
|
+
import { b as RunEventKind, A as AixConfig, R as ResolvedConfig } from './config-C79rcedl.js';
|
|
2
|
+
import { S as Script } from './types-CBI5SIH5.js';
|
|
3
3
|
|
|
4
4
|
interface FlowSubmit {
|
|
5
5
|
/** Inline flow JSON (XOR scriptId). */
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { LogConsole } from './chunk-3OBCSW2J.js';
|
|
2
|
-
import { requestPreviewFrame, MirrorSurface, DeviceMirror, ConnectDevicesDialog } from './chunk-
|
|
2
|
+
import { requestPreviewFrame, MirrorSurface, DeviceMirror, ConnectDevicesDialog } from './chunk-H7KZUU67.js';
|
|
3
3
|
import { ControlBar, MirrorView } from './chunk-MBBVYSPD.js';
|
|
4
|
-
import { deviceProxyCapabilities, createProxyProbeGuard, proxySummaryFromDevice, isProxyApplyStatus, usesAndroidSystemProxy, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, DeviceCreate, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { deviceProxyCapabilities, createProxyProbeGuard, proxySummaryFromDevice, isProxyApplyStatus, safeCustomProxyAddress, usesAndroidSystemProxy, normalizeManualProxyUrl, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, DeviceCreate, isProxyProbeUnsupported, customProxyAddress, isRedactedProxyUrl, isSupportedProxyUrl } from './chunk-FJKMRWYC.js';
|
|
5
|
+
import { IpCommercePanel } from './chunk-JQBSGFAR.js';
|
|
6
|
+
import { IosDeviceDiagnostics } from './chunk-RFOJSDYI.js';
|
|
7
7
|
import { isPhysicalIos } from './chunk-ZB5ET67B.js';
|
|
8
|
-
import { useAixT } from './chunk-FJPIY4YI.js';
|
|
9
8
|
import { cn, Badge, Button, Dialog, Input, Popover, Select, useToast, ToastViewport, Drawer } from './chunk-7RQTSTR6.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { useAixT } from './chunk-HQ2L4NQ2.js';
|
|
10
|
+
import { useClient, useDevicesView, useShortcutsView, useAixConfig, GROUP_MIRROR_MAX, useGroupMirror, useScripts, useFleetRun, useTaskAgentRun, preflightTaskAgentDevice, createAgentTaskRunner, useNodesView } from './chunk-UEZVXYGP.js';
|
|
11
|
+
import { DeviceChannel } from './chunk-ED6CB3B4.js';
|
|
12
|
+
import { DeviceSession, isQueuedPowerReceipt, pushFile, pullFile, AixError } from './chunk-OJK35AQD.js';
|
|
12
13
|
import { useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect } from 'react';
|
|
13
14
|
import * as Icons from 'lucide-react';
|
|
14
15
|
import { Monitor, Eye, Play, Power, RefreshCw, Server, Pencil, Trash2, FolderPlus, Upload, ArrowUp, Folder, File, Download, Dices, ShieldCheck, AlertTriangle, X, Crown, RotateCcw, Square, Plus, Search, LayoutGrid, List, ChevronLeft, Link, Link2Off, Terminal as Terminal$1, PackagePlus, MonitorPlay, ChevronRight, ChevronDown, PlusSquare, Maximize2, Info, ChevronsLeft, ChevronsRight, Check, Copy, Tablet, Smartphone } from 'lucide-react';
|
|
@@ -2126,8 +2127,17 @@ function ShortcutEditDialog({ initial, onClose, onSaved, onDeleted }) {
|
|
|
2126
2127
|
// src/ui/devices/shortcut-feedback.ts
|
|
2127
2128
|
function powerFeedback(name, results) {
|
|
2128
2129
|
const total = results.length;
|
|
2129
|
-
const
|
|
2130
|
+
const failed = results.filter((r) => !r.ok).length;
|
|
2131
|
+
const queued = results.filter((r) => r.ok && isQueuedPowerReceipt(r.result)).length;
|
|
2132
|
+
const ok = total - failed - queued;
|
|
2130
2133
|
const firstError = results.find((r) => !r.ok)?.error ?? "";
|
|
2134
|
+
if (queued > 0) {
|
|
2135
|
+
return {
|
|
2136
|
+
tone: "warn",
|
|
2137
|
+
key: failed > 0 ? "shortcutBar.queuedPartial" : "shortcutBar.queued",
|
|
2138
|
+
vars: { name, ok, queued, failed, error: firstError }
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2131
2141
|
if (total > 0 && ok === total) {
|
|
2132
2142
|
return { tone: "ok", key: "shortcutBar.ok", vars: { name, ok, total } };
|
|
2133
2143
|
}
|
|
@@ -2137,7 +2147,7 @@ function powerFeedback(name, results) {
|
|
|
2137
2147
|
return {
|
|
2138
2148
|
tone: "warn",
|
|
2139
2149
|
key: "shortcutBar.partial",
|
|
2140
|
-
vars: { name, ok, total, failed
|
|
2150
|
+
vars: { name, ok, total, failed, error: firstError }
|
|
2141
2151
|
};
|
|
2142
2152
|
}
|
|
2143
2153
|
var DONE = "done";
|
|
@@ -3010,6 +3020,9 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3010
3020
|
const [proxyNode, setProxyNode] = useState(null);
|
|
3011
3021
|
const proxyNodeId = device?.meta.node_id;
|
|
3012
3022
|
const proxyCapability = deviceProxyCapabilities(device, proxyNode);
|
|
3023
|
+
const spec = device?.meta.spec;
|
|
3024
|
+
const developerSettingsSupported = device?.platform === "android" && device.online && device.meta.provisioned === true && [void 0, "android", "redroid"].includes(device.meta.platform) && [void 0, "android", "redroid"].includes(spec?.platform) && [void 0, "android", "redroid"].includes(spec?.kind) && [void 0, "android", "redroid", "cloud"].includes(device.meta.kind) && typeof proxyNodeId === "string" && proxyNode?.id === proxyNodeId && proxyNode.status === "online" && proxyNode.reported_caps?.developer_settings?.supported === true;
|
|
3025
|
+
const networkAdbSupported = device?.platform === "android" && device.online && device.meta.provisioned === true && [void 0, "android", "redroid"].includes(device.meta.platform) && [void 0, "android", "redroid"].includes(spec?.platform) && [void 0, "android", "redroid"].includes(spec?.kind) && [void 0, "android", "redroid", "cloud"].includes(device.meta.kind) && typeof proxyNodeId === "string" && proxyNode?.id === proxyNodeId && proxyNode.status === "online" && proxyNode.reported_caps?.network_adb_dc_denied_v1 === true;
|
|
3013
3026
|
useEffect(() => {
|
|
3014
3027
|
let cancelled = false;
|
|
3015
3028
|
setProxyNode(null);
|
|
@@ -3042,7 +3055,13 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3042
3055
|
const [showDelete, setShowDelete] = useState(false);
|
|
3043
3056
|
const [aixipsOpen, setAixipsOpen] = useState(false);
|
|
3044
3057
|
const [proxyInput, setProxyInput] = useState("");
|
|
3045
|
-
const [
|
|
3058
|
+
const [proxySavedAddress, setProxySavedAddress] = useState("");
|
|
3059
|
+
const [proxyAddressLoading, setProxyAddressLoading] = useState(false);
|
|
3060
|
+
const [proxyInputDirty, setProxyInputDirty] = useState(false);
|
|
3061
|
+
const proxyInputDirtyRef = useRef(false);
|
|
3062
|
+
const proxyAddressGeneration = useRef(0);
|
|
3063
|
+
const activeProxyDevice = useRef(deviceId);
|
|
3064
|
+
activeProxyDevice.current = deviceId;
|
|
3046
3065
|
const [proxyApply, setProxyApply] = useState(null);
|
|
3047
3066
|
const [proxySaving, setProxySaving] = useState(false);
|
|
3048
3067
|
const [proxyProbe, setProxyProbe] = useState(null);
|
|
@@ -3138,7 +3157,10 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3138
3157
|
setLocation(null);
|
|
3139
3158
|
stopLocationSimulation();
|
|
3140
3159
|
setProxyInput("");
|
|
3141
|
-
|
|
3160
|
+
setProxySavedAddress("");
|
|
3161
|
+
proxyInputDirtyRef.current = false;
|
|
3162
|
+
setProxyInputDirty(false);
|
|
3163
|
+
proxyAddressGeneration.current += 1;
|
|
3142
3164
|
setProxyApply(null);
|
|
3143
3165
|
setProxyProbe(null);
|
|
3144
3166
|
setProxyProbeError(null);
|
|
@@ -3170,7 +3192,9 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3170
3192
|
}
|
|
3171
3193
|
const summary = proxySummaryFromDevice(cur);
|
|
3172
3194
|
setProxyInput("");
|
|
3173
|
-
|
|
3195
|
+
setProxySavedAddress("");
|
|
3196
|
+
proxyInputDirtyRef.current = false;
|
|
3197
|
+
setProxyInputDirty(false);
|
|
3174
3198
|
setProxyApply(
|
|
3175
3199
|
summary && summary.observed_status && isProxyApplyStatus(summary.observed_status) ? { revision: summary.observed_revision ?? summary.desired_revision ?? 0, status: summary.observed_status } : null
|
|
3176
3200
|
);
|
|
@@ -3184,6 +3208,29 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3184
3208
|
client.devices.op(deviceId, { op: "screen_size" })
|
|
3185
3209
|
).then((size) => setInfo({ resolution: `${size.width}\xD7${size.height}` })).catch(() => setInfo({})).finally(() => setInfoLoading(false));
|
|
3186
3210
|
}, [deviceId]);
|
|
3211
|
+
const selectedProxy = proxySummaryFromDevice(device);
|
|
3212
|
+
const selectedProxySource = device?.meta?.proxy_source?.kind;
|
|
3213
|
+
const selectedRevision = selectedProxy?.desired_revision;
|
|
3214
|
+
const selectedConfigured = selectedProxy?.configured === true && (selectedProxySource === void 0 || selectedProxySource === "custom");
|
|
3215
|
+
useEffect(() => {
|
|
3216
|
+
const generation = ++proxyAddressGeneration.current;
|
|
3217
|
+
setProxyAddressLoading(Boolean(deviceId && selectedConfigured));
|
|
3218
|
+
setProxySavedAddress("");
|
|
3219
|
+
if (!proxyInputDirtyRef.current) setProxyInput("");
|
|
3220
|
+
if (!deviceId || !selectedConfigured) return;
|
|
3221
|
+
void client.devices.customProxyAddress(deviceId).then((result) => {
|
|
3222
|
+
if (proxyAddressGeneration.current !== generation || activeProxyDevice.current !== deviceId) return;
|
|
3223
|
+
const address = result.configured ? safeCustomProxyAddress(result.address) ?? "" : "";
|
|
3224
|
+
setProxySavedAddress(address);
|
|
3225
|
+
if (!proxyInputDirtyRef.current) setProxyInput(address);
|
|
3226
|
+
}).catch(() => {
|
|
3227
|
+
}).finally(() => {
|
|
3228
|
+
if (proxyAddressGeneration.current === generation && activeProxyDevice.current === deviceId) setProxyAddressLoading(false);
|
|
3229
|
+
});
|
|
3230
|
+
return () => {
|
|
3231
|
+
++proxyAddressGeneration.current;
|
|
3232
|
+
};
|
|
3233
|
+
}, [client, deviceId, selectedConfigured, selectedRevision, selectedProxySource]);
|
|
3187
3234
|
useEffect(() => {
|
|
3188
3235
|
if (deviceId && proxyCapability.custom && proxySummaryFromDevice(device)?.configured) void probeProxy(deviceId);
|
|
3189
3236
|
}, [deviceId, proxyCapability.custom]);
|
|
@@ -3196,9 +3243,15 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3196
3243
|
const handleClose = () => {
|
|
3197
3244
|
onClose();
|
|
3198
3245
|
};
|
|
3199
|
-
const handleSaveProxy = async () => {
|
|
3200
|
-
if (!deviceId || proxySaving || !proxyCapability.custom) return;
|
|
3201
|
-
const nextProxy = proxyInput
|
|
3246
|
+
const handleSaveProxy = async (clear = false) => {
|
|
3247
|
+
if (!deviceId || proxySaving || proxyAddressLoading || !proxyCapability.custom || !clear && !proxyInputDirtyRef.current) return;
|
|
3248
|
+
const nextProxy = clear ? "" : normalizeManualProxyUrl(proxyInput);
|
|
3249
|
+
if (!clear && proxySavedAddress && !nextProxy.includes("@") && customProxyAddress(nextProxy) === proxySavedAddress) {
|
|
3250
|
+
proxyInputDirtyRef.current = false;
|
|
3251
|
+
setProxyInputDirty(false);
|
|
3252
|
+
setProxyInput(proxySavedAddress);
|
|
3253
|
+
return;
|
|
3254
|
+
}
|
|
3202
3255
|
if (isRedactedProxyUrl(nextProxy)) {
|
|
3203
3256
|
toast.error(t("drawer.proxyPasswordRequired"));
|
|
3204
3257
|
return;
|
|
@@ -3208,12 +3261,18 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3208
3261
|
return;
|
|
3209
3262
|
}
|
|
3210
3263
|
setProxySaving(true);
|
|
3264
|
+
const generation = ++proxyAddressGeneration.current;
|
|
3211
3265
|
try {
|
|
3212
3266
|
const result = await client.devices.updateProxy(deviceId, nextProxy);
|
|
3213
|
-
|
|
3214
|
-
|
|
3267
|
+
if (proxyAddressGeneration.current !== generation || activeProxyDevice.current !== deviceId) return;
|
|
3268
|
+
const address = nextProxy ? customProxyAddress(nextProxy) ?? "" : "";
|
|
3269
|
+
proxyInputDirtyRef.current = false;
|
|
3270
|
+
setProxyInputDirty(false);
|
|
3271
|
+
setProxyInput(address);
|
|
3272
|
+
setProxySavedAddress(address);
|
|
3215
3273
|
setProxyApply(result.proxy_apply ?? null);
|
|
3216
3274
|
await fetchDevices();
|
|
3275
|
+
if (activeProxyDevice.current !== deviceId) return;
|
|
3217
3276
|
toast.success(nextProxy ? t("drawer.proxySaved") : t("drawer.proxyCleared"));
|
|
3218
3277
|
if (nextProxy) {
|
|
3219
3278
|
await probeProxy(deviceId);
|
|
@@ -3223,7 +3282,7 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3223
3282
|
setProxyProbeUnsupported(false);
|
|
3224
3283
|
}
|
|
3225
3284
|
} catch (e) {
|
|
3226
|
-
toast.error(`proxy: ${e.message}`);
|
|
3285
|
+
if (activeProxyDevice.current === deviceId) toast.error(`proxy: ${e.message}`);
|
|
3227
3286
|
} finally {
|
|
3228
3287
|
setProxySaving(false);
|
|
3229
3288
|
}
|
|
@@ -3355,6 +3414,7 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3355
3414
|
)
|
|
3356
3415
|
] })
|
|
3357
3416
|
] }),
|
|
3417
|
+
tab === "overview" && networkAdbSupported && deviceId && /* @__PURE__ */ jsx(NetworkAdbControl, { deviceId }, deviceId),
|
|
3358
3418
|
tab === "overview" && physicalIos && device && proxyNode?.is_owner && proxyNode.status === "online" && proxyNode.reported_caps?.ios_control?.diagnostics === true && (typeof device.meta.udid === "string" || device.id.startsWith("ios-")) && /* @__PURE__ */ jsx(
|
|
3359
3419
|
IosDeviceDiagnostics,
|
|
3360
3420
|
{
|
|
@@ -3477,6 +3537,7 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3477
3537
|
}
|
|
3478
3538
|
)
|
|
3479
3539
|
] }),
|
|
3540
|
+
developerSettingsSupported && /* @__PURE__ */ jsx(DeveloperSettingsControl, { deviceId }, deviceId),
|
|
3480
3541
|
/* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
3481
3542
|
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-3 text-[11px]", children: [
|
|
3482
3543
|
/* @__PURE__ */ jsx("span", { className: "font-medium text-muted-foreground", children: t("drawer.installApp") }),
|
|
@@ -3578,20 +3639,22 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3578
3639
|
) }),
|
|
3579
3640
|
/* @__PURE__ */ jsxs("div", { className: "rounded border border-border p-3", role: "group", "aria-label": t("managed.custom"), children: [
|
|
3580
3641
|
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground mb-2", children: t("drawer.proxyDesc") }),
|
|
3581
|
-
proxySummary && /* @__PURE__ */ jsxs("p", { className: "mb-2 rounded border border-border/70 bg-secondary/40 px-2 py-1 text-[11px] text-muted-foreground", children: [
|
|
3582
|
-
t("drawer.proxyConfigured"),
|
|
3583
|
-
": ",
|
|
3584
|
-
/* @__PURE__ */ jsx("code", { children: proxySummary })
|
|
3585
|
-
] }),
|
|
3586
3642
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3587
3643
|
/* @__PURE__ */ jsx(
|
|
3588
3644
|
Input,
|
|
3589
3645
|
{
|
|
3590
3646
|
"aria-label": t("managed.custom"),
|
|
3591
|
-
disabled: !proxyCapability.custom,
|
|
3647
|
+
disabled: !proxyCapability.custom || proxySaving,
|
|
3592
3648
|
value: proxyInput,
|
|
3593
|
-
onChange: (e) =>
|
|
3594
|
-
|
|
3649
|
+
onChange: (e) => {
|
|
3650
|
+
proxyInputDirtyRef.current = true;
|
|
3651
|
+
setProxyInputDirty(true);
|
|
3652
|
+
setProxyInput(e.target.value);
|
|
3653
|
+
},
|
|
3654
|
+
onBlur: () => {
|
|
3655
|
+
if (proxyInputDirtyRef.current) setProxyInput(normalizeManualProxyUrl(proxyInput));
|
|
3656
|
+
},
|
|
3657
|
+
placeholder: selectedConfigured && !proxySavedAddress ? t("drawer.proxyAddressUnavailable") : t("drawer.proxyPlaceholder")
|
|
3595
3658
|
}
|
|
3596
3659
|
),
|
|
3597
3660
|
/* @__PURE__ */ jsx(
|
|
@@ -3599,10 +3662,20 @@ function DeviceDetailDrawer({ deviceId, onClose }) {
|
|
|
3599
3662
|
{
|
|
3600
3663
|
size: "sm",
|
|
3601
3664
|
variant: "secondary",
|
|
3602
|
-
disabled: proxySaving || !proxyCapability.custom,
|
|
3603
|
-
onClick: handleSaveProxy,
|
|
3665
|
+
disabled: proxySaving || proxyAddressLoading || !proxyCapability.custom || !proxyInputDirty,
|
|
3666
|
+
onClick: () => void handleSaveProxy(),
|
|
3604
3667
|
children: proxySaving ? t("common.saving") : t("common.save")
|
|
3605
3668
|
}
|
|
3669
|
+
),
|
|
3670
|
+
selectedConfigured && /* @__PURE__ */ jsx(
|
|
3671
|
+
Button,
|
|
3672
|
+
{
|
|
3673
|
+
size: "sm",
|
|
3674
|
+
variant: "ghost",
|
|
3675
|
+
disabled: proxySaving || proxyAddressLoading || !proxyCapability.custom,
|
|
3676
|
+
onClick: () => void handleSaveProxy(true),
|
|
3677
|
+
children: t("drawer.proxyClear")
|
|
3678
|
+
}
|
|
3606
3679
|
)
|
|
3607
3680
|
] }),
|
|
3608
3681
|
/* @__PURE__ */ jsx(
|
|
@@ -3845,9 +3918,6 @@ function GpuModeDialog({
|
|
|
3845
3918
|
] })
|
|
3846
3919
|
] });
|
|
3847
3920
|
}
|
|
3848
|
-
function maskedProxySummary(summary) {
|
|
3849
|
-
return summary.configured ? "http://user:***@host:port" : "";
|
|
3850
|
-
}
|
|
3851
3921
|
function proxyStatusKey(status) {
|
|
3852
3922
|
switch (status) {
|
|
3853
3923
|
case "pending":
|
|
@@ -4023,6 +4093,147 @@ function TemplateInstallPanel({
|
|
|
4023
4093
|
] })
|
|
4024
4094
|
] });
|
|
4025
4095
|
}
|
|
4096
|
+
function DeveloperSettingsControl({ deviceId }) {
|
|
4097
|
+
const t = useAixT();
|
|
4098
|
+
const client = useClient();
|
|
4099
|
+
const [receipt, setReceipt] = useState(null);
|
|
4100
|
+
const [phase, setPhase] = useState("loading");
|
|
4101
|
+
const [pending, setPending] = useState(false);
|
|
4102
|
+
const [error, setError] = useState("");
|
|
4103
|
+
const [writeUncertain, setWriteUncertain] = useState(false);
|
|
4104
|
+
const inFlight = useRef(false);
|
|
4105
|
+
const active = useRef(true);
|
|
4106
|
+
const refresh = async () => {
|
|
4107
|
+
if (inFlight.current) return;
|
|
4108
|
+
inFlight.current = true;
|
|
4109
|
+
setPhase("loading");
|
|
4110
|
+
setError("");
|
|
4111
|
+
try {
|
|
4112
|
+
const result = await client.devices.getDeveloperSettings(deviceId);
|
|
4113
|
+
if (!active.current) return;
|
|
4114
|
+
if (typeof result?.developerMode !== "boolean" || typeof result?.usbDebugging !== "boolean" || result?.usbAuthorization !== "not_verified") {
|
|
4115
|
+
throw new Error(t("drawer.developerSettingsInvalid"));
|
|
4116
|
+
}
|
|
4117
|
+
setReceipt(result);
|
|
4118
|
+
setWriteUncertain(false);
|
|
4119
|
+
setPhase("ready");
|
|
4120
|
+
} catch (e) {
|
|
4121
|
+
if (!active.current) return;
|
|
4122
|
+
const status = e.status;
|
|
4123
|
+
if (status === 403 || status === 404 || status === 409) setPhase("unsupported");
|
|
4124
|
+
else {
|
|
4125
|
+
setError(e.message);
|
|
4126
|
+
setPhase("error");
|
|
4127
|
+
}
|
|
4128
|
+
} finally {
|
|
4129
|
+
inFlight.current = false;
|
|
4130
|
+
}
|
|
4131
|
+
};
|
|
4132
|
+
useEffect(() => {
|
|
4133
|
+
active.current = true;
|
|
4134
|
+
void refresh();
|
|
4135
|
+
return () => {
|
|
4136
|
+
active.current = false;
|
|
4137
|
+
};
|
|
4138
|
+
}, [deviceId]);
|
|
4139
|
+
const enable = async () => {
|
|
4140
|
+
if (inFlight.current || pending || writeUncertain || phase !== "ready") return;
|
|
4141
|
+
inFlight.current = true;
|
|
4142
|
+
setPending(true);
|
|
4143
|
+
setError("");
|
|
4144
|
+
try {
|
|
4145
|
+
const result = await client.devices.enableDeveloperSettings(deviceId);
|
|
4146
|
+
if (!active.current) return;
|
|
4147
|
+
if (result?.developerMode !== true || result?.usbDebugging !== true || result?.usbAuthorization !== "not_verified") {
|
|
4148
|
+
throw new Error(t("drawer.developerSettingsInvalid"));
|
|
4149
|
+
}
|
|
4150
|
+
setReceipt(result);
|
|
4151
|
+
} catch (e) {
|
|
4152
|
+
if (!active.current) return;
|
|
4153
|
+
setWriteUncertain(true);
|
|
4154
|
+
setError(e.message);
|
|
4155
|
+
} finally {
|
|
4156
|
+
inFlight.current = false;
|
|
4157
|
+
if (active.current) setPending(false);
|
|
4158
|
+
}
|
|
4159
|
+
};
|
|
4160
|
+
if (phase === "unsupported") return null;
|
|
4161
|
+
const enabled = receipt?.developerMode === true && receipt?.usbDebugging === true;
|
|
4162
|
+
return /* @__PURE__ */ jsxs("div", { className: "mt-3 rounded-md border border-border bg-secondary/30 p-3", "aria-busy": phase === "loading" || pending, children: [
|
|
4163
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: t("drawer.developerSettings") }),
|
|
4164
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("drawer.developerSettingsHint") }),
|
|
4165
|
+
phase === "loading" ? /* @__PURE__ */ jsx("p", { role: "status", className: "mt-2 text-xs", children: t("drawer.developerSettingsChecking") }) : null,
|
|
4166
|
+
phase === "ready" && enabled ? /* @__PURE__ */ jsx("p", { role: "status", className: "mt-2 text-xs text-foreground", children: t("drawer.developerSettingsEnabled") }) : null,
|
|
4167
|
+
error && /* @__PURE__ */ jsx("p", { role: "alert", className: "mt-2 text-xs text-destructive", children: t("drawer.developerSettingsError", { error }) }),
|
|
4168
|
+
phase === "ready" && !enabled && !writeUncertain && /* @__PURE__ */ jsx(Button, { className: "mt-2 min-h-11", size: "sm", variant: "secondary", disabled: pending, onClick: () => void enable(), children: pending ? t("drawer.developerSettingsEnabling") : t("drawer.developerSettingsEnable") }),
|
|
4169
|
+
(phase === "error" || writeUncertain) && /* @__PURE__ */ jsx(Button, { className: "mt-2 min-h-11", size: "sm", variant: "secondary", disabled: phase === "loading" || pending, onClick: () => void refresh(), children: t("drawer.developerSettingsRefresh") })
|
|
4170
|
+
] });
|
|
4171
|
+
}
|
|
4172
|
+
function NetworkAdbControl({ deviceId }) {
|
|
4173
|
+
const cfg = useAixConfig();
|
|
4174
|
+
const t = useAixT();
|
|
4175
|
+
const channel = useRef(null);
|
|
4176
|
+
const generation = useRef(0);
|
|
4177
|
+
const [grant, setGrant] = useState({ enabled: false, socketConnected: false });
|
|
4178
|
+
const [busy, setBusy] = useState(false);
|
|
4179
|
+
const [unsupported, setUnsupported] = useState(false);
|
|
4180
|
+
const [error, setError] = useState("");
|
|
4181
|
+
useEffect(() => () => {
|
|
4182
|
+
generation.current++;
|
|
4183
|
+
channel.current?.close();
|
|
4184
|
+
channel.current = null;
|
|
4185
|
+
}, [deviceId]);
|
|
4186
|
+
const toggle = async () => {
|
|
4187
|
+
if (busy) return;
|
|
4188
|
+
setBusy(true);
|
|
4189
|
+
setError("");
|
|
4190
|
+
const token = ++generation.current;
|
|
4191
|
+
try {
|
|
4192
|
+
if (grant.enabled) {
|
|
4193
|
+
const ch = channel.current;
|
|
4194
|
+
channel.current = null;
|
|
4195
|
+
try {
|
|
4196
|
+
await ch?.setNetworkAdb(false);
|
|
4197
|
+
} finally {
|
|
4198
|
+
ch?.close();
|
|
4199
|
+
}
|
|
4200
|
+
if (token === generation.current) setGrant({ enabled: false, socketConnected: false });
|
|
4201
|
+
} else {
|
|
4202
|
+
const ch = channel.current ?? await DeviceChannel.open(cfg, deviceId);
|
|
4203
|
+
if (token !== generation.current) {
|
|
4204
|
+
ch.close();
|
|
4205
|
+
return;
|
|
4206
|
+
}
|
|
4207
|
+
channel.current = ch;
|
|
4208
|
+
ch.on("network_adb", (state) => {
|
|
4209
|
+
if (token === generation.current) setGrant(state);
|
|
4210
|
+
});
|
|
4211
|
+
const receipt = await ch.setNetworkAdb(true);
|
|
4212
|
+
if (token === generation.current && receipt.enabled) setGrant(ch.networkAdbState);
|
|
4213
|
+
}
|
|
4214
|
+
} catch (e) {
|
|
4215
|
+
if (token === generation.current) {
|
|
4216
|
+
channel.current?.close();
|
|
4217
|
+
channel.current = null;
|
|
4218
|
+
setGrant({ enabled: false, socketConnected: false });
|
|
4219
|
+
const message2 = e instanceof Error ? e.message : String(e);
|
|
4220
|
+
if (/unknown.*network_adb|unsupported|unrecognized|unknown.*command|not implemented/i.test(message2)) setUnsupported(true);
|
|
4221
|
+
else setError(message2);
|
|
4222
|
+
}
|
|
4223
|
+
} finally {
|
|
4224
|
+
if (token === generation.current) setBusy(false);
|
|
4225
|
+
}
|
|
4226
|
+
};
|
|
4227
|
+
if (unsupported) return null;
|
|
4228
|
+
return /* @__PURE__ */ jsxs("section", { className: "rounded-md border border-border bg-secondary/30 p-3", "aria-busy": busy, children: [
|
|
4229
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: t("drawer.networkAdb") }),
|
|
4230
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("drawer.networkAdbHint") }),
|
|
4231
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: t("drawer.rootFridaRuntimeHint") }),
|
|
4232
|
+
/* @__PURE__ */ jsx("p", { role: "status", className: "mt-2 text-xs", children: grant.enabled ? t("drawer.networkAdbGranted") : t("drawer.networkAdbOff") }),
|
|
4233
|
+
error && /* @__PURE__ */ jsx("p", { role: "alert", className: "mt-2 text-xs text-destructive", children: t("drawer.networkAdbError", { error }) }),
|
|
4234
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "secondary", className: "mt-2 min-h-11", disabled: busy, "aria-pressed": grant.enabled, onClick: () => void toggle(), children: busy ? t("drawer.networkAdbPending") : grant.enabled ? t("drawer.networkAdbDisable") : t("drawer.networkAdbEnable") })
|
|
4235
|
+
] });
|
|
4236
|
+
}
|
|
4026
4237
|
var PROFILE_KEYS = {
|
|
4027
4238
|
balanced: "groupMirror.profile.balanced",
|
|
4028
4239
|
low_latency: "groupMirror.profile.lowLatency",
|
|
@@ -5266,8 +5477,13 @@ function DevicesPage({ taskAgentRunner: providedTaskAgentRunner } = {}) {
|
|
|
5266
5477
|
try {
|
|
5267
5478
|
const settled = await Promise.allSettled(ids.map((id) => client.devices.power(id, action)));
|
|
5268
5479
|
const failed = settled.filter((r) => r.status === "rejected").length;
|
|
5269
|
-
const
|
|
5270
|
-
|
|
5480
|
+
const queued = settled.filter((r) => r.status === "fulfilled" && isQueuedPowerReceipt(r.value)).length;
|
|
5481
|
+
const ok = settled.length - failed - queued;
|
|
5482
|
+
if (queued > 0) {
|
|
5483
|
+
const message2 = t("devices.bulk.powerQueued", { ok, queued, failed });
|
|
5484
|
+
if (failed > 0) toast.error(message2);
|
|
5485
|
+
else toast.info(message2);
|
|
5486
|
+
} else if (failed === 0) toast.success(t("devices.bulk.powerDone", { n: ok }));
|
|
5271
5487
|
else toast.error(t("devices.bulk.powerPartial", { ok, failed }));
|
|
5272
5488
|
await fetchDevices();
|
|
5273
5489
|
} finally {
|