Spaces:
Runtime error
Runtime error
Update dashboard.html
Browse files- dashboard.html +3 -20
dashboard.html
CHANGED
|
@@ -581,20 +581,10 @@ body {
|
|
| 581 |
<label style="display:block; font-size:13px; color:var(--text-dim); margin-bottom:8px">Command Prefix</label>
|
| 582 |
<div style="display:flex; gap:10px">
|
| 583 |
<input type="text" id="config-prefix" placeholder="!" style="width:100px; padding:12px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); color:white; font-size:16px; outline:none">
|
|
|
|
| 584 |
</div>
|
| 585 |
-
<p style="font-size:12px; color:var(--text-dim); margin-top:10px">The prefix used to trigger message-based commands.</p>
|
| 586 |
</div>
|
| 587 |
-
|
| 588 |
-
<div style="margin-bottom: 20px;">
|
| 589 |
-
<label style="display:block; font-size:13px; color:var(--text-dim); margin-bottom:8px">Timezone Offset (UTC)</label>
|
| 590 |
-
<div style="display:flex; gap:10px">
|
| 591 |
-
<input type="number" id="config-timezone" placeholder="0" style="width:100px; padding:12px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); color:white; font-size:16px; outline:none">
|
| 592 |
-
<button class="invite-btn" onclick="detectTimezone()" style="background:var(--bg-card); color:var(--text-dim); border:1px solid var(--border); padding:0 15px; font-size:12px">Detect My Timezone</button>
|
| 593 |
-
</div>
|
| 594 |
-
<p style="font-size:12px; color:var(--text-dim); margin-top:10px">Set this to your server's timezone (e.g. 3 for UTC+3). This ensures match times show correctly for everyone.</p>
|
| 595 |
-
</div>
|
| 596 |
-
|
| 597 |
-
<button class="invite-btn" onclick="saveConfig()" style="background:var(--accent); color:white; padding:12px 24px; width:100%">Save All Changes</button>
|
| 598 |
</div>
|
| 599 |
</div>
|
| 600 |
</div>
|
|
@@ -718,19 +708,17 @@ function openServerSettings(id, name) {
|
|
| 718 |
.then(r => r.json())
|
| 719 |
.then(data => {
|
| 720 |
document.getElementById('config-prefix').value = data.prefix || '!';
|
| 721 |
-
document.getElementById('config-timezone').value = data.timezone || 0;
|
| 722 |
});
|
| 723 |
}
|
| 724 |
|
| 725 |
function saveConfig() {
|
| 726 |
if (!activeGuildId) return;
|
| 727 |
const prefix = document.getElementById('config-prefix').value;
|
| 728 |
-
const timezone = parseInt(document.getElementById('config-timezone').value) || 0;
|
| 729 |
|
| 730 |
fetch('/api/config/' + activeGuildId, {
|
| 731 |
method: 'POST',
|
| 732 |
headers: { 'Content-Type': 'application/json' },
|
| 733 |
-
body: JSON.stringify({ prefix
|
| 734 |
})
|
| 735 |
.then(r => r.json())
|
| 736 |
.then(data => {
|
|
@@ -742,11 +730,6 @@ function saveConfig() {
|
|
| 742 |
}).catch(() => alert('❌ Network error saving settings.'));
|
| 743 |
}
|
| 744 |
|
| 745 |
-
function detectTimezone() {
|
| 746 |
-
const offset = -(new Date().getTimezoneOffset() / 60);
|
| 747 |
-
document.getElementById('config-timezone').value = offset;
|
| 748 |
-
}
|
| 749 |
-
|
| 750 |
function loadCommands() {
|
| 751 |
fetch('/api/commands')
|
| 752 |
.then(r => r.json())
|
|
|
|
| 581 |
<label style="display:block; font-size:13px; color:var(--text-dim); margin-bottom:8px">Command Prefix</label>
|
| 582 |
<div style="display:flex; gap:10px">
|
| 583 |
<input type="text" id="config-prefix" placeholder="!" style="width:100px; padding:12px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); color:white; font-size:16px; outline:none">
|
| 584 |
+
<button class="invite-btn" onclick="saveConfig()" style="background:var(--accent); color:white; padding:0 24px">Save Changes</button>
|
| 585 |
</div>
|
| 586 |
+
<p style="font-size:12px; color:var(--text-dim); margin-top:10px">The prefix used to trigger message-based commands (e.g. ! or . or ?)</p>
|
| 587 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 588 |
</div>
|
| 589 |
</div>
|
| 590 |
</div>
|
|
|
|
| 708 |
.then(r => r.json())
|
| 709 |
.then(data => {
|
| 710 |
document.getElementById('config-prefix').value = data.prefix || '!';
|
|
|
|
| 711 |
});
|
| 712 |
}
|
| 713 |
|
| 714 |
function saveConfig() {
|
| 715 |
if (!activeGuildId) return;
|
| 716 |
const prefix = document.getElementById('config-prefix').value;
|
|
|
|
| 717 |
|
| 718 |
fetch('/api/config/' + activeGuildId, {
|
| 719 |
method: 'POST',
|
| 720 |
headers: { 'Content-Type': 'application/json' },
|
| 721 |
+
body: JSON.stringify({ prefix })
|
| 722 |
})
|
| 723 |
.then(r => r.json())
|
| 724 |
.then(data => {
|
|
|
|
| 730 |
}).catch(() => alert('❌ Network error saving settings.'));
|
| 731 |
}
|
| 732 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 733 |
function loadCommands() {
|
| 734 |
fetch('/api/commands')
|
| 735 |
.then(r => r.json())
|