[deploy] Clean automation renderer strings
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 37s
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 37s
This commit is contained in:
@@ -1618,22 +1618,22 @@ router.get('/', (req, res) => {
|
||||
if (!list) return;
|
||||
list.innerHTML = '';
|
||||
if (!automationCache.length) {
|
||||
list.innerHTML = '<div class=\"ticket-empty\">Keine Regeln.</div>';
|
||||
list.innerHTML = '<div class="ticket-empty">Keine Regeln.</div>';
|
||||
return;
|
||||
}
|
||||
automationCache.forEach((r) => {
|
||||
const row = document.createElement('div');
|
||||
row.className = 'ticket-list-item';
|
||||
row.innerHTML =
|
||||
'<div class=\"ticket-item-top\"><div class=\"ticket-title\">' +
|
||||
'<div class="ticket-item-top"><div class="ticket-title">' +
|
||||
(r.name || 'Regel') +
|
||||
'</div><div class=\"ticket-status-badge\">' +
|
||||
'</div><div class="ticket-status-badge">' +
|
||||
(r.active ? 'aktiv' : 'inaktiv') +
|
||||
'</div></div>' +
|
||||
'<div class=\"ticket-meta\">Condition: ' +
|
||||
'<div class="ticket-meta">Condition: ' +
|
||||
JSON.stringify(r.condition || {}) +
|
||||
'</div>' +
|
||||
'<div class=\"ticket-meta\">Action: ' +
|
||||
'<div class="ticket-meta">Action: ' +
|
||||
JSON.stringify(r.action || {}) +
|
||||
'</div>';
|
||||
const actions = document.createElement('div');
|
||||
@@ -1644,14 +1644,14 @@ router.get('/', (req, res) => {
|
||||
edit.addEventListener('click', () => fillAutomationForm(r));
|
||||
const del = document.createElement('button');
|
||||
del.className = 'danger-btn';
|
||||
del.textContent = 'LÃÂöschen';
|
||||
del.textContent = 'Loeschen';
|
||||
del.addEventListener('click', async () => {
|
||||
const res = await fetch('/api/automations/' + r.id, {
|
||||
method: 'DELETE',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ guildId: currentGuild })
|
||||
});
|
||||
showToast(res.ok ? 'Regel gelÃÂöscht' : 'LÃÂöschen fehlgeschlagen', !res.ok);
|
||||
showToast(res.ok ? 'Regel geloescht' : 'Loeschen fehlgeschlagen', !res.ok);
|
||||
if (res.ok) loadAutomations();
|
||||
});
|
||||
actions.appendChild(edit);
|
||||
@@ -1660,8 +1660,7 @@ router.get('/', (req, res) => {
|
||||
list.appendChild(row);
|
||||
});
|
||||
}
|
||||
|
||||
function fillAutomationForm(rule) {
|
||||
function fillAutomationForm(rule) {
|
||||
document.getElementById('automationId').value = rule.id || '';
|
||||
document.getElementById('automationName').value = rule.name || '';
|
||||
document.getElementById('automationConditionType').value =
|
||||
|
||||
Reference in New Issue
Block a user