MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / renderAutoQuickRefreshRuntime

Function renderAutoQuickRefreshRuntime

static/js/accounts.js:448–478  ·  view source on GitHub ↗
(runtime)

Source from the content-addressed store, hash-verified

446}
447
448function renderAutoQuickRefreshRuntime(runtime) {
449 const info = runtime || {};
450 const logs = Array.isArray(info.logs) ? info.logs : [];
451 if (logs.length === 0) {
452 return `
453 <div class="auto-quick-refresh-log-title">执行日志</div>
454 <div class="auto-quick-refresh-log-empty">暂无执行日志</div>
455 `;
456 }
457 const rows = logs
458 .slice(-20)
459 .reverse()
460 .map((item) => {
461 const levelRaw = String(item?.level || 'info').trim().toLowerCase();
462 const level = ['success', 'warning', 'error', 'info'].includes(levelRaw) ? levelRaw : 'info';
463 const timeText = formatSchedulerTime(item?.time);
464 const message = String(item?.message || '').trim() || '-';
465 return `
466 <div class="auto-quick-refresh-log-item level-${level}">
467 <span class="log-time">${escapeHtml(timeText)}</span>
468 <span class="log-level">${escapeHtml(level)}</span>
469 <span class="log-message">${escapeHtml(message)}</span>
470 </div>
471 `;
472 })
473 .join('');
474 return `
475 <div class="auto-quick-refresh-log-title">执行日志</div>
476 <div class="auto-quick-refresh-log-list">${rows}</div>
477 `;
478}
479
480function updateAutoQuickRefreshButton() {
481 const btn = elements.autoQuickRefreshSettingsBtn;

Callers 1

fillAutoQuickRefreshFormFunction · 0.85

Calls 2

formatSchedulerTimeFunction · 0.85
escapeHtmlFunction · 0.70

Tested by

no test coverage detected