+ +
+ @if (!hasConversation()) { + +
+
+ +
+

+ {{ streamedText() }} + +

+
+ } @else if (voiceHasTranscript()) { + + + } +
-
-
- +
+
- -
- -

- - {{ streamedText() }} - - - -

- - - -
\ No newline at end of file diff --git a/src/app/pages/home/home.page.ts b/src/app/pages/home/home.page.ts index b853a78..299ed59 100644 --- a/src/app/pages/home/home.page.ts +++ b/src/app/pages/home/home.page.ts @@ -3,18 +3,21 @@ import { Component, inject, signal, + computed, OnInit, OnDestroy, } from '@angular/core'; import { CommonModule } from '@angular/common'; import { AiChatInputComponent } from '../../shared/ui/ai-chat-input/ai-chat-input.component'; +import { VoiceStreamPanelComponent } from '../../shared/ui/voice-stream-panel/voice-stream-panel.component'; +import { VoiceStreamService } from '../../services/voice-stream/voice-stream.service'; import { Router, NavigationEnd } from '@angular/router'; import { filter } from 'rxjs/operators'; import { ThemeService } from '../../services/theme/theme.service'; import { Subscription } from 'rxjs'; const HOME_TITLES = [ - 'چه چیزی می‌خواهید بدانید؟...', + 'چه چیزی می‌خواهید بدانید؟', 'سوالتان را بپرسید، با شما هستم...', 'هر سوالی دارید، از من بپرسید...', 'از هر چیزی که می‌خواهید شروع کنید...', @@ -29,7 +32,7 @@ const HOME_TITLES = [ @Component({ selector: 'app-home', standalone: true, - imports: [CommonModule, AiChatInputComponent], + imports: [CommonModule, AiChatInputComponent, VoiceStreamPanelComponent], changeDetection: ChangeDetectionStrategy.OnPush, templateUrl: './home.page.html', styleUrl: './home.page.css', @@ -37,6 +40,7 @@ const HOME_TITLES = [ export class HomePage implements OnInit, OnDestroy { private readonly themeService = inject(ThemeService); private readonly router = inject(Router); + private readonly voiceStream = inject(VoiceStreamService); readonly isDarkMode = this.themeService.isDarkMode; @@ -45,6 +49,20 @@ export class HomePage implements OnInit, OnDestroy { readonly hasMessages = signal(false); + /** + * Conversation owns the layout when there is a live voice call, + * leftover voice transcript, or text messages — same idea as Claude's + * chat column switching from empty state to transcript list. + */ + readonly voiceHasTranscript = computed( + () => this.voiceStream.isOpen() || this.voiceStream.messages().length > 0, + ); + + readonly hasConversation = computed(() => this.hasMessages() || this.voiceHasTranscript()); + + /** @deprecated use hasConversation — kept for any external bindings */ + readonly voicePanelVisible = this.hasConversation; + readonly homeTitle = signal(''); readonly streamedText = signal(''); readonly isStreaming = signal(false); @@ -97,12 +115,9 @@ export class HomePage implements OnInit, OnDestroy { } index++; - this.streamedText.set(text.substring(0, index)); - // Slightly random timing makes it feel more natural const delay = 16 + Math.random() * 8; - this.typingTimer = setTimeout(typeNextCharacter, delay); }; @@ -114,7 +129,6 @@ export class HomePage implements OnInit, OnDestroy { clearTimeout(this.typingTimer); this.typingTimer = null; } - this.isStreaming.set(false); } @@ -130,4 +144,4 @@ export class HomePage implements OnInit, OnDestroy { onVoiceToggled(active: boolean): void { console.log('Voice mode:', active ? 'active' : 'inactive'); } -} +} \ No newline at end of file diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index cd7e703..fa9b558 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -127,7 +127,6 @@ export class LoginPage { } onSubmit(): void { - this.router.navigate(['/']); const allErrors = this.validateAllFields(); if (Object.keys(allErrors).length > 0) { @@ -159,11 +158,13 @@ export class LoginPage { }, error: (err) => { this.isLoading.set(false); - const message = - (err as any)?.error?.message || - (err as any)?.message || - 'خطا در اتصال به سرور. لطفاً دوباره تلاش کنید.'; - this.generalError.set(message); + // Errors are mapped by backend code instead of showing the raw server message. + this.generalError.set( + AuthService.messageForError( + err, + 'خطا در اتصال به سرور. لطفاً دوباره تلاش کنید.', + ), + ); this.triggerShake(); }, }); diff --git a/src/app/pages/reports/reports.page.ts b/src/app/pages/reports/reports.page.ts new file mode 100644 index 0000000..50f144b --- /dev/null +++ b/src/app/pages/reports/reports.page.ts @@ -0,0 +1,146 @@ +import { ChangeDetectionStrategy, Component, computed, inject, signal, OnInit } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { forkJoin } from 'rxjs'; +import { ReportsService } from '../../services/reports/reports.service'; +import { ReportsView } from '../../services/reports/reports.types'; +import { BarChartComponent, BarChartItem } from '../../shared/ui/charts/bar-chart.component'; +import { DoughnutChartComponent, DoughnutSegment } from '../../shared/ui/charts/doughnut-chart.component'; +import { LineChartComponent, LinePoint } from '../../shared/ui/charts/line-chart.component'; +import { CHART_PALETTE } from '../../shared/utils/chart-palette'; +import { formatCount, formatDecimal, formatPercent } from '../../shared/utils/format.util'; + +type ReportTabId = 'questions' | 'performance'; + +@Component({ + selector: 'app-reports', + standalone: true, + imports: [CommonModule, BarChartComponent, DoughnutChartComponent, LineChartComponent], + changeDetection: ChangeDetectionStrategy.OnPush, + templateUrl: './reports.page.html', + styleUrl: './reports.page.css', +}) +export class ReportsPage implements OnInit { + private readonly reports = inject(ReportsService); + + readonly tabs: { id: ReportTabId; label: string; icon: string }[] = [ + { + id: 'questions', + label: 'پرسش‌های کاربران', + icon: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', + }, + { + id: 'performance', + label: 'عملکرد و روند', + icon: 'M22 12h-4l-3 9L9 3l-3 9H2', + }, + ]; + + readonly activeTab = signal('questions'); + + readonly loading = signal(true); + readonly loadError = signal(false); + readonly data = signal(null); + + readonly summary = computed(() => this.data()?.summary ?? null); + readonly ai = computed(() => this.data()?.aiPerformance ?? null); + + readonly topQuestions = computed(() => { + const questions = this.data()?.topQuestions ?? []; + return questions.map((question, index) => ({ + label: question.text, + value: question.count, + color: CHART_PALETTE[index % CHART_PALETTE.length], + hint: `دسته: ${question.category}`, + })); + }); + + readonly categories = computed(() => { + const shares = this.data()?.categories ?? []; + return shares.map((share, index) => ({ + label: share.category, + value: share.count, + color: CHART_PALETTE[index % CHART_PALETTE.length], + })); + }); + + readonly trend = computed(() => { + const points = this.data()?.trend ?? []; + return points.map((point) => ({ label: point.label, value: point.count })); + }); + + readonly channels = computed(() => { + const channels = this.data()?.aiPerformance.channels ?? []; + return channels.map((channel, index) => ({ + label: channel.label, + value: channel.count, + color: CHART_PALETTE[index % CHART_PALETTE.length], + })); + }); + + readonly aiAnswerRate = computed(() => { + const summary = this.summary(); + if (!summary || summary.totalQuestions === 0) return 0; + return (summary.aiAnswered / summary.totalQuestions) * 100; + }); + + readonly faqBasedRate = computed(() => { + const ai = this.ai(); + if (!ai || ai.totalResponses === 0) return 0; + return (ai.faqBasedResponses / ai.totalResponses) * 100; + }); + + readonly trendTotal = computed(() => this.trend().reduce((sum, point) => sum + point.value, 0)); + + readonly trendPeak = computed(() => { + const points = this.trend(); + if (points.length === 0) return null; + return points.reduce((peak, point) => (point.value > peak.value ? point : peak), points[0]); + }); + + ngOnInit(): void { + this.load(); + } + + selectTab(id: ReportTabId): void { + this.activeTab.set(id); + } + + load(): void { + this.loading.set(true); + this.loadError.set(false); + + forkJoin({ + topQuestions: this.reports.getTopQuestions(), + summary: this.reports.getQuestionSummary(), + categories: this.reports.getCategoryDistribution(), + trend: this.reports.getUsageTrend(), + aiPerformance: this.reports.getAiPerformance(), + }).subscribe({ + next: (data) => { + this.data.set(data); + this.loading.set(false); + }, + error: () => { + this.data.set(null); + this.loading.set(false); + this.loadError.set(true); + }, + }); + } + + retry(): void { + this.load(); + } + + formatCount(value: number): string { + return formatCount(value); + } + + formatDecimal(value: number): string { + return formatDecimal(value); + } + + formatPercent(value: number): string { + return formatPercent(value); + } +} diff --git a/src/app/pages/settings/settings.page.css b/src/app/pages/settings/settings.page.css index 452cb59..3a29009 100644 --- a/src/app/pages/settings/settings.page.css +++ b/src/app/pages/settings/settings.page.css @@ -88,12 +88,6 @@ animation: slideInRight 0.3s ease-out; } -.file-item:nth-child(1) { animation-delay: 0.05s; } -.file-item:nth-child(2) { animation-delay: 0.1s; } -.file-item:nth-child(3) { animation-delay: 0.15s; } -.file-item:nth-child(4) { animation-delay: 0.2s; } -.file-item:nth-child(5) { animation-delay: 0.25s; } - .file-icon-wrapper { transition: all 0.2s ease; } @@ -113,11 +107,6 @@ animation: fadeInUp 0.4s ease-out forwards; } -.setting-item:nth-child(1) { animation-delay: 0.05s; } -.setting-item:nth-child(2) { animation-delay: 0.1s; } -.setting-item:nth-child(3) { animation-delay: 0.15s; } -.setting-item:nth-child(4) { animation-delay: 0.2s; } - .form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); @@ -197,9 +186,11 @@ border-color: var(--color-primary); } +/* `.toggle-active` mirrors the checked state set by the host; keep it solid too + so it never wins over the neutral base with a transparent primary wash. */ .toggle-switch.toggle-active { - background-color: var(--color-primary)/15; - border-color: var(--color-primary)/25; + background-color: var(--color-primary); + border-color: var(--color-primary); } .toggle-switch:focus-within { @@ -207,111 +198,55 @@ box-shadow: 0 0 0 3px var(--color-primary)/30; } -.toggle-switch:hover { - background-color: var(--color-primary)/10; +/* Unchecked (off) hover: solid neutral, never transparent. */ +.toggle-switch:hover:not(:has(input:checked)) { + background-color: color-mix(in srgb, var(--toggle-bg) 60%, #000); } -.toggle-switch:hover:has(input:checked) { - background-color: var(--color-primary); -} - -.toggle-switch:hover.toggle-active { - background-color: var(--color-primary)/20; +/* Checked hover: solid, slightly darker primary. */ +.toggle-switch:has(input:checked):hover { + background-color: color-mix(in srgb, var(--color-primary) 78%, #000); } @keyframes fadeInDown { - from { - opacity: 0; - transform: translateY(-10px); - } - to { - opacity: 1; - transform: translateY(0); - } + from { opacity: 0; transform: translateY(-10px); } + to { opacity: 1; transform: translateY(0); } } @keyframes fadeInUp { - from { - opacity: 0; - transform: translateY(20px); - } - to { - opacity: 1; - transform: translateY(0); - } + from { opacity: 0; transform: translateY(20px); } + to { opacity: 1; transform: translateY(0); } } @keyframes fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } + from { opacity: 0; } + to { opacity: 1; } } @keyframes slideUp { - from { - opacity: 0; - transform: translateY(20px); - } - to { - opacity: 1; - transform: translateY(0); - } + from { opacity: 0; transform: translateY(20px); } + to { opacity: 1; transform: translateY(0); } } @keyframes slideInRight { - from { - opacity: 0; - transform: translateX(20px); - } - to { - opacity: 1; - transform: translateX(0); - } + from { opacity: 0; transform: translateX(20px); } + to { opacity: 1; transform: translateX(0); } } @keyframes slideIn { - from { - width: 0; - opacity: 0; - } - to { - width: 1.5rem; - opacity: 1; - } + from { width: 0; opacity: 0; } + to { width: 1.5rem; opacity: 1; } } @keyframes bounce { - 0%, 20%, 50%, 80%, 100% { - transform: translateY(0); - } - 40% { - transform: translateY(-5px); - } - 60% { - transform: translateY(-3px); - } + 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } + 40% { transform: translateY(-5px); } + 60% { transform: translateY(-3px); } } @keyframes pulse { - 0%, 100% { - transform: scale(1); - } - 50% { - transform: scale(1.1); - } -} - -@media (prefers-reduced-motion: reduce) { - *, - *::before, - *::after { - animation-duration: 0.01ms !important; - animation-iteration-count: 1 !important; - transition-duration: 0.01ms !important; - } + 0%, 100% { transform: scale(1); } + 50% { transform: scale(1.1); } } @media (max-width: 640px) { @@ -392,4 +327,331 @@ :host-context([data-bs-theme="dark"]) .file-item:hover, :host-context([data-bs-theme="dark"]) .setting-item:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3); +} + +:host-context([data-bs-theme="dark"]) .btn--outline:hover:not(:disabled) { + background: color-mix(in srgb, var(--color-primary) 30%, #171717); +} + +:host-context([data-bs-theme="dark"]) .toggle-switch:hover:not(:has(input:checked)) { + background-color: color-mix(in srgb, var(--toggle-bg) 50%, #000); +} + +:host-context([data-bs-theme="dark"]) .toggle-switch:has(input:checked):hover { + background-color: color-mix(in srgb, var(--color-primary) 75%, #000); +} + +/* ===== Dropzone disabled overlay ===== */ +.dropzone-disabled { + opacity: 0.6; + pointer-events: none; +} + +/* ===== Upload actions + queue ===== */ +.upload-actions { + animation: fadeInUp 0.4s ease-out; +} + +.upload-queue { + animation: fadeInUp 0.4s ease-out; +} + +.upload-task { + animation: slideInRight 0.3s ease-out; +} + +.upload-progress-bar { + background: var(--surface-border); +} +.upload-progress-bar > div { + background: var(--color-primary); +} + +/* ===== Buttons ===== */ +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.4rem; + border-radius: 0.5rem; + padding: 0.5rem 0.9rem; + font-size: 0.85rem; + font-weight: 500; + border: 1px solid transparent; + cursor: pointer; + transition: background-color 0.2s, border-color 0.2s, color 0.2s; +} +.btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} +.btn--primary { + background: var(--color-primary); + color: #ffffff; +} + +.btn--primary:hover:not(:disabled) { + background: color-mix(in srgb, var(--color-primary) 80%, #000); +} + +.btn--primary:active:not(:disabled) { + background: color-mix(in srgb, var(--color-primary) 70%, #000); +} + +.btn--outline { + background: transparent; + border-color: var(--color-input-border); + color: var(--text-secondary); +} + +.btn--outline:hover:not(:disabled) { + background: color-mix(in srgb, var(--color-primary) 22%, #ffffff); + border-color: var(--color-primary); + color: var(--color-primary); +} + +/* ===== Documents table ===== */ +.documents-section { + animation: fadeInUp 0.5s ease-out; +} +.documents-filters { + animation: fadeInUp 0.4s ease-out; +} +.documents-table-wrapper { + border: 1px solid var(--color-card-border); +} +.documents-table { + border-collapse: separate; + border-spacing: 0; +} +.documents-table th, +.documents-table td { + padding: 0.6rem 0.75rem; + text-align: right; + vertical-align: top; + border-bottom: 1px solid var(--color-card-border); +} +.documents-table thead th { + background: var(--sidebar-hover); +} +.table-row-animate { + animation: fadeInUp 0.3s ease-out; +} +.documents-table tbody tr:last-child td { + border-bottom: none; +} + +/* Status badges */ +.status-queued { + background: var(--color-warning)/15; + color: var(--color-warning); +} +.status-processing { + background: var(--color-info)/15; + color: var(--color-info); +} +.status-ready { + background: var(--color-success)/15; + color: var(--color-success); +} +.status-failed { + background: var(--color-danger)/15; + color: var(--color-danger); +} +.status-dot, +.dot-queued, +.dot-processing, +.dot-ready, +.dot-failed { + width: 0.4rem; + height: 0.4rem; + border-radius: 9999px; + flex-shrink: 0; +} +.dot-queued { background: var(--color-warning); } +.dot-processing { background: var(--color-info); animation: pulse-dot 1.5s ease-in-out infinite; } +.dot-ready { background: var(--color-success); } +.dot-failed { background: var(--color-danger); } +@keyframes pulse-dot { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.4; } +} + +/* Active toggle button */ +.active-toggle { + display: inline-flex; + align-items: center; + gap: 0.35rem; + border-radius: 9999px; + padding: 0.25rem 0.7rem; + font-size: 0.78rem; + font-weight: 600; + border: 1px solid var(--color-input-border); + cursor: pointer; + transition: background-color 0.2s, border-color 0.2s, color 0.2s; +} +.active-toggle--on { + background: var(--color-success)/15; + border-color: var(--color-success); + color: var(--color-success); +} +.active-toggle:not(.active-toggle--on) { + background: var(--color-input-border)/40; + color: var(--text-muted); +} +.active-toggle:hover { + opacity: 0.85; +} +.active-toggle:disabled { + cursor: default; + opacity: 0.6; +} + +/* Documents empty / error / pagination */ +.documents-loading, +.documents-empty, +.documents-error { + animation: fadeIn 0.3s ease-out; +} + +/* ===== Review modal ===== */ +.review-backdrop { + position: fixed; + inset: 0; + background: var(--overlay); + display: flex; + align-items: center; + justify-content: center; + z-index: 100; + padding: 1rem; +} +.review-modal { + background: var(--card-bg); + border: 1px solid var(--color-card-border); + border-radius: 1rem; + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + width: 100%; + max-width: 56rem; + max-height: 85dvh; + overflow: hidden; + display: flex; + flex-direction: column; +} +.review-modal-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 1rem 1.25rem; + border-bottom: 1px solid var(--color-card-border); +} +.review-modal-body { + padding: 1.25rem; + overflow-y: auto; + flex: 1 1 auto; + min-height: 0; +} +.review-modal-footer { + border-top: 1px solid var(--color-card-border); +} +.review-loading { + animation: fadeIn 0.3s ease-out; +} +.review-items { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); + gap: 1rem; +} +.review-item { + animation: fadeInUp 0.3s ease-out; +} +.review-item-header { + animation: fadeInDown 0.3s ease-out; +} +.review-item-body { + animation: fadeIn 0.3s ease-out; +} +.review-preview { + background: var(--sidebar-hover); + border: 1px dashed var(--color-card-border); +} +.review-preview img { + max-width: 100%; + height: auto; + display: block; +} +.review-item-actions { + animation: fadeInDown 0.3s ease-out; +} + +/* ===== App settings: AI model cards grid ===== */ +.ai-models-grid { + animation: fadeInUp 0.5s ease-out; +} +.ai-models-grid > app-ai-model-config-card { + animation: fadeInUp 0.4s ease-out; +} + +/* Shared form utilities (also used by the review modal — page-scoped) */ +.form-label { + font-size: 0.8rem; + font-weight: 500; + color: var(--text-secondary); +} +.form-input { + background: var(--color-input-bg); + color: var(--text-secondary); + border: 1px solid var(--color-input-border); + border-radius: 0.5rem; + padding: 0.5rem 0.75rem; + font-size: 0.875rem; + outline: none; + transition: border-color 0.2s, box-shadow 0.2s; + width: 100%; + box-sizing: border-box; +} +.form-input:focus { + border-color: var(--color-primary); + box-shadow: 0 0 0 3px var(--color-primary)/20; +} + .form-input:disabled { + background: var(--surface-bg); + cursor: default; + opacity: 0.7; + } + +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + } + .dot-processing { animation: none; } +} + +@media (max-width: 640px) { + .documents-table { + font-size: 0.75rem; + } + .documents-table th, + .documents-table td { + padding: 0.4rem 0.3rem; + } + .review-modal { + max-width: 100%; + max-height: 90dvh; + border-radius: 0.75rem; + } + .review-item-body { + grid-template-columns: 1fr; + } + .ai-models-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: 480px) { + .documents-filters { + flex-wrap: wrap; + gap: 0.5rem; + } } \ No newline at end of file diff --git a/src/app/pages/settings/settings.page.html b/src/app/pages/settings/settings.page.html index 64068c2..74ee65e 100644 --- a/src/app/pages/settings/settings.page.html +++ b/src/app/pages/settings/settings.page.html @@ -1,4 +1,5 @@ -
+ +

تنظیمات

مدیریت FAQ و ترجیحات برنامه

@@ -58,7 +59,7 @@ > تنظیمات برنامه @@ -93,13 +94,32 @@ آپلود سند FAQ

- فایل‌های PDF، DOCX یا TXT خود را بکشید و رها کنید یا برای آپلود کلیک کنید. + فایل‌های {{ supportedFormatsLabel() }} خود را بکشید و رها کنید یا برای آپلود کلیک کنید.

+ @if (!capabilitiesLoaded() && !configLoading()) { +

+ محدودیت‌های آپلود از سرور دریافت نشده‌اند؛ آپلود غیرفعال است. +

+ } + @if (maxUploadBytes()) { +

+ حداکثر حجم: {{ formatFileSize(maxUploadBytes()) }} +

+ } + @if (pdfPageLimitLabel()) { +

+ حداکثر تعداد صفحات PDF: {{ pdfPageLimitLabel() }} +

+ } + @if (configError()) { +

{{ configError() }}

+ }
@@ -140,11 +161,11 @@ فایل‌ها را اینجا رها کنید

یا کلیک کنید برای انتخاب

-

پشتیبانی: PDF، DOCX، TXT

+

پشتیبانی: {{ supportedFormatsLabel() }}

- @if (fileCount > 0) { + @if (fileCount > 0 && !isUploading()) {

@@ -204,7 +225,7 @@ type="button" class="file-remove-btn p-2 text-[var(--text-muted)] rounded-lg transition-all duration-200 hover:text-red-400 hover:bg-red-400/10 hover:scale-110 shrink-0" (click)="removeFile($index)" - aria-label="حذف فایل {{ file.name }}" + [attr.aria-label]="'حذف فایل ' + file.name" >

} + + @if (fileCount > 0 && !isUploading()) { +
+ +
+ } + + @if (isUploading()) { +
+

در حال آپلود...

+ @for (task of uploadQueue(); track $index) { +
+
+
+ {{ task.file.name }} + + @if (task.status === 'uploading') { + {{ task.progress }}% + } @else if (task.status === 'done') { + بارگذاری شد + } @else { + خطا + } + +
+
+
+
+ @if (task.error) { +

{{ task.error }}

+ } +
+ + @if (task.status === 'uploading') { + + } + @if (task.status === 'error') { + + } +
+ } +
+ } + + +
+ @if (!isAdmin()) { +
+ + + + +

مدیریت و لیست اسناد فقط برای ادمین‌ها در دسترس است.

+
+ } + + @if (isAdmin()) { +
+

+ + + + + + اسناد آپلود شده +

+

+ فهرست اسناد ثبت‌شده و وضعیت پردازش آن‌ها. وضعیت در صف یا پردازش در حال پردازش به‌صورت خودکار به‌روز می‌شود. +

+
+ + @if (documentsLoading() && documents().length === 0) { +
+ + + + + در حال بارگذاری اسناد... +
+ } + + @if (documentsError() && documents().length === 0) { +
+

{{ documentsError() }}

+ +
+ } + + @if (documents().length > 0) { +
+
+ + + + فقط فعال +
+ +
+ +
+ + + + + + + + + + + + + + @for (doc of documents(); track doc.id) { + + + + + + + + + + } + +
نام فایلعنوان سندوضعیت پردازشتعداد بخش‌هاتاریخ آپلودفعال‌سازیعملیات
+ {{ doc.filename }} + + {{ doc.title ?? '—' }} + + + + {{ statusLabel(doc.status) }} + + @if (isReviewNeeded(doc)) { + + نیازمند بازبینی ادمین + + } + @if (doc.job.error; as jobError) { + {{ jobError.code }} + } + + {{ doc.chunk_count }} + + {{ formatDateTime(doc.created_at) }} + + @if (doc.status === 'ready' && !isReviewNeeded(doc) && isAdmin()) { + @if (togglingDocId() === doc.id) { +
+ + + + + در حال به‌روزرسانی +
+ } @else { + + } + } @else { + {{ doc.is_active ? 'فعال' : 'غیرفعال' }} + } +
+
+ @if (isReviewNeeded(doc) && doc.status === 'failed') { + + } + @if (canRetryDocument(doc)) { + + } +
+
+
+ + @if (!hasMoreDocuments() && !documentsLoading()) { +

+ {{ documents().length }} سند ثبت شده +

+ } + + @if (hasMoreDocuments() && !documentsLoading()) { +
+ +
+ } + } @else { + @if (!documentsLoading() && !documentsError()) { +
+ + + + + +

هنوز سندی آپلود نشده است.

+
+ } + } + } +
+ + + @if (reviewingDocId()) { +
+ +
+ } } @@ -244,7 +776,7 @@ > تنظیمات کلی @@ -252,43 +784,6 @@
- - - -
@@ -304,7 +799,122 @@
+
+
+ + + در صورت فعال بودن، محتوای استخراج‌شده از اسناد باید توسط ادمین بازبینی و تأیید شود. + + پیش‌نویس — ذخیره‌سازی در فاز MVP پشتیبانی نمی‌شود +
+
+ +
+