@aixnn/aixautots 0.6.10 → 0.6.12
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LogConsole } from './chunk-D7J4EQTA.js';
|
|
2
2
|
import { requestPreviewFrame, MirrorSurface, DeviceMirror, ConnectDevicesDialog } from './chunk-XCYGBYFC.js';
|
|
3
3
|
import { ControlBar, MirrorView } from './chunk-E7WMHM63.js';
|
|
4
|
-
import { deviceProxyCapabilities, createProxyProbeGuard, proxySummaryFromDevice, isProxyApplyStatus, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, DeviceCreate, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl, redactProxyUrl } from './chunk-
|
|
4
|
+
import { deviceProxyCapabilities, createProxyProbeGuard, proxySummaryFromDevice, isProxyApplyStatus, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, DeviceCreate, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl, redactProxyUrl } from './chunk-ROOOAG3E.js';
|
|
5
5
|
import { IosDeviceDiagnostics } from './chunk-SL6M6CC6.js';
|
|
6
6
|
import { isPhysicalIos } from './chunk-ZB5ET67B.js';
|
|
7
7
|
import { useAixT, useAixLang } from './chunk-LO3XD4T5.js';
|
|
@@ -3,10 +3,25 @@ import { canConnectPhysicalDevice } from './chunk-ZB5ET67B.js';
|
|
|
3
3
|
import { useAixT } from './chunk-LO3XD4T5.js';
|
|
4
4
|
import { cn, Select, Dialog, Button, Input, Badge } from './chunk-SKTL6ACT.js';
|
|
5
5
|
import { useNodes, useClient, useDevices } from './chunk-7IXBWJHB.js';
|
|
6
|
-
import {
|
|
6
|
+
import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
7
7
|
import { Server, RefreshCw, Smartphone, Usb, Wifi, Info } from 'lucide-react';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
|
+
// src/ui/device-create/virtual-catalog.ts
|
|
11
|
+
function supportsVirtualPlatform(node, platform) {
|
|
12
|
+
if (!node || node.status !== "online" || node.effective_caps?.[platform] === false || node.owner_policy?.[platform] === false) return false;
|
|
13
|
+
const provider = platform === "android" ? "redroid_capable" : "vphone_capable";
|
|
14
|
+
return node.reported_caps?.[provider] === true;
|
|
15
|
+
}
|
|
16
|
+
function availableVirtualImages(node, catalog, platform) {
|
|
17
|
+
if (!supportsVirtualPlatform(node, platform)) return [];
|
|
18
|
+
const installed = node?.reported_caps?.installed_images;
|
|
19
|
+
if (!Array.isArray(installed)) return [];
|
|
20
|
+
return catalog.filter((image) => image.platform === platform && typeof image.image_tag === "string" && installed.includes(image.image_tag));
|
|
21
|
+
}
|
|
22
|
+
function availableVirtualPlatforms(node, catalog) {
|
|
23
|
+
return ["android", "ios"].filter((platform) => availableVirtualImages(node, catalog, platform).length > 0);
|
|
24
|
+
}
|
|
10
25
|
var SCOPE_META = {
|
|
11
26
|
platform: { label: "\u5E73\u53F0", order: 0 },
|
|
12
27
|
project: { label: "\u9879\u76EE", order: 1 },
|
|
@@ -21,23 +36,45 @@ function nodeMetric(n) {
|
|
|
21
36
|
}
|
|
22
37
|
return `${n.device_count} devices`;
|
|
23
38
|
}
|
|
24
|
-
function NodePicker({ value, onChange, hidePlatform = false }) {
|
|
39
|
+
function NodePicker({ value, onChange, hidePlatform = false, virtualOnly = false }) {
|
|
25
40
|
const { data, loading, error, refetch } = useNodes();
|
|
41
|
+
const client = useClient();
|
|
42
|
+
const [catalog, setCatalog] = useState(null);
|
|
43
|
+
const [catalogError, setCatalogError] = useState(false);
|
|
44
|
+
const catalogLoading = virtualOnly && catalog === null && !catalogError;
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!virtualOnly) return;
|
|
47
|
+
let alive = true;
|
|
48
|
+
setCatalog(null);
|
|
49
|
+
setCatalogError(false);
|
|
50
|
+
client.images.options().then((images) => {
|
|
51
|
+
if (!Array.isArray(images)) throw new Error("Invalid image catalog");
|
|
52
|
+
if (alive) setCatalog(images);
|
|
53
|
+
}).catch(() => {
|
|
54
|
+
if (alive) {
|
|
55
|
+
setCatalog([]);
|
|
56
|
+
setCatalogError(true);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return () => {
|
|
60
|
+
alive = false;
|
|
61
|
+
};
|
|
62
|
+
}, [client, virtualOnly]);
|
|
26
63
|
const nodes = useMemo(() => data ?? [], [data]);
|
|
27
64
|
useEffect(() => {
|
|
28
65
|
void refetch();
|
|
29
66
|
}, [refetch]);
|
|
30
67
|
const onlineNodes = useMemo(
|
|
31
68
|
() => nodes.filter(
|
|
32
|
-
(n) => n.status === "online" && !(hidePlatform && (n.is_platform || n.scope === "platform"))
|
|
69
|
+
(n) => n.status === "online" && !(hidePlatform && (n.is_platform || n.scope === "platform")) && (!virtualOnly || catalog !== null && availableVirtualPlatforms(n, catalog).length > 0)
|
|
33
70
|
),
|
|
34
|
-
[nodes, hidePlatform]
|
|
71
|
+
[nodes, hidePlatform, virtualOnly, catalog]
|
|
35
72
|
);
|
|
36
73
|
useEffect(() => {
|
|
37
|
-
if (
|
|
74
|
+
if (!loading && !catalogLoading && value && (error || !onlineNodes.some((n) => n.id === value))) {
|
|
38
75
|
onChange("");
|
|
39
76
|
}
|
|
40
|
-
}, [value, onlineNodes, onChange]);
|
|
77
|
+
}, [value, onlineNodes, onChange, loading, error, catalogLoading]);
|
|
41
78
|
const groups = useMemo(() => {
|
|
42
79
|
const by = {
|
|
43
80
|
platform: [],
|
|
@@ -47,14 +84,17 @@ function NodePicker({ value, onChange, hidePlatform = false }) {
|
|
|
47
84
|
for (const n of onlineNodes) (by[n.scope] ?? by.personal).push(n);
|
|
48
85
|
return Object.keys(by).filter((s) => by[s].length > 0).sort((a, b) => SCOPE_META[a].order - SCOPE_META[b].order).map((scope) => ({ scope, rows: by[scope] }));
|
|
49
86
|
}, [onlineNodes]);
|
|
50
|
-
if (loading && nodes.length === 0) {
|
|
87
|
+
if (loading && nodes.length === 0 || catalogLoading) {
|
|
51
88
|
return /* @__PURE__ */ jsx("p", { className: "py-6 text-center text-body-sm text-muted-foreground", children: "\u52A0\u8F7D\u8282\u70B9\u4E2D\u2026" });
|
|
52
89
|
}
|
|
53
90
|
if (error) {
|
|
54
91
|
return /* @__PURE__ */ jsx("p", { className: "py-2 text-[11px] text-destructive", children: error.message });
|
|
55
92
|
}
|
|
93
|
+
if (catalogError && virtualOnly) {
|
|
94
|
+
return /* @__PURE__ */ jsx("p", { className: "py-2 text-[11px] text-destructive", children: "\u53EF\u7528\u7CFB\u7EDF\u7248\u672C\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" });
|
|
95
|
+
}
|
|
56
96
|
if (onlineNodes.length === 0) {
|
|
57
|
-
return /* @__PURE__ */ jsx("p", { className: "py-6 text-center text-body-sm text-muted-foreground", children: "\u6682\u65E0\u5728\u7EBF\u8282\u70B9\u3002\u8BF7\u5148\u542F\u52A8\u4E00\u4E2A\u8282\u70B9\uFF08\u672C\u673A\u8282\u70B9\u6216\u6CE8\u518C\u65B0\u8282\u70B9\uFF09\u540E\u518D\u521B\u5EFA\u8BBE\u5907\u3002" });
|
|
97
|
+
return /* @__PURE__ */ jsx("p", { className: "py-6 text-center text-body-sm text-muted-foreground", children: virtualOnly ? "\u6682\u65E0\u5DF2\u5B89\u88C5\u53EF\u7528\u865A\u62DF\u8BBE\u5907\u955C\u50CF\u7684\u5728\u7EBF\u8282\u70B9\u3002\u8BF7\u68C0\u67E5\u8282\u70B9\u5728\u7EBF\u72B6\u6001\u53CA\u955C\u50CF\u51C6\u5907\u60C5\u51B5\u3002" : "\u6682\u65E0\u5728\u7EBF\u8282\u70B9\u3002\u8BF7\u5148\u542F\u52A8\u4E00\u4E2A\u8282\u70B9\uFF08\u672C\u673A\u8282\u70B9\u6216\u6CE8\u518C\u65B0\u8282\u70B9\uFF09\u540E\u518D\u521B\u5EFA\u8BBE\u5907\u3002" });
|
|
58
98
|
}
|
|
59
99
|
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: groups.map(({ scope, rows }) => /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
60
100
|
/* @__PURE__ */ jsx("p", { className: "text-label-caps text-muted-foreground", children: SCOPE_META[scope].label }),
|
|
@@ -137,14 +177,16 @@ var GPU_OPTIONS = [
|
|
|
137
177
|
{ value: "host", label: "\u786C\u4EF6 GPU host(\u8282\u70B9\u9700 /dev/dri)" },
|
|
138
178
|
{ value: "guest", label: "\u8F6F\u4EF6\u6E32\u67D3 guest(\u65E0\u9700 GPU)" }
|
|
139
179
|
];
|
|
140
|
-
function VirtualSpecStep({ spec, onChange, nodeId }) {
|
|
180
|
+
function VirtualSpecStep({ spec, onChange, nodeId, onValidityChange }) {
|
|
141
181
|
const client = useClient();
|
|
142
182
|
const platform = spec.platform ?? "android";
|
|
143
183
|
const memory = spec.hardware?.memory_mb ?? 2048;
|
|
144
184
|
const [versions, setVersions] = useState([]);
|
|
145
|
-
const [loading, setLoading] = useState(
|
|
146
|
-
const [
|
|
147
|
-
const [
|
|
185
|
+
const [loading, setLoading] = useState(true);
|
|
186
|
+
const [catalogError, setCatalogError] = useState(false);
|
|
187
|
+
const [nodeState, setNodeState] = useState(null);
|
|
188
|
+
const [installedLoading, setInstalledLoading] = useState(true);
|
|
189
|
+
const selectedNode = nodeState && nodeState.id === nodeId ? nodeState.node : void 0;
|
|
148
190
|
const [catalog, setCatalog] = useState([]);
|
|
149
191
|
const [brand, setBrand] = useState("");
|
|
150
192
|
const patch = (p) => onChange({ ...spec, ...p });
|
|
@@ -173,31 +215,38 @@ function VirtualSpecStep({ spec, onChange, nodeId }) {
|
|
|
173
215
|
useEffect(() => {
|
|
174
216
|
let alive = true;
|
|
175
217
|
setLoading(true);
|
|
176
|
-
|
|
177
|
-
|
|
218
|
+
setCatalogError(false);
|
|
219
|
+
client.images.options().then((opts) => {
|
|
220
|
+
if (alive) {
|
|
221
|
+
setVersions(Array.isArray(opts) ? opts : []);
|
|
222
|
+
if (!Array.isArray(opts)) setCatalogError(true);
|
|
223
|
+
}
|
|
178
224
|
}).catch(() => {
|
|
179
|
-
if (alive)
|
|
225
|
+
if (alive) {
|
|
226
|
+
setVersions([]);
|
|
227
|
+
setCatalogError(true);
|
|
228
|
+
}
|
|
180
229
|
}).finally(() => {
|
|
181
230
|
if (alive) setLoading(false);
|
|
182
231
|
});
|
|
183
232
|
return () => {
|
|
184
233
|
alive = false;
|
|
185
234
|
};
|
|
186
|
-
}, [
|
|
235
|
+
}, [client]);
|
|
187
236
|
useEffect(() => {
|
|
188
237
|
if (!nodeId) {
|
|
189
|
-
|
|
238
|
+
setNodeState(null);
|
|
239
|
+
setInstalledLoading(false);
|
|
190
240
|
return;
|
|
191
241
|
}
|
|
192
242
|
let alive = true;
|
|
193
243
|
setInstalledLoading(true);
|
|
244
|
+
setNodeState(null);
|
|
194
245
|
client.nodes.list().then((nodes) => {
|
|
195
246
|
if (!alive) return;
|
|
196
|
-
|
|
197
|
-
const v = n?.reported_caps?.installed_images;
|
|
198
|
-
setInstalled(Array.isArray(v) ? v.filter((s) => typeof s === "string") : []);
|
|
247
|
+
setNodeState({ id: nodeId, node: nodes.find((x) => x.id === nodeId) });
|
|
199
248
|
}).catch(() => {
|
|
200
|
-
if (alive)
|
|
249
|
+
if (alive) setNodeState({ id: nodeId, error: true });
|
|
201
250
|
}).finally(() => {
|
|
202
251
|
if (alive) setInstalledLoading(false);
|
|
203
252
|
});
|
|
@@ -216,11 +265,21 @@ function VirtualSpecStep({ spec, onChange, nodeId }) {
|
|
|
216
265
|
alive = false;
|
|
217
266
|
};
|
|
218
267
|
}, [client]);
|
|
219
|
-
const availableVersions =
|
|
268
|
+
const availableVersions = availableVirtualImages(selectedNode, versions, platform);
|
|
269
|
+
const allowedPlatforms = availableVirtualPlatforms(selectedNode, versions);
|
|
270
|
+
const platformOptions = PLATFORM_OPTIONS.filter((option) => allowedPlatforms.includes(option.value));
|
|
220
271
|
const versionOptions = availableVersions.map((o) => ({ value: o.id, label: o.label }));
|
|
221
|
-
const versionsLoading = loading || installedLoading;
|
|
222
|
-
const noPlatformImages = versions.
|
|
272
|
+
const versionsLoading = loading || installedLoading || !!nodeId && nodeState?.id !== nodeId;
|
|
273
|
+
const noPlatformImages = !versions.some((image) => image.platform === platform);
|
|
223
274
|
const selectedImage = spec.image_id ?? "";
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
onValidityChange?.(!versionsLoading && availableVersions.some((image) => image.id === selectedImage));
|
|
277
|
+
}, [versionsLoading, selectedImage, nodeId, selectedNode, versions, platform, onValidityChange]);
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
if (!versionsLoading && allowedPlatforms.length > 0 && !allowedPlatforms.includes(platform)) {
|
|
280
|
+
setPlatform(allowedPlatforms[0]);
|
|
281
|
+
}
|
|
282
|
+
}, [versionsLoading, selectedNode, versions, platform]);
|
|
224
283
|
useEffect(() => {
|
|
225
284
|
if (versionsLoading) return;
|
|
226
285
|
if (!selectedImage && availableVersions.length === 1) {
|
|
@@ -262,15 +321,16 @@ function VirtualSpecStep({ spec, onChange, nodeId }) {
|
|
|
262
321
|
/* @__PURE__ */ jsx(
|
|
263
322
|
Select,
|
|
264
323
|
{
|
|
265
|
-
value: platform,
|
|
324
|
+
value: platformOptions.some((option) => option.value === platform) ? platform : "",
|
|
325
|
+
disabled: versionsLoading || platformOptions.length === 0,
|
|
266
326
|
onChange: (v) => setPlatform(v),
|
|
267
|
-
options:
|
|
327
|
+
options: platformOptions
|
|
268
328
|
}
|
|
269
329
|
)
|
|
270
330
|
] }),
|
|
271
331
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
272
332
|
/* @__PURE__ */ jsx("label", { className: "text-[11px] text-muted-foreground", children: "\u7CFB\u7EDF\u7248\u672C version" }),
|
|
273
|
-
versionsLoading ? /* @__PURE__ */ jsx("div", { className: "text-body-sm text-muted-foreground py-2", children: "\u6B63\u5728\u52A0\u8F7D\u53EF\u7528\u7248\u672C\u2026" }) : versionOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-body-sm text-muted-foreground py-2", children: noPlatformImages ? "\u8BE5\u5E73\u53F0\u6682\u65E0\u53EF\u7528\u7248\u672C\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u914D\u7F6E\u955C\u50CF\u3002" : "\u8BE5\u8282\u70B9\
|
|
333
|
+
versionsLoading ? /* @__PURE__ */ jsx("div", { className: "text-body-sm text-muted-foreground py-2", children: "\u6B63\u5728\u52A0\u8F7D\u53EF\u7528\u7248\u672C\u2026" }) : versionOptions.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-body-sm text-muted-foreground py-2", children: catalogError ? "\u7CFB\u7EDF\u7248\u672C\u5217\u8868\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" : nodeState?.error ? "\u8282\u70B9\u4FE1\u606F\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" : !selectedNode ? "\u8BE5\u8282\u70B9\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u8282\u70B9\u3002" : selectedNode.status !== "online" ? "\u8BE5\u8282\u70B9\u5DF2\u79BB\u7EBF\uFF0C\u8BF7\u9009\u62E9\u5728\u7EBF\u8282\u70B9\u3002" : !supportsVirtualPlatform(selectedNode, platform) ? "\u8BE5\u8282\u70B9\u4E0D\u652F\u6301\u6B64\u7C7B\u865A\u62DF\u8BBE\u5907\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u8282\u70B9\u3002" : noPlatformImages ? "\u8BE5\u5E73\u53F0\u6682\u65E0\u53EF\u7528\u7248\u672C\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u914D\u7F6E\u955C\u50CF\u3002" : "\u8BE5\u8282\u70B9\u6682\u65E0\u5339\u914D\u7684\u5DF2\u5B89\u88C5\u865A\u62DF\u8BBE\u5907\u955C\u50CF\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u8282\u70B9\u3002" }) : /* @__PURE__ */ jsx(
|
|
274
334
|
Select,
|
|
275
335
|
{
|
|
276
336
|
value: selectedImage,
|
|
@@ -1281,6 +1341,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1281
1341
|
const [step, setStep] = useState(0);
|
|
1282
1342
|
const [kind, setKind] = useState("virtual");
|
|
1283
1343
|
const [nodeId, setNodeId] = useState("");
|
|
1344
|
+
const [virtualSpecValid, setVirtualSpecValid] = useState(false);
|
|
1284
1345
|
const [spec, setSpec] = useState(emptySpec);
|
|
1285
1346
|
const [picked, setPicked] = useState(null);
|
|
1286
1347
|
const [busy, setBusy] = useState(false);
|
|
@@ -1294,6 +1355,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1294
1355
|
setStep(0);
|
|
1295
1356
|
setKind("virtual");
|
|
1296
1357
|
setNodeId("");
|
|
1358
|
+
setVirtualSpecValid(false);
|
|
1297
1359
|
setSpec(emptySpec);
|
|
1298
1360
|
setPicked(null);
|
|
1299
1361
|
setBusy(false);
|
|
@@ -1306,7 +1368,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1306
1368
|
const canNext = (() => {
|
|
1307
1369
|
if (step === 0) return true;
|
|
1308
1370
|
if (step === 1) return !!nodeId;
|
|
1309
|
-
if (step === 2) return kind === "virtual" ? !!spec.image_id : !!picked;
|
|
1371
|
+
if (step === 2) return kind === "virtual" ? virtualSpecValid && !!spec.image_id : !!picked;
|
|
1310
1372
|
return true;
|
|
1311
1373
|
})();
|
|
1312
1374
|
const enrollDiscovered = async (d) => {
|
|
@@ -1321,7 +1383,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1321
1383
|
}
|
|
1322
1384
|
};
|
|
1323
1385
|
const finish = async () => {
|
|
1324
|
-
if (kind === "virtual" && !spec.image_id) {
|
|
1386
|
+
if (kind === "virtual" && (!virtualSpecValid || !spec.image_id)) {
|
|
1325
1387
|
setError("\u8BF7\u9009\u62E9\u8BE5\u8282\u70B9\u5DF2\u5B89\u88C5\u7684\u7CFB\u7EDF\u7248\u672C\u540E\u518D\u521B\u5EFA\u3002");
|
|
1326
1388
|
return;
|
|
1327
1389
|
}
|
|
@@ -1406,8 +1468,11 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1406
1468
|
}
|
|
1407
1469
|
)
|
|
1408
1470
|
] }),
|
|
1409
|
-
step === 1 && /* @__PURE__ */ jsx(NodePicker, { value: nodeId, onChange:
|
|
1410
|
-
|
|
1471
|
+
step === 1 && /* @__PURE__ */ jsx(NodePicker, { value: nodeId, onChange: (id) => {
|
|
1472
|
+
setNodeId(id);
|
|
1473
|
+
setVirtualSpecValid(false);
|
|
1474
|
+
}, hidePlatform: kind === "real", virtualOnly: kind === "virtual" }),
|
|
1475
|
+
step === 2 && (kind === "virtual" ? /* @__PURE__ */ jsx(VirtualSpecStep, { spec, onChange: setSpec, nodeId, onValidityChange: setVirtualSpecValid }) : /* @__PURE__ */ jsx(RealDiscoverStep, { nodeId, picked, onPick: setPicked })),
|
|
1411
1476
|
step === 3 && !managedPending && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1412
1477
|
/* @__PURE__ */ jsxs("fieldset", { className: "space-y-2", children: [
|
|
1413
1478
|
/* @__PURE__ */ jsx("legend", { className: "text-sm font-medium", children: t("creation.network") }),
|
|
@@ -1462,7 +1527,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1462
1527
|
Button,
|
|
1463
1528
|
{
|
|
1464
1529
|
size: "sm",
|
|
1465
|
-
disabled: busy || !proxyOk || kind === "virtual" && !spec.image_id || kind === "virtual" && (!Number.isInteger(quantity) || quantity < 1 || quantity > 20),
|
|
1530
|
+
disabled: busy || !proxyOk || kind === "virtual" && (!virtualSpecValid || !spec.image_id) || kind === "virtual" && (!Number.isInteger(quantity) || quantity < 1 || quantity > 20),
|
|
1466
1531
|
onClick: finish,
|
|
1467
1532
|
children: busy ? "\u521B\u5EFA\u4E2D\u2026" : quantity > 1 ? `\u521B\u5EFA ${quantity} \u53F0` : "\u521B\u5EFA"
|
|
1468
1533
|
}
|
|
@@ -14,17 +14,19 @@ interface Props$4 {
|
|
|
14
14
|
value: string;
|
|
15
15
|
onChange: (nodeId: string) => void;
|
|
16
16
|
hidePlatform?: boolean;
|
|
17
|
+
virtualOnly?: boolean;
|
|
17
18
|
}
|
|
18
|
-
declare function NodePicker({ value, onChange, hidePlatform }: Props$4): react.JSX.Element;
|
|
19
|
+
declare function NodePicker({ value, onChange, hidePlatform, virtualOnly }: Props$4): react.JSX.Element;
|
|
19
20
|
|
|
20
21
|
interface Props$3 {
|
|
21
22
|
spec: ProvisionSpec;
|
|
22
23
|
onChange: (spec: ProvisionSpec) => void;
|
|
23
|
-
/** 选中的节点 id ——
|
|
24
|
-
*
|
|
24
|
+
/** 选中的节点 id —— 用于按该节点的虚拟 provider 和已装镜像
|
|
25
|
+
* 过滤可创建的平台及版本。 */
|
|
25
26
|
nodeId?: string;
|
|
27
|
+
onValidityChange?: (valid: boolean) => void;
|
|
26
28
|
}
|
|
27
|
-
declare function VirtualSpecStep({ spec, onChange, nodeId }: Props$3): react.JSX.Element;
|
|
29
|
+
declare function VirtualSpecStep({ spec, onChange, nodeId, onValidityChange }: Props$3): react.JSX.Element;
|
|
28
30
|
|
|
29
31
|
interface Props$2 {
|
|
30
32
|
spec: ProvisionSpec;
|
package/dist/ui/device-create.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AddWirelessDeviceDialog, DeviceCreate, NodePicker, ProxySpoofStep, RealDiscoverStep, VirtualSpecStep } from '../chunk-
|
|
1
|
+
export { AddWirelessDeviceDialog, DeviceCreate, NodePicker, ProxySpoofStep, RealDiscoverStep, VirtualSpecStep } from '../chunk-ROOOAG3E.js';
|
|
2
2
|
import '../chunk-SL6M6CC6.js';
|
|
3
3
|
import '../chunk-ZB5ET67B.js';
|
|
4
4
|
import '../chunk-LO3XD4T5.js';
|
package/dist/ui/devices.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { BulkInstallAppsDialog, DeleteDeviceDialog, DeviceCard, DeviceConnect, DeviceDetailDrawer, DeviceEditDialog, DeviceSelector, DeviceTerminal, DevicesPage, FileManager, FingerprintPanel, GroupMirrorModal, NodeRegister, RecycleBinPanel, RefreshParamsButton, RunScriptDialog, ScriptParamForm, SharedParamsForm, ShortcutBar, ShortcutEditDialog, ShortcutRunDialog, TagEditor, TaskAgentDialog, resolveSharedRow, variablesToParams } from '../chunk-
|
|
1
|
+
export { BulkInstallAppsDialog, DeleteDeviceDialog, DeviceCard, DeviceConnect, DeviceDetailDrawer, DeviceEditDialog, DeviceSelector, DeviceTerminal, DevicesPage, FileManager, FingerprintPanel, GroupMirrorModal, NodeRegister, RecycleBinPanel, RefreshParamsButton, RunScriptDialog, ScriptParamForm, SharedParamsForm, ShortcutBar, ShortcutEditDialog, ShortcutRunDialog, TagEditor, TaskAgentDialog, resolveSharedRow, variablesToParams } from '../chunk-QZLUQSLA.js';
|
|
2
2
|
import '../chunk-D7J4EQTA.js';
|
|
3
3
|
import '../chunk-XCYGBYFC.js';
|
|
4
4
|
import '../chunk-OEZFYKL6.js';
|
|
5
5
|
import '../chunk-E7WMHM63.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-ROOOAG3E.js';
|
|
7
7
|
import '../chunk-SL6M6CC6.js';
|
|
8
8
|
import '../chunk-ZB5ET67B.js';
|
|
9
9
|
import '../chunk-LO3XD4T5.js';
|
package/dist/ui/tasks.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SharedParamsForm, resolveSharedRow } from '../chunk-
|
|
1
|
+
import { SharedParamsForm, resolveSharedRow } from '../chunk-QZLUQSLA.js';
|
|
2
2
|
import '../chunk-D7J4EQTA.js';
|
|
3
3
|
import '../chunk-XCYGBYFC.js';
|
|
4
4
|
import '../chunk-OEZFYKL6.js';
|
|
5
5
|
import '../chunk-E7WMHM63.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-ROOOAG3E.js';
|
|
7
7
|
import '../chunk-SL6M6CC6.js';
|
|
8
8
|
import '../chunk-ZB5ET67B.js';
|
|
9
9
|
import { useAixT } from '../chunk-LO3XD4T5.js';
|