diff --git a/src/apps/parsers/views.py b/src/apps/parsers/views.py index bf432e3..7a46de1 100644 --- a/src/apps/parsers/views.py +++ b/src/apps/parsers/views.py @@ -840,12 +840,24 @@ class FinancialReportViewSet(ReadOnlyModelViewSet): "ogrn", "external_id", "status", - "source", "load_batch", "registry_organization", ] search_fields = ["ogrn", "external_id", "file_name"] + def get_queryset(self): + queryset = super().get_queryset() + source_value = self.request.query_params.get("source", "").strip() + if not source_value or source_value in { + "fns_reports", + "fns_financial", + "financial-indicators", + }: + return queryset + if source_value in FinancialReport.SourceType.values: + return queryset.filter(source=source_value) + return queryset.none() + def get_serializer_class(self): if self.action == "retrieve": return FinancialReportDetailSerializer diff --git a/src/templates/dashboard.html b/src/templates/dashboard.html index 8422c89..8a951b2 100644 --- a/src/templates/dashboard.html +++ b/src/templates/dashboard.html @@ -500,11 +500,32 @@ } .route-title { display: grid; gap: 3px; } .record-table tbody tr { cursor: pointer; } + .record-table { + table-layout: fixed; + min-width: 860px; + } + .record-table th, + .record-table td { + overflow-wrap: anywhere; + } + .record-table th:nth-child(1), + .record-table td:nth-child(1) { width: 72px; } + .record-table th:nth-child(2), + .record-table td:nth-child(2) { width: 38%; } + .record-table th:nth-child(3), + .record-table td:nth-child(3) { width: 24%; } + .record-table th:nth-child(4), + .record-table td:nth-child(4) { width: 150px; } + .record-table th:nth-child(5), + .record-table td:nth-child(5) { width: 150px; } .record-table td:first-child { - width: 64px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } + #sourceTableView { + min-height: 420px; + overflow-x: auto; + } .empty-state { padding: 18px; border: 1px dashed var(--line-strong); @@ -1799,16 +1820,18 @@ $("routeTitle").textContent = source.title; $("routeSubtitle").textContent = `${source.agency} · ${source.source} · ${source.parser_strategy}`; $("recordsEmpty").classList.add("hidden"); - $("recordsBody").innerHTML = ""; + $("recordsBody").innerHTML = `