2026-08-17 22:58:02 +02:00
|
|
|
<script>
|
|
|
|
|
/**
|
|
|
|
|
* Fejl: what has gone wrong lately, kept where a restart cannot take it.
|
|
|
|
|
*
|
|
|
|
|
* The panel's watcher already says "HTTP 5xx, twice, at 11:49". That is enough
|
|
|
|
|
* to know something broke and nothing at all to act on — the line explaining it
|
|
|
|
|
* is in the container's log, and a Rune replaces the container on every
|
|
|
|
|
* restart, so it is usually gone before anybody looks. These are the same
|
|
|
|
|
* failures written somewhere that survives.
|
|
|
|
|
*/
|
|
|
|
|
import { api, humanMessage } from '$lib/api.js';
|
|
|
|
|
import { app } from '$lib/stores.svelte.js';
|
2026-08-18 09:46:08 +02:00
|
|
|
import { t } from '$lib/i18n.svelte.js';
|
|
|
|
|
import { ago } from '$lib/when.js';
|
2026-08-17 22:58:02 +02:00
|
|
|
|
|
|
|
|
let errors = $state([]);
|
|
|
|
|
let loaded = $state(false);
|
|
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
api
|
|
|
|
|
.listErrors()
|
|
|
|
|
.then((r) => {
|
|
|
|
|
errors = r.errors;
|
|
|
|
|
loaded = true;
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => app.toast(humanMessage(e)));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<section class="panel">
|
|
|
|
|
<header>
|
2026-08-18 09:46:08 +02:00
|
|
|
<h2>{t('errors.title')}</h2>
|
2026-08-17 22:58:02 +02:00
|
|
|
<p class="hint">
|
2026-08-18 09:46:08 +02:00
|
|
|
{t('errors.hint')}
|
2026-08-17 22:58:02 +02:00
|
|
|
</p>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
{#if errors.length}
|
|
|
|
|
<ul class="rows">
|
|
|
|
|
{#each errors as error (error.id)}
|
|
|
|
|
<li>
|
|
|
|
|
<div class="what">
|
|
|
|
|
<span class="primary-line">
|
|
|
|
|
<span class="status">{error.status}</span>
|
|
|
|
|
{error.what}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="secondary">{error.message}</span>
|
|
|
|
|
<span class="secondary mono">
|
|
|
|
|
{error.method}
|
|
|
|
|
{error.path}{#if error.user_name}{' · '}{error.user_name}{/if}{#if error.request_id}{' · ' +
|
|
|
|
|
error.request_id}{/if}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-08-18 09:46:08 +02:00
|
|
|
<span class="when">{ago(error.at)}</span>
|
2026-08-17 22:58:02 +02:00
|
|
|
</li>
|
|
|
|
|
{/each}
|
|
|
|
|
</ul>
|
|
|
|
|
{:else if loaded}
|
2026-08-18 09:46:08 +02:00
|
|
|
<p class="hint">{t('errors.none')}</p>
|
2026-08-17 22:58:02 +02:00
|
|
|
{/if}
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.rows {
|
|
|
|
|
list-style: none;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.rows li {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
gap: var(--s3);
|
|
|
|
|
padding: var(--s3) 0;
|
|
|
|
|
border-bottom: 1px solid var(--line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.rows li:last-child {
|
|
|
|
|
border-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.what {
|
|
|
|
|
flex: 1;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 2px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.primary-line {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: var(--s2);
|
|
|
|
|
font-size: var(--text-sm);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status {
|
|
|
|
|
font-size: var(--text-xs);
|
|
|
|
|
font-weight: 560;
|
|
|
|
|
color: var(--danger);
|
|
|
|
|
border: 1px solid var(--danger);
|
|
|
|
|
border-radius: var(--radius-sm);
|
|
|
|
|
padding: 0 var(--s1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.secondary {
|
|
|
|
|
font-size: var(--text-xs);
|
|
|
|
|
color: var(--ink-faint);
|
|
|
|
|
overflow-wrap: anywhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mono {
|
|
|
|
|
font-family: var(--font-mono);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.when {
|
|
|
|
|
font-size: var(--text-xs);
|
|
|
|
|
color: var(--ink-faint);
|
|
|
|
|
flex: none;
|
|
|
|
|
}
|
|
|
|
|
</style>
|