Hub-yhteyden tila omaksi status-palkiksi terminaalin yläpuolelle (agents-näkymä)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1090,9 +1090,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="terminal-panel" id="agent-terminal" style="margin-top: 20px;">
|
<div id="agent-hub-status" style="margin-top:20px;padding:8px 14px;background:#0d1117;border:1px solid var(--border-color);border-radius:6px 6px 0 0;font-family:'Courier New',monospace;font-size:13px;display:flex;align-items:center;gap:8px">
|
||||||
<div class="terminal-line"><span class="terminal-prompt">$</span> kpn hub connect wss://localhost</div>
|
<span id="agent-hub-dot" style="width:8px;height:8px;border-radius:50%;background:#d29922;display:inline-block"></span>
|
||||||
<div class="terminal-line" style="color:#a5d6ff"> ✓ Yhdistetty Kipinä Hubiin</div>
|
<span style="color:#8b949e">Hub:</span>
|
||||||
|
<span id="agent-hub-label" style="color:#d29922">Yhdistetään...</span>
|
||||||
|
</div>
|
||||||
|
<div class="terminal-panel" id="agent-terminal" style="margin-top:0;border-top:none;border-radius:0">
|
||||||
</div>
|
</div>
|
||||||
<div style="display:flex;align-items:center;background:#010409;border:1px solid var(--border-color);border-top:none;border-radius:0 0 6px 6px;padding:8px 12px;font-family:'Courier New',monospace;font-size:14px">
|
<div style="display:flex;align-items:center;background:#010409;border:1px solid var(--border-color);border-top:none;border-radius:0 0 6px 6px;padding:8px 12px;font-family:'Courier New',monospace;font-size:14px">
|
||||||
<span style="color:#d29922;margin-right:8px;flex-shrink:0">$</span>
|
<span style="color:#d29922;margin-right:8px;flex-shrink:0">$</span>
|
||||||
@@ -1634,6 +1637,12 @@
|
|||||||
const uiSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws`);
|
const uiSocket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws`);
|
||||||
window._uiSocket = uiSocket;
|
window._uiSocket = uiSocket;
|
||||||
uiSocket.onopen = async () => {
|
uiSocket.onopen = async () => {
|
||||||
|
// Päivitetään agents-näkymän hub-status
|
||||||
|
const hubDot = document.getElementById('agent-hub-dot');
|
||||||
|
const hubLabel = document.getElementById('agent-hub-label');
|
||||||
|
if (hubDot) hubDot.style.background = '#3fb950';
|
||||||
|
if (hubLabel) { hubLabel.textContent = 'Yhdistetty'; hubLabel.style.color = '#3fb950'; }
|
||||||
|
|
||||||
// Päivitetään molemmat statukset
|
// Päivitetään molemmat statukset
|
||||||
const el = document.getElementById('node-status');
|
const el = document.getElementById('node-status');
|
||||||
el.textContent = 'Connected';
|
el.textContent = 'Connected';
|
||||||
@@ -1681,6 +1690,11 @@
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
uiSocket.onclose = () => {
|
uiSocket.onclose = () => {
|
||||||
|
const hubDot = document.getElementById('agent-hub-dot');
|
||||||
|
const hubLabel = document.getElementById('agent-hub-label');
|
||||||
|
if (hubDot) hubDot.style.background = '#f85149';
|
||||||
|
if (hubLabel) { hubLabel.textContent = 'Yhteys katkennut'; hubLabel.style.color = '#f85149'; }
|
||||||
|
|
||||||
const el = document.getElementById('node-status');
|
const el = document.getElementById('node-status');
|
||||||
el.textContent = 'Disconnected';
|
el.textContent = 'Disconnected';
|
||||||
el.style.color = '#f85149';
|
el.style.color = '#f85149';
|
||||||
|
|||||||
Reference in New Issue
Block a user