feat: report indexing progress with page counts in status panel
This commit is contained in:
1 parent
8f79993646
commit
b3f8019e01
7 files changed
+156
-13
No files matched your search
@@ -44,6 +44,33 @@ export function StatusPanel({ status, onReindex, reindexing }: StatusPanelProps)
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
{status?.state === "indexing" && (
|
||||
<div className="status__progress">
|
||||
<div className="status__progress-label">
|
||||
{status.current_file ? `Lendo ${status.current_file}` : "Lendo PDFs"}
|
||||
{status.pages_total > 0 && ` · ${status.pages_processed}/${status.pages_total} páginas`}
|
||||
</div>
|
||||
{status.pages_total > 0 && (
|
||||
<div
|
||||
className="status__progress-bar"
|
||||
role="progressbar"
|
||||
aria-valuenow={status.pages_processed}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={status.pages_total}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
width: `${Math.min(
|
||||
100,
|
||||
(status.pages_processed / status.pages_total) * 100,
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{status && status.errors.length > 0 && (
|
||||
<ul className="status__errors">
|
||||
{status.errors.map((error) => (
|
||||
|
||||
Reference in new issue
Block a user