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

Method show

static/js/utils.js:22–42  ·  view source on GitHub ↗
(message, type = 'info', duration = 4000)

Source from the content-addressed store, hash-verified

20 }
21
22 show(message, type = 'info', duration = 4000) {
23 const toast = document.createElement('div');
24 toast.className = `toast ${type}`;
25
26 const icon = this.getIcon(type);
27 toast.innerHTML = `
28 <span class="toast-icon">${icon}</span>
29 <span class="toast-message">${this.escapeHtml(message)}</span>
30 <button class="toast-close" onclick="this.parentElement.remove()">&times;</button>
31 `;
32
33 this.container.appendChild(toast);
34
35 // 自动移除
36 setTimeout(() => {
37 toast.style.animation = 'slideOut 0.3s ease forwards';
38 setTimeout(() => toast.remove(), 300);
39 }, duration);
40
41 return toast;
42 }
43
44 getIcon(type) {
45 const icons = {

Callers 14

successMethod · 0.95
errorMethod · 0.95
warningMethod · 0.95
infoMethod · 0.95
loadLogsFunction · 0.45
cleanupLogsFunction · 0.45
clearAllLogsFunction · 0.45
startRunFunction · 0.45
saveScheduleFunction · 0.45
runNowFunction · 0.45
executeRepairFunction · 0.45
previewRepairCenterFunction · 0.45

Calls 2

getIconMethod · 0.95
escapeHtmlMethod · 0.95

Tested by

no test coverage detected