@windypro-rourou/dsh-logcat 0.2.4 → 0.2.5
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/lib/client.js +7 -0
- package/lib/index.js +2 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -108,6 +108,7 @@ window.__ModuleLoader__.load({
|
|
|
108
108
|
const [entries, setEntries] = useState([]);
|
|
109
109
|
const [connected, setConnected] = useState(false);
|
|
110
110
|
const [paused, setPaused] = useState(false);
|
|
111
|
+
const [currentPackage, setCurrentPackage] = useState("");
|
|
111
112
|
const [level, setLevel] = useState("");
|
|
112
113
|
const [keyword, setKeyword] = useState("");
|
|
113
114
|
const [autoScroll, setAutoScroll] = useState(true);
|
|
@@ -190,6 +191,8 @@ window.__ModuleLoader__.load({
|
|
|
190
191
|
appendEntries([frame.entry]);
|
|
191
192
|
} else if (frame.type === "device-state") {
|
|
192
193
|
setDevices(devicesRef.current.map((d) => d.serial === frame.serial ? { ...d, state: frame.state } : d));
|
|
194
|
+
} else if (frame.type === "package") {
|
|
195
|
+
setCurrentPackage(frame.package ?? "");
|
|
193
196
|
}
|
|
194
197
|
};
|
|
195
198
|
applyFrameRef.current = applyFrame;
|
|
@@ -240,6 +243,7 @@ window.__ModuleLoader__.load({
|
|
|
240
243
|
setAdbReady(body.ready === true);
|
|
241
244
|
setDevices(body.devices ?? []);
|
|
242
245
|
setStreaming(body.streaming ?? []);
|
|
246
|
+
setCurrentPackage(body.currentPackage ?? "");
|
|
243
247
|
devicesRef.current = body.devices ?? [];
|
|
244
248
|
if (serialRef.current === "" || !(body.devices ?? []).some((d) => d.serial === serialRef.current)) {
|
|
245
249
|
const first = (body.devices ?? []).find((d) => d.state === "device");
|
|
@@ -365,6 +369,9 @@ window.__ModuleLoader__.load({
|
|
|
365
369
|
h("span", null, h("b", null, adbReady ? "adb 就绪" : "未找到 adb"), " · " + (adbPath || "—")),
|
|
366
370
|
h("span", null, "设备 " + devices.length + " · 在线 " + devices.filter((d) => d.state === "device").length),
|
|
367
371
|
h("span", null, "显示 " + filtered.length + " / 缓冲 " + entries.length + " 行"),
|
|
372
|
+
currentPackage !== ""
|
|
373
|
+
? h("span", { title: "当前测试应用包名(agent 通过 logcat_set_package 设置)" }, "测试: " + currentPackage)
|
|
374
|
+
: null,
|
|
368
375
|
deviceState === "unauthorized"
|
|
369
376
|
? h("span", { style: { color: "#ef5350" } }, "⚠ 设备未授权 — 请在手机上点击“允许 USB 调试”")
|
|
370
377
|
: null,
|
package/lib/index.js
CHANGED
|
@@ -573,6 +573,8 @@ function logcatSetPackageTool(engine) {
|
|
|
573
573
|
async execute(args) {
|
|
574
574
|
const pkg = typeof args.package === 'string' ? args.package.trim() : ''
|
|
575
575
|
engine.currentPackage = pkg
|
|
576
|
+
// Let open panels reflect the current test package immediately.
|
|
577
|
+
engine.broadcast({ type: 'package', package: pkg })
|
|
576
578
|
return { package: pkg }
|
|
577
579
|
},
|
|
578
580
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windypro-rourou/dsh-logcat",
|
|
3
3
|
"description": "Android Logcat viewer for the dsh web GUI: auto-connects to any adb device in debug mode, live logcat stream with level/keyword filters, pause/clear/export, plus agent tools (logcat_recent). Hot-pluggable — mounted via ~/.dsh/cordis.patch.yml + a profile node_modules copy, no dsh source changes.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|
|
7
7
|
"engines": {
|