Новый экранчик для обзора дашей

This commit is contained in:
2026-02-23 15:54:20 +03:00
parent c30272fe8b
commit 47cffcc35f
35 changed files with 32880 additions and 828 deletions

View File

@@ -24,11 +24,19 @@
const profileLabel = $derived(typeof profile?.label === 'function' ? profile.label() : profile?.label);
function getStatusClass(status) {
if (status === 'success') return 'bg-green-100 text-green-700';
if (status === 'failed') return 'bg-red-100 text-red-700';
if (status === 'in_progress') return 'bg-blue-100 text-blue-700';
if (status === 'partial') return 'bg-amber-100 text-amber-700';
return 'bg-slate-100 text-slate-700';
if (status === 'success') return 'bg-green-100 text-green-700 ring-1 ring-green-200';
if (status === 'failed') return 'bg-red-100 text-red-700 ring-1 ring-red-200';
if (status === 'in_progress') return 'bg-blue-100 text-blue-700 ring-1 ring-blue-200';
if (status === 'partial') return 'bg-amber-100 text-amber-700 ring-1 ring-amber-200';
return 'bg-slate-100 text-slate-700 ring-1 ring-slate-200';
}
function getStatusLabel(status) {
if (status === 'success') return $t.reports?.status_success || 'Success';
if (status === 'failed') return $t.reports?.status_failed || 'Failed';
if (status === 'in_progress') return $t.reports?.status_in_progress || 'In progress';
if (status === 'partial') return $t.reports?.status_partial || 'Partial';
return status || ($t.reports?.not_provided || 'Not provided');
}
function formatDate(value) {
@@ -44,7 +52,7 @@
</script>
<button
class="w-full rounded-lg border p-3 text-left transition hover:bg-slate-50 {selected ? 'border-blue-400 bg-blue-50' : 'border-slate-200 bg-white'}"
class="w-full rounded-xl border p-4 text-left shadow-sm transition hover:border-slate-300 hover:bg-slate-50 hover:shadow {selected ? 'border-blue-400 bg-blue-50' : 'border-slate-200 bg-white'}"
on:click={onSelect}
aria-label={`Report ${report?.report_id || ''} type ${profileLabel || ($t.reports?.unknown_type || 'Other / Unknown Type')}`}
>
@@ -53,7 +61,7 @@
{profileLabel || ($t.reports?.unknown_type || 'Other / Unknown Type')}
</span>
<span class="rounded px-2 py-0.5 text-xs font-semibold {getStatusClass(report?.status)}">
{report?.status || ($t.reports?.not_provided || 'Not provided')}
{getStatusLabel(report?.status)}
</span>
</div>
<p class="text-sm font-medium text-slate-800">{report?.summary || ($t.reports?.not_provided || 'Not provided')}</p>

View File

@@ -31,13 +31,13 @@
}
</script>
<div class="rounded-lg border border-slate-200 bg-white p-4">
<div class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm">
<h3 class="mb-3 text-sm font-semibold text-slate-700">{$t.reports?.view_details || 'View details'}</h3>
{#if !detail || !detail.report}
<p class="text-sm text-slate-500">{$t.reports?.not_provided || 'Not provided'}</p>
{:else}
<div class="space-y-2 text-sm">
<div class="space-y-2 text-sm text-slate-700">
<p><span class="text-slate-500">ID:</span> {notProvided(detail.report.report_id)}</p>
<p><span class="text-slate-500">Type:</span> {notProvided(detail.report.task_type)}</p>
<p><span class="text-slate-500">Status:</span> {notProvided(detail.report.status)}</p>
@@ -46,13 +46,13 @@
</div>
<div class="mt-4">
<p class="mb-1 text-xs font-semibold uppercase text-slate-500">Diagnostics</p>
<pre class="max-h-48 overflow-auto rounded bg-slate-50 p-2 text-xs text-slate-700">{JSON.stringify(detail.diagnostics || { note: $t.reports?.not_provided || 'Not provided' }, null, 2)}</pre>
<p class="mb-1 text-xs font-semibold uppercase text-slate-500">{$t.reports?.diagnostics || 'Diagnostics'}</p>
<pre class="max-h-48 overflow-auto rounded-lg border border-slate-200 bg-slate-50 p-2 text-xs text-slate-700">{JSON.stringify(detail.diagnostics || { note: $t.reports?.not_provided || 'Not provided' }, null, 2)}</pre>
</div>
{#if (detail.next_actions && detail.next_actions.length > 0) || (detail.report.error_context && detail.report.error_context.next_actions && detail.report.error_context.next_actions.length > 0)}
<div class="mt-4">
<p class="mb-1 text-xs font-semibold uppercase text-slate-500">Next actions</p>
<p class="mb-1 text-xs font-semibold uppercase text-slate-500">{$t.reports?.next_actions || 'Next actions'}</p>
<ul class="list-disc space-y-1 pl-5 text-sm text-slate-700">
{#each (detail.next_actions && detail.next_actions.length > 0 ? detail.next_actions : detail.report.error_context.next_actions) as action}
<li>{action}</li>