Spaces:
Sleeping
Sleeping
Upload 5 files
#2
by e2dew32 - opened
app.py
CHANGED
|
@@ -208,6 +208,15 @@ HTML_CONTENT = '''<!DOCTYPE html>
|
|
| 208 |
if (data.commands && data.commands.length > 0) {
|
| 209 |
data.commands.forEach(cmd => executeCommand(cmd));
|
| 210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
} catch(e) { console.error(e); }
|
| 212 |
}
|
| 213 |
|
|
|
|
| 208 |
if (data.commands && data.commands.length > 0) {
|
| 209 |
data.commands.forEach(cmd => executeCommand(cmd));
|
| 210 |
}
|
| 211 |
+
// 获取命令结果
|
| 212 |
+
const resultResp = await fetch('/api/commands?client_id=' + selectedClient.id);
|
| 213 |
+
const commands = await resultResp.json();
|
| 214 |
+
if (commands.length > 0) {
|
| 215 |
+
const latest = commands[0];
|
| 216 |
+
if (latest.result && latest.status === 'completed') {
|
| 217 |
+
document.getElementById('commandOutput').textContent = latest.result;
|
| 218 |
+
}
|
| 219 |
+
}
|
| 220 |
} catch(e) { console.error(e); }
|
| 221 |
}
|
| 222 |
|