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/README.md +10 -6
- package/function/dash.js +290 -39
- package/function/function.js +50 -39
- package/function/level.js +337 -10
- package/handler/starter.js +34 -5
- package/package.json +2 -2
- package/views/dashboard.ejs +52 -18
- package/views/levels.ejs +671 -32
- package/views/logs.ejs +48 -13
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()">×</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
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
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
|
-
}
|
|
584
|
-
showToast('حدث خطأ في الاتصال', 'error');
|
|
585
|
-
}
|
|
620
|
+
}, 'إعادة تعيين');
|
|
586
621
|
}
|
|
587
622
|
</script>
|
|
588
623
|
</body>
|