Terminaaliin latauksen tilaindikaattori (spinner + vaihe)
Mallin latauksen aikana terminaalissa näkyy animoitu spinner ja nykyinen vaihe: WASM → tokenizer → malli (%) → rakennus → valmis. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3122,10 +3122,43 @@ Write the corrected code.`;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Kuuntele console.log-viestejä pipeline-vaiheiden seuraamiseksi
|
// Kuuntele console.log-viestejä pipeline-vaiheiden seuraamiseksi
|
||||||
|
// Terminaalin lataustilarivi — päivittyy dynaamisesti
|
||||||
|
function termLoadStatus(phase, detail) {
|
||||||
|
const term = document.getElementById('agent-terminal');
|
||||||
|
if (!term) return;
|
||||||
|
let statusLine = term.querySelector('.term-load-status');
|
||||||
|
if (!statusLine) {
|
||||||
|
statusLine = document.createElement('div');
|
||||||
|
statusLine.className = 'terminal-line term-load-status';
|
||||||
|
term.appendChild(statusLine);
|
||||||
|
}
|
||||||
|
const spinner = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
|
||||||
|
const frame = spinner[Math.floor(Date.now() / 100) % spinner.length];
|
||||||
|
statusLine.innerHTML = ` <span style="color:#d29922">${frame}</span> <span style="color:#8b949e">${phase}</span>${detail ? ` <span style="color:#58a6ff">${detail}</span>` : ''}`;
|
||||||
|
term.scrollTop = term.scrollHeight;
|
||||||
|
}
|
||||||
|
function termLoadDone() {
|
||||||
|
const term = document.getElementById('agent-terminal');
|
||||||
|
if (!term) return;
|
||||||
|
const statusLine = term.querySelector('.term-load-status');
|
||||||
|
if (statusLine) statusLine.remove();
|
||||||
|
}
|
||||||
|
|
||||||
const origCodeLog = console.log;
|
const origCodeLog = console.log;
|
||||||
const codeLogListener = (...args) => {
|
const codeLogListener = (...args) => {
|
||||||
const msg = args.join(' ');
|
const msg = args.join(' ');
|
||||||
if (msg.includes('[Coder]') || msg.includes('[Storage]') || msg.includes('Burn Wasm') || msg.includes('Kipinä Agent Node')) {
|
if (msg.includes('[Coder]') || msg.includes('[Storage]') || msg.includes('Burn Wasm') || msg.includes('Kipinä Agent Node')) {
|
||||||
|
// Terminaalin lataustilapäivitys
|
||||||
|
if (msg.includes('Agent Node käynnistyy')) termLoadStatus('WASM alustettu');
|
||||||
|
if (msg.includes('Ladataan') && msg.includes('tokenizer')) termLoadStatus('Ladataan tokenizer...');
|
||||||
|
if (msg.includes('tokenizer') && (msg.includes('löytyi') || msg.includes('tallennettu'))) termLoadStatus('Tokenizer ✓');
|
||||||
|
if (msg.includes('Ladataan') && msg.includes('gguf')) termLoadStatus('Ladataan mallia...');
|
||||||
|
const dlMatch = msg.match(/lataus: (\d+)%/);
|
||||||
|
if (dlMatch) termLoadStatus('Ladataan mallia...', dlMatch[1] + '%');
|
||||||
|
if (msg.includes('tallennettu') && msg.includes('gguf')) termLoadStatus('Malli tallennettu');
|
||||||
|
if (msg.includes('Rakennetaan')) termLoadStatus('Rakennetaan mallia...');
|
||||||
|
if (msg.includes('Malli ladattu')) termLoadDone();
|
||||||
|
|
||||||
if (msg.includes('Burn Wasm')) setStep('step-wasm', 'active');
|
if (msg.includes('Burn Wasm')) setStep('step-wasm', 'active');
|
||||||
if (msg.includes('Agent Node käynnistyy')) { setStep('step-wasm', 'done'); }
|
if (msg.includes('Agent Node käynnistyy')) { setStep('step-wasm', 'done'); }
|
||||||
// Tokenizer: [Coder] tai [Storage] -prefiksi
|
// Tokenizer: [Coder] tai [Storage] -prefiksi
|
||||||
|
|||||||
Reference in New Issue
Block a user