djs-builder 0.7.9 → 0.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/views/logs.ejs CHANGED
@@ -465,6 +465,23 @@
465
465
  </div>
466
466
  </div>
467
467
 
468
+ <!-- Confirm Modal -->
469
+ <div class="modal" id="confirmModal">
470
+ <div class="modal-content" style="max-width: 400px;">
471
+ <div class="modal-header">
472
+ <h3 id="confirmTitle"><i class="ri-question-line" style="color: var(--warning);"></i> تأكيد</h3>
473
+ <button class="modal-close" onclick="closeConfirmModal()">&times;</button>
474
+ </div>
475
+ <div class="modal-body">
476
+ <p id="confirmMessage" style="font-size: 15px; text-align: center; padding: 10px 0;"></p>
477
+ </div>
478
+ <div class="modal-footer" style="justify-content: center;">
479
+ <button class="btn btn-secondary" onclick="closeConfirmModal()">إلغاء</button>
480
+ <button class="btn btn-primary" id="confirmBtn" style="background: var(--danger);"><i class="ri-check-line"></i> تأكيد</button>
481
+ </div>
482
+ </div>
483
+ </div>
484
+
468
485
  <div class="toast" id="toast"><i class="ri-checkbox-circle-line"></i> <span></span></div>
469
486
 
470
487
  <script>
@@ -480,6 +497,23 @@
480
497
  setTimeout(() => toast.classList.remove('show'), 3000);
481
498
  }
482
499
 
500
+ // Confirm Modal Functions
501
+ let confirmCallback = null;
502
+ function showConfirm(message, callback, title = 'تأكيد') {
503
+ document.getElementById('confirmMessage').textContent = message;
504
+ document.getElementById('confirmTitle').innerHTML = '<i class="ri-question-line" style="color: var(--warning);"></i> ' + title;
505
+ confirmCallback = callback;
506
+ document.getElementById('confirmModal').classList.add('show');
507
+ }
508
+ function closeConfirmModal() {
509
+ document.getElementById('confirmModal').classList.remove('show');
510
+ confirmCallback = null;
511
+ }
512
+ document.getElementById('confirmBtn').addEventListener('click', function() {
513
+ if (confirmCallback) confirmCallback();
514
+ closeConfirmModal();
515
+ });
516
+
483
517
  async function updateDefaultChannel(channelId) {
484
518
  if (!databaseEnabled) return;
485
519
  try {
@@ -569,20 +603,21 @@
569
603
  }
570
604
  }
571
605
 
572
- async function resetConfig() {
573
- if (!confirm('هل أنت متأكد من إعادة تعيين جميع إعدادات السجلات؟')) return;
574
- try {
575
- const res = await fetch(`/api/${guildId}/logs/reset`, { method: 'POST' });
576
- const data = await res.json();
577
- if (data.success) {
578
- showToast('تم إعادة تعيين الإعدادات');
579
- setTimeout(() => location.reload(), 1000);
580
- } else {
581
- showToast(data.error || 'حدث خطأ', 'error');
606
+ function resetConfig() {
607
+ showConfirm('هل أنت متأكد من إعادة تعيين جميع إعدادات السجلات؟', async () => {
608
+ try {
609
+ const res = await fetch(`/api/${guildId}/logs/reset`, { method: 'POST' });
610
+ const data = await res.json();
611
+ if (data.success) {
612
+ showToast('تم إعادة تعيين الإعدادات');
613
+ setTimeout(() => location.reload(), 1000);
614
+ } else {
615
+ showToast(data.error || 'حدث خطأ', 'error');
616
+ }
617
+ } catch (e) {
618
+ showToast('حدث خطأ في الاتصال', 'error');
582
619
  }
583
- } catch (e) {
584
- showToast('حدث خطأ في الاتصال', 'error');
585
- }
620
+ }, 'إعادة تعيين');
586
621
  }
587
622
  </script>
588
623
  </body>