fix(push-admin): show test push delivery errors

This commit is contained in:
2026-10-02 18:03:11 +02:00
parent 1885bfc521
commit 6ff9971ff9

View File

@@ -82,14 +82,14 @@ async function sendTestPush() {
}); });
await Promise.all([refreshInstance(), refreshJobs(), refreshDevices()]); await Promise.all([refreshInstance(), refreshJobs(), refreshDevices()]);
toast.add({ toast.add({
title: "Test-Push gesendet", title: result.failed ? (result.sent ? "Test-Push teilweise fehlgeschlagen" : "Test-Push fehlgeschlagen") : "Test-Push gesendet",
description: `${result.sent ?? 0} gesendet, ${result.failed ?? 0} fehlgeschlagen`, description: [`${result.sent ?? 0} gesendet, ${result.failed ?? 0} fehlgeschlagen`, result.lastErrorCode, result.lastErrorMessage].filter(Boolean).join(" · "),
color: result.failed ? "warning" : "success", color: result.failed ? (result.sent ? "warning" : "error") : "success",
}); });
} catch (error: any) { } catch (error: any) {
toast.add({ toast.add({
title: "Test-Push fehlgeschlagen", title: "Test-Push fehlgeschlagen",
description: error?.data?.message || error?.message || "Die Testnachricht konnte nicht gesendet werden.", description: error?.data?.message || error?.data?.error || error?.message || "Die Testnachricht konnte nicht gesendet werden.",
color: "error", color: "error",
}); });
} finally { } finally {
@@ -246,6 +246,7 @@ async function sendTestPush() {
<th>Angenommen</th> <th>Angenommen</th>
<th>Gesendet</th> <th>Gesendet</th>
<th>Fehler</th> <th>Fehler</th>
<th>Letzter Fehler</th>
<th>Erstellt</th> <th>Erstellt</th>
</tr> </tr>
</thead> </thead>
@@ -256,6 +257,10 @@ async function sendTestPush() {
<td>{{ job.acceptedCount }}</td> <td>{{ job.acceptedCount }}</td>
<td>{{ job.sentCount }}</td> <td>{{ job.sentCount }}</td>
<td>{{ job.failedCount }}</td> <td>{{ job.failedCount }}</td>
<td>
<div>{{ job.lastErrorCode || "-" }}</div>
<div v-if="job.lastErrorMessage" class="text-sm text-gray-500">{{ job.lastErrorMessage }}</div>
</td>
<td>{{ new Date(job.createdAt).toLocaleString() }}</td> <td>{{ new Date(job.createdAt).toLocaleString() }}</td>
</tr> </tr>
</tbody> </tbody>