@rubytech/taskmaster 1.0.96 → 1.0.97
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/build-info.json +3 -3
- package/dist/control-ui/assets/{index-lbNnMWBM.js → index-CfNT98JU.js} +65 -55
- package/dist/control-ui/assets/index-CfNT98JU.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/gateway/server-methods/wifi.js +34 -0
- package/package.json +1 -1
- package/dist/control-ui/assets/index-lbNnMWBM.js.map +0 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Taskmaster Control</title>
|
|
7
7
|
<meta name="color-scheme" content="dark light" />
|
|
8
8
|
<link rel="icon" type="image/png" href="./favicon.png" />
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-CfNT98JU.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-6WdtDXJj.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
@@ -199,4 +199,38 @@ export const wifiHandlers = {
|
|
|
199
199
|
respond(false, undefined, errorShape(ErrorCodes.UNAVAILABLE, message));
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
|
+
/**
|
|
203
|
+
* Disconnect from the current WiFi network.
|
|
204
|
+
*/
|
|
205
|
+
"wifi.disconnect": async ({ respond, context }) => {
|
|
206
|
+
if (!requireLinux(respond))
|
|
207
|
+
return;
|
|
208
|
+
try {
|
|
209
|
+
if (!(await nmcliAvailable())) {
|
|
210
|
+
respond(false, undefined, errorShape(ErrorCodes.UNAVAILABLE, "NetworkManager (nmcli) is not installed"));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
// Find the active WiFi connection name
|
|
214
|
+
const { stdout: connStdout } = await runExec("nmcli", ["-t", "-f", "NAME,TYPE,DEVICE", "con", "show", "--active"], { timeoutMs: 5_000 });
|
|
215
|
+
let connectionName = null;
|
|
216
|
+
for (const line of connStdout.split("\n")) {
|
|
217
|
+
// Format: NAME:TYPE:DEVICE — look for wifi type on wlan0
|
|
218
|
+
const parts = line.split(":");
|
|
219
|
+
if (parts.length >= 3 && parts[1]?.includes("wireless") && parts[2]?.startsWith("wlan")) {
|
|
220
|
+
connectionName = parts[0];
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (!connectionName) {
|
|
225
|
+
respond(true, { disconnected: true }); // Already disconnected
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
await runExec("nmcli", ["con", "down", connectionName], { timeoutMs: 10_000 });
|
|
229
|
+
respond(true, { disconnected: true });
|
|
230
|
+
}
|
|
231
|
+
catch (err) {
|
|
232
|
+
context.logGateway.warn(`wifi.disconnect failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
233
|
+
respond(false, undefined, errorShape(ErrorCodes.UNAVAILABLE, "Failed to disconnect from WiFi"));
|
|
234
|
+
}
|
|
235
|
+
},
|
|
202
236
|
};
|