fix dashboard source groups
All checks were successful
CI/CD Pipeline / Manual Action Help (push) Has been skipped
CI/CD Pipeline / Start Dev Containers in Dokploy (push) Has been skipped
CI/CD Pipeline / Cleanup Dev Database (push) Has been skipped
CI/CD Pipeline / Quality Gate (push) Successful in 1m49s
CI/CD Pipeline / Build and Push Images (push) Successful in 2m22s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
All checks were successful
CI/CD Pipeline / Manual Action Help (push) Has been skipped
CI/CD Pipeline / Start Dev Containers in Dokploy (push) Has been skipped
CI/CD Pipeline / Cleanup Dev Database (push) Has been skipped
CI/CD Pipeline / Quality Gate (push) Successful in 1m49s
CI/CD Pipeline / Build and Push Images (push) Successful in 2m22s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
This commit is contained in:
@@ -2064,6 +2064,10 @@ class ParserDashboardDataView(APIView):
|
||||
|
||||
def get(self, request: Request):
|
||||
sources = ParserSourceSerializer(PARSER_SOURCES.values(), many=True).data
|
||||
api_sources = [
|
||||
source for source in sources if not source["supports_file_upload"]
|
||||
]
|
||||
file_sources = [source for source in sources if source["supports_file_upload"]]
|
||||
jobs = BackgroundJobService.get_user_jobs(user_id=request.user.id, limit=30)
|
||||
source_counts = dict(
|
||||
GenericParserRecord.objects.values("source")
|
||||
@@ -2083,12 +2087,12 @@ class ParserDashboardDataView(APIView):
|
||||
return api_response(
|
||||
{
|
||||
"sources": sources,
|
||||
"api_sources": [
|
||||
source for source in sources if not source["supports_file_upload"]
|
||||
],
|
||||
"file_sources": [
|
||||
source for source in sources if source["supports_file_upload"]
|
||||
],
|
||||
"api_sources": api_sources,
|
||||
"file_sources": file_sources,
|
||||
"groups": {
|
||||
"api": api_sources,
|
||||
"uploads": file_sources,
|
||||
},
|
||||
"schedules": ParserScheduleSerializer(schedules, many=True).data,
|
||||
"jobs": BackgroundJobListSerializer(jobs, many=True).data,
|
||||
"source_counts": source_counts,
|
||||
|
||||
Reference in New Issue
Block a user