MCPcopy
hub / github.com/su-kaka/gcli2api / showMessageModal

Function showMessageModal

front/common.js:568–605  ·  view source on GitHub ↗
(title, message, type = 'info')

Source from the content-addressed store, hash-verified

566
567// 显示增强的消息模态框(支持链接高亮)
568function showMessageModal(title, message, type = 'info') {
569 // 创建模态框
570 const modal = document.createElement('div');
571 modal.className = 'message-modal-overlay';
572 modal.innerHTML = `
573 <div class="message-modal ${type}">
574 <div class="message-modal-header">
575 <h3>${title}</h3>
576 <button class="message-modal-close" onclick="this.closest('.message-modal-overlay').remove()">&times;</button>
577 </div>
578 <div class="message-modal-body">
579 ${linkifyText(message).replace(/\n/g, '<br>')}
580 </div>
581 <div class="message-modal-footer">
582 <button class="message-modal-btn" onclick="this.closest('.message-modal-overlay').remove()">关闭</button>
583 </div>
584 </div>
585 `;
586
587 // 添加到页面
588 document.body.appendChild(modal);
589
590 // 点击遮罩层关闭
591 modal.addEventListener('click', function(e) {
592 if (e.target === modal) {
593 modal.remove();
594 }
595 });
596
597 // ESC 键关闭
598 const escHandler = function(e) {
599 if (e.key === 'Escape') {
600 modal.remove();
601 document.removeEventListener('keydown', escHandler);
602 }
603 };
604 document.addEventListener('keydown', escHandler);
605}
606
607function getAuthHeaders() {
608 return {

Callers 9

showStatusFunction · 0.85
verifyProjectIdFunction · 0.85
testCredentialFunction · 0.85
configurePreviewChannelFunction · 0.85
batchVerifyProjectIdsFunction · 0.85
batchConfigurePreviewFunction · 0.85

Calls 1

linkifyTextFunction · 0.85

Tested by

no test coverage detected