mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
Fix network map not opening from chat/voice
Two issues: 1. NM_OPEN_RE regex was too narrow — phrases like "show me the network", "open the network", "show network status" did not match, so they fell through to the API which returned text but never opened the map. Broadened regex to catch natural network-related phrases. 2. When the network_scan intent IS triggered via API, the map never opened because the API response handler only processed reply/arc_job. chat.php now returns open_network_map:true for network_scan intent, and the client calls openNetMap() when that flag is present. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1958,4 +1958,5 @@ echo json_encode([
|
||||
'session_id' => $sessionId,
|
||||
'timestamp' => date('c'),
|
||||
'arc_job' => $arcJobId,
|
||||
'open_network_map' => ($source === 'intent:network_scan'),
|
||||
]);
|
||||
|
||||
@@ -2107,7 +2107,7 @@ var NM_RINGS=[
|
||||
{name:'devices', label:'DEVICES', rFrac:0.62, speed:-0.002, rgb:'0,160,200', nodeR:14, cap:14 },
|
||||
{name:'network', label:'NETWORK', rFrac:0.82, speed:0.0015, rgb:'0,110,170', nodeR:11, cap:28 },
|
||||
];
|
||||
var NM_OPEN_RE = /\b(show|open|display|launch|pull\s*up|bring\s*up)\b.*\b(network\s*(map|topology|viz|visual|graph)|topology|node\s*map)\b|\bnetwork\s*(map|topology|viz|visual|graph)\b/i;
|
||||
var NM_OPEN_RE = /\b(show|open|display|launch|pull\s*up|bring\s*up)\b.*\b(network(\s*(map|topology|viz|visual|graph|panel|status|scan|view|overlay))?|topology|node\s*map)\b|\bnetwork\s*(map|topology|viz|visual|graph)\b|\b(show|open|display|launch|pull\s*up|bring\s*up)\s+(?:me\s+)?(?:the\s+)?network\b/i;
|
||||
var NM_CLOSE_RE = /\b(close|hide|dismiss|exit|collapse)\b.*\b(network|map|topology|overlay)\b|\b(close|hide|dismiss)\s*map\b/i;
|
||||
|
||||
function _nmClassify(d){
|
||||
@@ -3418,6 +3418,7 @@ async function sendMessage() {
|
||||
addMessage('jarvis', data.reply);
|
||||
speak(data.reply);
|
||||
}
|
||||
if (data.open_network_map) { openNetMap(); }
|
||||
if (data.arc_job) { onArcJobStarted(data.arc_job, data.source || ''); }
|
||||
} catch(e) {
|
||||
const bubble = document.getElementById('thinking-bubble');
|
||||
|
||||
Reference in New Issue
Block a user