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

Function confirm

static/js/utils.js:711–752  ·  view source on GitHub ↗
(message, title = '确认操作')

Source from the content-addressed store, hash-verified

709// ============================================
710
711function confirm(message, title = '确认操作') {
712 return new Promise((resolve) => {
713 const modal = document.createElement('div');
714 modal.className = 'modal active';
715 modal.innerHTML = `
716 <div class="modal-content" style="max-width: 400px;">
717 <div class="modal-header">
718 <h3>${title}</h3>
719 </div>
720 <div class="modal-body">
721 <p style="margin-bottom: var(--spacing-lg);">${message}</p>
722 <div class="form-actions" style="margin-top: 0; padding-top: 0; border-top: none;">
723 <button class="btn btn-secondary" id="confirm-cancel">取消</button>
724 <button class="btn btn-danger" id="confirm-ok">确认</button>
725 </div>
726 </div>
727 </div>
728 `;
729
730 document.body.appendChild(modal);
731
732 const cancelBtn = modal.querySelector('#confirm-cancel');
733 const okBtn = modal.querySelector('#confirm-ok');
734
735 cancelBtn.onclick = () => {
736 modal.remove();
737 resolve(false);
738 };
739
740 okBtn.onclick = () => {
741 modal.remove();
742 resolve(true);
743 };
744
745 modal.onclick = (e) => {
746 if (e.target === modal) {
747 modal.remove();
748 resolve(false);
749 }
750 };
751 });
752}
753
754// ============================================
755// 复制到剪贴板

Callers 15

handleBatchRefreshFunction · 0.85
deleteAccountFunction · 0.85
handleBatchDeleteFunction · 0.85
handleBatchUploadCpaFunction · 0.85
handleBatchUploadSub2ApiFunction · 0.85
deleteSelectedTemplateFunction · 0.85
cancelEfunCardFunction · 0.85
deleteBindCardTaskFunction · 0.85
cleanupLogsFunction · 0.85
clearAllLogsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected