mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-29 05:15:12 +02:00
Add general status page + standardize the experience a bit
This commit is contained in:
@@ -115,6 +115,29 @@ def list_index_attempts(
|
||||
IndexAttemptSnapshot(
|
||||
connector_specific_config=index_attempt.connector_specific_config,
|
||||
status=index_attempt.status,
|
||||
source=index_attempt.source,
|
||||
time_created=index_attempt.time_created,
|
||||
time_updated=index_attempt.time_updated,
|
||||
docs_indexed=0
|
||||
if not index_attempt.document_ids
|
||||
else len(index_attempt.document_ids),
|
||||
)
|
||||
for index_attempt in index_attempts
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
@router.get("/connectors/index-attempt")
|
||||
def list_all_index_attempts(
|
||||
_: User = Depends(current_admin_user),
|
||||
) -> ListIndexAttemptsResponse:
|
||||
index_attempts = fetch_index_attempts()
|
||||
return ListIndexAttemptsResponse(
|
||||
index_attempts=[
|
||||
IndexAttemptSnapshot(
|
||||
connector_specific_config=index_attempt.connector_specific_config,
|
||||
status=index_attempt.status,
|
||||
source=index_attempt.source,
|
||||
time_created=index_attempt.time_created,
|
||||
time_updated=index_attempt.time_updated,
|
||||
docs_indexed=0
|
||||
|
@@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from danswer.configs.constants import DocumentSource
|
||||
from danswer.datastores.interfaces import DatastoreFilter
|
||||
from danswer.db.models import IndexingStatus
|
||||
from pydantic import BaseModel
|
||||
@@ -53,6 +54,7 @@ class UserByEmail(BaseModel):
|
||||
class IndexAttemptSnapshot(BaseModel):
|
||||
connector_specific_config: dict[str, Any]
|
||||
status: IndexingStatus
|
||||
source: DocumentSource
|
||||
time_created: datetime
|
||||
time_updated: datetime
|
||||
docs_indexed: int
|
||||
|
Reference in New Issue
Block a user