jude/orphan-reminders #1

Merged
jude merged 10 commits from jude/orphan-reminders into next 2023-09-16 17:09:34 +00:00
4 changed files with 50 additions and 65 deletions
Showing only changes of commit b225ad7e45 - Show all commits

View File

@ -706,16 +706,32 @@ div.reminderError .errorIcon {
margin-right: 12px;
}
div.reminderError .errorIcon.deleted {
div.reminderError .errorIcon .fas {
display: none
}
div.reminderError[data-case="deleted"] .errorIcon {
background-color: #e7e5e4;
}
div.reminderError .errorIcon.success {
div.reminderError[data-case="failed"] .errorIcon {
background-color: #fecaca;
}
div.reminderError[data-case="sent"] .errorIcon {
background-color: #d9f99d;
}
div.reminderError .errorIcon.errored {
background-color: #fecaca;
div.reminderError[data-case="deleted"] .errorIcon .fas.fa-trash {
display: block;
}
div.reminderError[data-case="failed"] .errorIcon .fas.fa-exclamation-triangle {
display: block;
}
div.reminderError[data-case="sent"] .errorIcon .fas.fa-check {
display: block;
}
div.reminderError .errorHead .reminderName {

View File

@ -1,6 +1,6 @@
function loadErrors() {
return fetch(
`/dashboard/api/guild/${guildId()}/reminders?status=deleted,sent,error`
`/dashboard/api/guild/${guildId()}/reminders?status=deleted,sent,failed`
).then((response) => response.json());
}
@ -9,9 +9,20 @@ document.addEventListener("paneLoad", (ev) => {
return;
}
// Load errors
document.querySelectorAll(".reminderError").forEach((el) => el.remove());
const template = document.getElementById("reminderError");
const container = document.getElementById("reminderLog");
loadErrors().then((res) => {
console.log(res);
for (const reminder of res) {
const newRow = template.content.cloneNode(true);
newRow.querySelector(".reminderName").textContent = reminder.name;
newRow.querySelector(".reminderError").dataset["case"] = reminder.status;
container.appendChild(newRow);
}
});
$loader.classList.add("is-hidden");

View File

@ -1,51 +1,5 @@
<div>
<div class="reminderError">
<div class="errorHead">
<div class="errorIcon deleted">
<span class="icon">
<i class="fas fa-trash"></i>
</span>
</div>
<div class="reminderName">
Reminder
</div>
<div class="reminderTime">
<div id="reminderLog">
</div>
</div>
</div>
<div class="reminderError">
<div class="errorHead">
<div class="errorIcon errored">
<span class="icon">
<i class="fas fa-exclamation-triangle"></i>
</span>
</div>
<div class="reminderName">
Reminder
</div>
<div class="reminderTime">
</div>
</div>
</div>
<div class="reminderError">
<div class="errorHead">
<div class="errorIcon success">
<span class="icon">
<i class="fas fa-check"></i>
</span>
</div>
<div class="reminderName">
Reminder
</div>
<div class="reminderTime">
</div>
</div>
</div>
</div>
<script src="/static/js/reminder_errors.js"></script>

View File

@ -1,13 +1,17 @@
<div class="reminderError">
<div class="errorIcon">
<span>
<i class="fas fa-trash"></i>
</span>
</div>
<div>
<span class="reminderName"></span>
</div>
<div>
<span></span>
<div class="reminderError" data-case="success">
<div class="errorHead">
<div class="errorIcon">
<span class="icon">
<i class="fas fa-trash"></i>
<i class="fas fa-check"></i>
<i class="fas fa-exclamation-triangle"></i>
</span>
</div>
<div class="reminderName">
Reminder
</div>
<div class="reminderTime">
</div>
</div>
</div>