mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 17:59:50 +02:00
feat(adb/server): include offline devices
This commit is contained in:
parent
418971cdbd
commit
ec1cedea65
1 changed files with 10 additions and 4 deletions
|
@ -45,8 +45,12 @@ export class AdbServerClient {
|
||||||
|
|
||||||
const parts = line.split(" ").filter(Boolean);
|
const parts = line.split(" ").filter(Boolean);
|
||||||
const serial = parts[0]!;
|
const serial = parts[0]!;
|
||||||
const status = parts[1]!;
|
const state = parts[1]!;
|
||||||
if (status !== "device" && status !== "unauthorized") {
|
if (
|
||||||
|
state !== "unauthroized" &&
|
||||||
|
state !== "offline" &&
|
||||||
|
state !== "device"
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +80,7 @@ export class AdbServerClient {
|
||||||
}
|
}
|
||||||
devices.push({
|
devices.push({
|
||||||
serial,
|
serial,
|
||||||
authenticating: status === "unauthorized",
|
state,
|
||||||
product,
|
product,
|
||||||
model,
|
model,
|
||||||
device,
|
device,
|
||||||
|
@ -536,9 +540,11 @@ export namespace AdbServerClient {
|
||||||
| { tcp: true }
|
| { tcp: true }
|
||||||
| undefined;
|
| undefined;
|
||||||
|
|
||||||
|
export type ConnectionState = "unauthroized" | "offline" | "device";
|
||||||
|
|
||||||
export interface Device {
|
export interface Device {
|
||||||
serial: string;
|
serial: string;
|
||||||
authenticating: boolean;
|
state: ConnectionState;
|
||||||
product?: string | undefined;
|
product?: string | undefined;
|
||||||
model?: string | undefined;
|
model?: string | undefined;
|
||||||
device?: string | undefined;
|
device?: string | undefined;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue