build(ui): expand application shell and implement administrative dashboard pages
This commit significantly expands the application's routing, navigation, and administrative capabilities. It introduces several new functional modules and refines the core layout for a more professional, dashboard-oriented experience. - **Routing & Navigation**: - Added routes for `wallboard`, `call-center`, `call-center/calls`, and `chat-questions`. - Updated `SidebarComponent` to include all new navigation items. - Enhanced `LayoutComponent` with dynamic navigation based on user roles (admin vs. user). - **New Administrative Pages**: - `WallboardPage`: Implements a real-time KPI dashboard with call activity trends and outcome distributions. - `CallCenterPage`: Provides a symbolic interface for managing call center connectivity and synchronization. - `CallCenterCallsPage`: Implements a call history retrieval interface with filtering capabilities. - `ChatQuestionsPage`: Adds a module for reviewing user questions from web and mobile channels. - **Core Infrastructure & Refinement**: - Updated `AppConfig` to include an `APP_INITIALIZER` for validating user identity via `AuthService` on startup. - Refined `HomeComponent` layout to a "Claude-style" continuous chat column. - Implemented global themed scrollbars and integrated the 'Lahze' font family. - Added `proxy.conf.json` and updated `angular.json` to support local backend development. - **Documentation**: - Added comprehensive API handoff guides for frontend-backend connection and MVP API catalog.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<div class="settings-page max-w-3xl mx-auto px-4 py-8">
|
||||
<!-- prettier-ignore -->
|
||||
<div class="settings-page max-w-6xl mx-auto px-4 py-8">
|
||||
<header class="settings-header mb-8">
|
||||
<h1 class="text-3xl font-semibold text-[var(--text-primary)] mb-1">تنظیمات</h1>
|
||||
<p class="text-sm text-[var(--text-muted)]">مدیریت FAQ و ترجیحات برنامه</p>
|
||||
@@ -58,7 +59,7 @@
|
||||
>
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l-.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
/>
|
||||
</svg>
|
||||
<span>تنظیمات برنامه</span>
|
||||
@@ -93,13 +94,32 @@
|
||||
آپلود سند FAQ
|
||||
</h2>
|
||||
<p class="text-sm text-[var(--text-muted)]">
|
||||
فایلهای PDF، DOCX یا TXT خود را بکشید و رها کنید یا برای آپلود کلیک کنید.
|
||||
فایلهای {{ supportedFormatsLabel() }} خود را بکشید و رها کنید یا برای آپلود کلیک کنید.
|
||||
</p>
|
||||
@if (!capabilitiesLoaded() && !configLoading()) {
|
||||
<p class="text-xs text-[var(--color-danger)] mt-1">
|
||||
محدودیتهای آپلود از سرور دریافت نشدهاند؛ آپلود غیرفعال است.
|
||||
</p>
|
||||
}
|
||||
@if (maxUploadBytes()) {
|
||||
<p class="text-xs text-[var(--text-muted)] mt-1">
|
||||
حداکثر حجم: {{ formatFileSize(maxUploadBytes()) }}
|
||||
</p>
|
||||
}
|
||||
@if (pdfPageLimitLabel()) {
|
||||
<p class="text-xs text-[var(--text-muted)] mt-1">
|
||||
حداکثر تعداد صفحات PDF: {{ pdfPageLimitLabel() }}
|
||||
</p>
|
||||
}
|
||||
@if (configError()) {
|
||||
<p class="text-xs text-[var(--color-danger)] mt-1">{{ configError() }}</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="dropzone relative flex flex-col items-center justify-center gap-3 p-8 border-2 border-dashed border-[rgba(148,163,184,0.25)] rounded-xl bg-[var(--dropzone-bg)] cursor-pointer transition-all duration-300 hover:border-primary/50 hover:bg-primary/5 hover:shadow-[0_10px_30px_rgba(59,130,246,0.15)]"
|
||||
[class.dropzone-active]="isDragging()"
|
||||
[class.dropzone-disabled]="isUploading()"
|
||||
(dragover)="onDragOver($event)"
|
||||
(dragleave)="onDragLeave()"
|
||||
(drop)="onDrop($event)"
|
||||
@@ -114,8 +134,9 @@
|
||||
id="faq-file-input"
|
||||
type="file"
|
||||
class="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
||||
accept=".pdf,.docx,.doc,.txt"
|
||||
[accept]="supportedUploadAccept()"
|
||||
multiple
|
||||
[disabled]="isUploading()"
|
||||
(change)="onFileSelected($event)"
|
||||
/>
|
||||
|
||||
@@ -140,11 +161,11 @@
|
||||
فایلها را اینجا رها کنید
|
||||
</p>
|
||||
<p class="text-xs text-[var(--text-muted)] mt-1">یا کلیک کنید برای انتخاب</p>
|
||||
<p class="text-xs text-[var(--text-muted)] mt-2">پشتیبانی: PDF، DOCX، TXT</p>
|
||||
<p class="text-xs text-[var(--text-muted)] mt-2">پشتیبانی: {{ supportedFormatsLabel() }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (fileCount > 0) {
|
||||
@if (fileCount > 0 && !isUploading()) {
|
||||
<div class="file-list mt-6 animate-slide-up">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-lg font-medium text-[var(--text-primary)] flex items-center gap-2">
|
||||
@@ -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"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4"
|
||||
@@ -224,6 +245,517 @@
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (fileCount > 0 && !isUploading()) {
|
||||
<div class="upload-actions mt-4 flex items-center justify-between gap-3">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn--primary"
|
||||
(click)="uploadFiles()"
|
||||
[disabled]="isUploading() || !capabilitiesLoaded() || !isAdmin()"
|
||||
>
|
||||
<span>آپلود فایلها</span>
|
||||
@if (!isAdmin()) {
|
||||
<span class="text-xs">(مدیریت اسناد فقط برای ادمینها)</span>
|
||||
}
|
||||
@if (!capabilitiesLoaded()) {
|
||||
<span class="text-xs">(تنظیمات سرور بارگذاری نشد)</span>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (isUploading()) {
|
||||
<div class="upload-queue mt-4 space-y-3" aria-live="polite" aria-label="وضعیت آپلود">
|
||||
<h3 class="text-sm font-medium text-[var(--text-secondary)] mb-2">در حال آپلود...</h3>
|
||||
@for (task of uploadQueue(); track $index) {
|
||||
<div class="upload-task flex items-center gap-3">
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<span class="text-sm text-[var(--text-secondary)] truncate">{{ task.file.name }}</span>
|
||||
<span class="text-xs text-[var(--text-muted)]">
|
||||
@if (task.status === 'uploading') {
|
||||
{{ task.progress }}%
|
||||
} @else if (task.status === 'done') {
|
||||
<span class="text-[var(--color-success)]">بارگذاری شد</span>
|
||||
} @else {
|
||||
<span class="text-[var(--color-danger)]">خطا</span>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="upload-progress-bar mt-1 h-1.5 bg-[var(--surface-border)] rounded-full overflow-hidden">
|
||||
<div
|
||||
class="h-full bg-primary rounded-full transition-all duration-200"
|
||||
[style.width]="(task.progress) + '%'"
|
||||
></div>
|
||||
</div>
|
||||
@if (task.error) {
|
||||
<p class="text-xs text-[var(--color-danger)] mt-1">{{ task.error }}</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (task.status === 'uploading') {
|
||||
<button
|
||||
type="button"
|
||||
class="file-remove-btn p-1 text-[var(--text-muted)] rounded transition-colors hover:text-red-400"
|
||||
(click)="cancelUpload($index)"
|
||||
aria-label="لغو آپلود"
|
||||
>
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18" />
|
||||
<line x1="6" y1="6" x2="18" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
@if (task.status === 'error') {
|
||||
<button
|
||||
type="button"
|
||||
class="file-remove-btn p-1 text-[var(--text-muted)] rounded transition-colors hover:text-[var(--color-primary)]"
|
||||
(click)="retryUpload($index)"
|
||||
aria-label="دوبارهسعی آپلود"
|
||||
title="دوبارهسعی"
|
||||
>
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M21 12A9 9 0 0 0 6.6 7.5l-3 3m0 0 3 3-3-3Z" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- اسناد آپلود شده -->
|
||||
<div class="documents-section mt-8">
|
||||
@if (!isAdmin()) {
|
||||
<div class="documents-locked flex flex-col items-center justify-center gap-3 py-10 text-center">
|
||||
<svg class="w-10 h-10 text-[var(--text-muted)]" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M12 1.75v20.5" />
|
||||
<path d="M4.25 12h15.5" />
|
||||
</svg>
|
||||
<p class="text-sm text-[var(--text-secondary)]">مدیریت و لیست اسناد فقط برای ادمینها در دسترس است.</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (isAdmin()) {
|
||||
<div class="section-header mb-4">
|
||||
<h2 class="text-xl font-semibold text-[var(--text-primary)] mb-1 flex items-center gap-2">
|
||||
<svg
|
||||
class="w-5 h-5 text-primary"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
||||
<polyline points="14 2 14 8 20 8" />
|
||||
<polyline points="14 8 20 8 20 14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8z" />
|
||||
</svg>
|
||||
اسناد آپلود شده
|
||||
</h2>
|
||||
<p class="text-sm text-[var(--text-muted)]">
|
||||
فهرست اسناد ثبتشده و وضعیت پردازش آنها. وضعیت در صف یا پردازش در حال پردازش بهصورت خودکار بهروز میشود.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if (documentsLoading() && documents().length === 0) {
|
||||
<div class="documents-loading flex items-center justify-center gap-2 py-10 text-[var(--text-muted)]">
|
||||
<svg class="w-5 h-5 animate-spin" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="12" y1="5" x2="12" y2="19" />
|
||||
<path d="M19 12a7 7 0 1 1-14 0a7 7 0 0 1 14 0z" />
|
||||
</svg>
|
||||
<span>در حال بارگذاری اسناد...</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (documentsError() && documents().length === 0) {
|
||||
<div class="documents-error flex flex-col items-center justify-center gap-3 py-10 text-center">
|
||||
<p class="text-sm text-[var(--text-secondary)]">{{ documentsError() }}</p>
|
||||
<button type="button" class="btn btn--outline" (click)="refreshDocuments()">
|
||||
تلاش مجدد
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (documents().length > 0) {
|
||||
<div class="documents-filters mb-3 flex items-center justify-between gap-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<select
|
||||
class="form-select bg-[var(--input-bg)] text-[var(--text-secondary)] border border-[var(--input-border)] rounded-lg px-3 py-1.5 text-xs min-w-[130px] cursor-pointer"
|
||||
[value]="activeFilter()"
|
||||
(change)="activeFilter.set($any($event.target).value); applyDocumentFilters()"
|
||||
>
|
||||
<option value="all">همه وضعیتها</option>
|
||||
<option value="queued">در صف</option>
|
||||
<option value="processing">در حال پردازش</option>
|
||||
<option value="ready">آماده</option>
|
||||
<option value="failed">ناموفق</option>
|
||||
</select>
|
||||
|
||||
<label class="toggle-switch" [class.toggle-active]="activeOnly()">
|
||||
<input type="checkbox" [checked]="activeOnly()" (change)="activeOnly.set($any($event.target).checked); applyDocumentFilters()" />
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
<span class="text-xs text-[var(--text-muted)]">فقط فعال</span>
|
||||
</div>
|
||||
<button type="button" class="btn btn--outline" (click)="refreshDocuments()" [disabled]="documentsLoading()">
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M3 12a9 9 0 0 1 9-9a9 9 0 1 1 0 18a9 9 0 0 1 0-18z" />
|
||||
<path d="M12 8v4l2 2" />
|
||||
</svg>
|
||||
<span>بهروزرسانی</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="documents-table-wrapper overflow-x-auto rounded-xl border border-[var(--color-card-border)] bg-[var(--card-bg)]">
|
||||
<table class="documents-table min-w-full text-sm text-right">
|
||||
<thead class="bg-[var(--sidebar-hover)]">
|
||||
<tr>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">نام فایل</th>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">عنوان سند</th>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">وضعیت پردازش</th>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">تعداد بخشها</th>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">تاریخ آپلود</th>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">فعالسازی</th>
|
||||
<th class="px-3 py-2 text-xs font-medium text-[var(--text-muted)]">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-[var(--color-card-border)]">
|
||||
@for (doc of documents(); track doc.id) {
|
||||
<tr class="table-row-animate">
|
||||
<td class="px-3 py-2.5 align-top">
|
||||
<span class="text-sm text-[var(--text-secondary)] truncate block max-w-[14rem]"
|
||||
>{{ doc.filename }}</span>
|
||||
</td>
|
||||
<td class="px-3 py-2.5 align-top">
|
||||
<span class="text-sm text-[var(--text-secondary)]">{{ doc.title ?? '—' }}</span>
|
||||
</td>
|
||||
<td class="px-3 py-2.5 align-top">
|
||||
<span
|
||||
class="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
[class.status-queued]="doc.status === 'queued'"
|
||||
[class.status-processing]="doc.status === 'processing'"
|
||||
[class.status-ready]="doc.status === 'ready'"
|
||||
[class.status-failed]="doc.status === 'failed'"
|
||||
>
|
||||
<span class="status-dot" [class.dot-queued]="doc.status === 'queued'"
|
||||
[class.dot-processing]="doc.status === 'processing'" [class.dot-ready]="doc.status === 'ready'"
|
||||
[class.dot-failed]="doc.status === 'failed'"></span>
|
||||
{{ statusLabel(doc.status) }}
|
||||
</span>
|
||||
@if (isReviewNeeded(doc)) {
|
||||
<span class="block text-xs text-[var(--color-warning)] mt-1 font-medium">
|
||||
نیازمند بازبینی ادمین
|
||||
</span>
|
||||
}
|
||||
@if (doc.job.error; as jobError) {
|
||||
<span class="block text-xs text-[var(--color-danger)] mt-1"
|
||||
title="{{ jobError.message }}">{{ jobError.code }}</span>
|
||||
}
|
||||
</td>
|
||||
<td class="px-3 py-2.5 align-top">
|
||||
<span class="text-sm text-[var(--text-muted)]">{{ doc.chunk_count }}</span>
|
||||
</td>
|
||||
<td class="px-3 py-2.5 align-top">
|
||||
<span class="text-sm text-[var(--text-muted)]">{{ formatDateTime(doc.created_at) }}</span>
|
||||
</td>
|
||||
<td class="px-3 py-2.5 align-top min-w-[11rem]">
|
||||
@if (doc.status === 'ready' && !isReviewNeeded(doc) && isAdmin()) {
|
||||
@if (togglingDocId() === doc.id) {
|
||||
<div class="flex items-center gap-1.5 text-xs text-[var(--text-muted)]">
|
||||
<svg class="w-3 h-3 animate-spin" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<line x1="12" y1="5" x2="12" y2="19" />
|
||||
<path d="M19 12a7 7 0 0 1-14 0a7 7 0 0 1 14 0z" />
|
||||
</svg>
|
||||
<span>در حال بهروزرسانی</span>
|
||||
</div>
|
||||
} @else {
|
||||
<button
|
||||
type="button"
|
||||
class="active-toggle"
|
||||
[class.active-toggle--on]="isDocumentActive(doc)"
|
||||
(click)="toggleDocumentActive(doc)"
|
||||
>
|
||||
<span>{{ isDocumentActive(doc) ? 'فعال' : 'غیرفعال' }}</span>
|
||||
</button>
|
||||
}
|
||||
} @else {
|
||||
<span
|
||||
class="text-xs"
|
||||
[class.text-[var(--color-success)]="doc.is_active"
|
||||
[class.text-[var(--text-muted)]="!doc.is_active"
|
||||
>{{ doc.is_active ? 'فعال' : 'غیرفعال' }}</span
|
||||
>
|
||||
}
|
||||
</td>
|
||||
<td class="px-3 py-2.5 align-top">
|
||||
<div class="flex items-center gap-1.5">
|
||||
@if (isReviewNeeded(doc) && doc.status === 'failed') {
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn--outline"
|
||||
[disabled]="reviewingDocId() === doc.id"
|
||||
(click)="openReview(doc)"
|
||||
>
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M2 12s9-7 19-7c2.6 0 4.5 2 4.5 4.5S23.6 19 21 19s-4.5-2.5-4.5-4.5S17.4 7 9 7" />
|
||||
<path d="M2 12s9 7 19 7c2.6 0 4.5-2 4.5-4.5S23.6 7 21 7s-4.5 2.5-4.5 4.5S16.6 17 21 17" />
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
</svg>
|
||||
<span>بازبینی سند</span>
|
||||
</button>
|
||||
}
|
||||
@if (canRetryDocument(doc)) {
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn--outline"
|
||||
(click)="retryDocument(doc)"
|
||||
>
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M21 12A9 9 0 0 0 6.6 7.5l-3 3m0 0 3 3-3-3Z" />
|
||||
</svg>
|
||||
<span>دوبارهسعی</span>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if (!hasMoreDocuments() && !documentsLoading()) {
|
||||
<p class="text-xs text-[var(--text-muted)] text-center mt-3">
|
||||
{{ documents().length }} سند ثبت شده
|
||||
</p>
|
||||
}
|
||||
|
||||
@if (hasMoreDocuments() && !documentsLoading()) {
|
||||
<div class="documents-pagination mt-3 text-center">
|
||||
<button type="button" class="btn btn--outline" (click)="loadMoreDocuments()">
|
||||
بیشتر بارگذاری
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
} @else {
|
||||
@if (!documentsLoading() && !documentsError()) {
|
||||
<div class="documents-empty flex flex-col items-center justify-center gap-3 py-10 text-center">
|
||||
<svg class="w-10 h-10 text-[var(--text-muted)]" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
||||
<polyline points="14 2 14 8 20 8" />
|
||||
<polyline points="14 8 20 8 20 14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5a2 a2 0 0 1 2-2h8z" />
|
||||
</svg>
|
||||
<p class="text-sm text-[var(--text-muted)]">هنوز سندی آپلود نشده است.</p>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Extraction review modal -->
|
||||
@if (reviewingDocId()) {
|
||||
<div class="review-backdrop" (click)="closeReview()">
|
||||
<div
|
||||
class="review-modal"
|
||||
(click)="onReviewModalClick($event)"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="بازبینی سند"
|
||||
>
|
||||
<header class="review-modal-header">
|
||||
<h3 class="text-lg font-semibold text-[var(--text-primary)]">بازبینی استخراج سند</h3>
|
||||
<button type="button" class="file-remove-btn p-1 text-[var(--text-muted)]"
|
||||
(click)="closeReview()" aria-label="بستن">
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="18" y1="6" x2="6" y2="18" />
|
||||
<line x1="6" y1="6" x2="18" y2="18" />
|
||||
</svg>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="review-modal-body">
|
||||
@if (reviewLoading()) {
|
||||
<div class="review-loading flex items-center justify-center gap-2 py-8 text-[var(--text-muted)]">
|
||||
<svg class="w-5 h-5 animate-spin" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<line x1="12" y1="5" x2="12" y2="19" />
|
||||
<path d="M19 12a7 7 0 0 1-14 0a7 7 0 0 1 14 0z" />
|
||||
</svg>
|
||||
<span>در حال بارگذاری شواهد...</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!reviewLoading() && reviewItems().length === 0) {
|
||||
<p class="text-sm text-[var(--text-muted)]">شاهدهای نیازمند بازبینی یافت نشد.</p>
|
||||
}
|
||||
|
||||
@if (!reviewLoading() && reviewItems().length > 0) {
|
||||
<div class="review-items space-y-5">
|
||||
@for (item of reviewItems(); track item.evidence_sha256) {
|
||||
<div class="review-item border border-[var(--color-card-border)] rounded-xl p-4 bg-[var(--surface-bg)]">
|
||||
<div class="review-item-header flex items-center justify-between gap-2 mb-3">
|
||||
<div class="text-xs text-[var(--text-muted)]">
|
||||
<span>{{ reviewKindLabel(item) }}</span>
|
||||
@if (item.location; as location) {
|
||||
<span>
|
||||
@if (location.page != null) { صفحه {{ location.page }} }
|
||||
@if (location.section) { — {{ location.section }} }
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
@if (decisionFor(item) === 'approve' && isReviewSubmittable(item)) {
|
||||
<span class="text-xs text-[var(--color-success)] font-medium">تکمیل شد</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="review-item-body grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div class="review-preview min-h-[120px] flex items-center justify-center bg-[var(--sidebar-hover)] rounded-lg overflow-hidden">
|
||||
@if (previewImageUrl(item); as previewUrl) {
|
||||
<img
|
||||
[src]="previewUrl"
|
||||
[alt]="'پیشنمایش صفحه ' + (item.location?.page ?? '')"
|
||||
class="max-w-full max-h-48 object-contain"
|
||||
loading="lazy"
|
||||
/>
|
||||
} @else {
|
||||
<span class="text-xs text-[var(--text-muted)]">پیشنمایشی موجود نیست</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="review-content space-y-3">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">
|
||||
متن استخراجشده
|
||||
</label>
|
||||
<ul class="text-xs text-[var(--text-secondary)] space-y-1 max-h-36 overflow-y-auto pr-2">
|
||||
@for (block of item.blocks; track block.block_id) {
|
||||
<li class="leading-relaxed">{{ block.text }}</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">
|
||||
بررسیهای الزامی
|
||||
</label>
|
||||
<ul class="space-y-1 text-xs">
|
||||
@for (check of item.required_checks; track check) {
|
||||
<li class="flex items-center gap-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
[id]="item.evidence_sha256 + '-' + check"
|
||||
[checked]="isCheckChecked(item, check)"
|
||||
(change)="toggleCheck(item, check, $any($event.target).checked)"
|
||||
/>
|
||||
<label [attr.for]="item.evidence_sha256 + '-' + check" class="text-[var(--text-secondary)] cursor-pointer">{{ checkLabel(check) }}</label>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">
|
||||
تصمیم
|
||||
</label>
|
||||
<div class="flex items-center gap-3 text-xs">
|
||||
<label class="flex items-center gap-1.5 cursor-pointer">
|
||||
<input type="radio" name="decision-{{ item.evidence_sha256 }}"
|
||||
value="approve" [checked]="decisionFor(item) === 'approve'"
|
||||
(change)="setDecision(item, 'approve')" />
|
||||
<span class="text-[var(--text-secondary)]">تایید</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-1.5 cursor-pointer">
|
||||
<input type="radio" name="decision-{{ item.evidence_sha256 }}"
|
||||
value="reject" [checked]="decisionFor(item) === 'reject'"
|
||||
(change)="setDecision(item, 'reject')" />
|
||||
<span class="text-[var(--text-secondary)]">رد</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">
|
||||
یادداشت بازبینی (الزامی)
|
||||
</label>
|
||||
<textarea
|
||||
class="form-input w-full text-xs"
|
||||
rows="2"
|
||||
[value]="noteFor(item)"
|
||||
(input)="setNote(item, $any($event.target).value)"
|
||||
placeholder="مثال: با صفحه اصلی مقایسه و تاریخ و ساعت تأیید شد."
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
@if (item.review_kind !== 'extraction') {
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-[var(--text-secondary)] mb-1">
|
||||
شناسه گروههای حذفشده (اختیاری)
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-input w-full text-xs"
|
||||
[value]="excludedGroupIdsFor(item)"
|
||||
(input)="setExcludedGroupIds(item, $any($event.target).value)"
|
||||
placeholder="با کامای جدا کنید"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="review-item-actions flex items-center justify-end gap-2 mt-3">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn--primary"
|
||||
[disabled]="!isReviewSubmittable(item)"
|
||||
(click)="submitReviewDecision(item)"
|
||||
>
|
||||
<span>ثبت تصمیم بازبینی</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<footer class="review-modal-footer border-t border-[var(--color-card-border)] p-3 flex justify-end gap-2">
|
||||
@if (canRetryAfterReview()) {
|
||||
<button type="button" class="btn btn--primary" (click)="finishReviewAndRetry()">
|
||||
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M21 12A9 9 0 0 0 6.6 7.5l-3 3m0 0 3 3-3-3Z" />
|
||||
</svg>
|
||||
<span>بستن و دوبارهسعی پردازش</span>
|
||||
</button>
|
||||
}
|
||||
<button type="button" class="btn btn--outline" (click)="closeReview()">
|
||||
<span>بستن</span>
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@@ -244,7 +776,7 @@
|
||||
>
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l-.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l-.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
/>
|
||||
</svg>
|
||||
تنظیمات کلی
|
||||
@@ -252,43 +784,6 @@
|
||||
</div>
|
||||
|
||||
<div class="settings-grid space-y-3">
|
||||
<!-- <div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)]"
|
||||
>زبان رابط کاربری</span
|
||||
>
|
||||
<span class="text-xs text-[var(--text-muted)]"
|
||||
>زبان نمایش برنامه را انتخاب کنید</span
|
||||
>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<select
|
||||
class="form-select bg-[var(--input-bg)] text-[var(--text-secondary)] border border-[var(--input-border)] rounded-lg px-3 py-2 text-sm min-w-[140px] cursor-pointer transition-all duration-200 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 focus:shadow-[0_0_0_3px_var(--color-primary)/20]"
|
||||
[(ngModel)]="language"
|
||||
>
|
||||
<option value="fa">فارسی</option>
|
||||
<option value="en">English</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<span class="text-sm font-medium text-[var(--text-secondary)]">اعلانها</span>
|
||||
<span class="text-xs text-[var(--text-muted)]">دریافت اعلانهای برنامه</span>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<label class="toggle-switch" [class.toggle-active]="notificationsEnabled()">
|
||||
<input type="checkbox" [(ngModel)]="notificationsEnabled" />
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
@@ -304,7 +799,122 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="setting-item flex items-center justify-between gap-4 p-4 bg-[var(--card-bg)] rounded-xl shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200 hover:shadow-[0_4px_16px_rgba(0,0,0,0.08)] hover:-translate-y-0.5"
|
||||
>
|
||||
<div class="setting-info flex flex-col gap-1 min-w-0">
|
||||
<label class="text-sm font-medium text-[var(--text-secondary)] cursor-pointer">
|
||||
نیاز به تأیید ادمین برای اسناد OCR شده
|
||||
</label>
|
||||
<span class="text-xs text-[var(--text-muted)] block mt-0.5">
|
||||
در صورت فعال بودن، محتوای استخراجشده از اسناد باید توسط ادمین بازبینی و تأیید شود.
|
||||
</span>
|
||||
<span class="text-xs text-[var(--color-warning)] mt-0.5">پیشنویس — ذخیرهسازی در فاز MVP پشتیبانی نمیشود</span>
|
||||
</div>
|
||||
<div class="setting-control shrink-0">
|
||||
<label class="toggle-switch" [class.toggle-active]="ocrAdminApproval()">
|
||||
<input type="checkbox" [checked]="ocrAdminApproval()" (change)="toggleOcrApproval()" />
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8">
|
||||
<h3 class="text-lg font-semibold text-[var(--text-primary)] mb-4 flex items-center gap-2">
|
||||
<svg class="w-5 h-5 text-primary" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" />
|
||||
<path d="M19 10v2a7 7 0 0 1-14 0v-2" />
|
||||
<line x1="12" x2="12" y1="19" y2="22" />
|
||||
</svg>
|
||||
تنظیمات مدلهای هوش مصنوعی
|
||||
</h3>
|
||||
<p class="text-xs text-[var(--text-muted)] mb-4">
|
||||
هر کارت بهصورت مستقل پیکربندی میشود. در فاز MVP، این تنظیمات در حافظه نگهداری میشوند و به سرور ارسال نمیشوند.
|
||||
</p>
|
||||
|
||||
<div class="ai-models-grid grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<app-ai-model-config-card
|
||||
title="تنظیمات مدل هوش مصنوعی"
|
||||
task="text"
|
||||
[config]="textModelConfig()"
|
||||
(configChange)="textModelConfig.set($event)"
|
||||
[connected]="textModelConnected()"
|
||||
(save)="saveModelConfig('text')"
|
||||
(testConnection)="testModelConnection('text')"
|
||||
></app-ai-model-config-card>
|
||||
|
||||
<app-ai-model-config-card
|
||||
title="تنظیمات مدل امبدینگ"
|
||||
task="embedding"
|
||||
[config]="embeddingModelConfig()"
|
||||
(configChange)="embeddingModelConfig.set($event)"
|
||||
[connected]="embeddingModelConnected()"
|
||||
(save)="saveModelConfig('embedding')"
|
||||
(testConnection)="testModelConnection('embedding')"
|
||||
></app-ai-model-config-card>
|
||||
|
||||
<app-ai-model-config-card
|
||||
title="تنظیمات مدل OCR"
|
||||
task="ocr"
|
||||
[config]="ocrModelConfig()"
|
||||
(configChange)="ocrModelConfig.set($event)"
|
||||
[connected]="ocrModelConnected()"
|
||||
(save)="saveModelConfig('ocr')"
|
||||
(testConnection)="testModelConnection('ocr')"
|
||||
></app-ai-model-config-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8">
|
||||
<h3 class="text-lg font-semibold text-[var(--text-primary)] mb-4 flex items-center gap-2">
|
||||
<svg class="w-5 h-5 text-primary" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" />
|
||||
<path d="M19 10v2a7 7 0 0 1-14 0v-2" />
|
||||
<line x1="12" x2="12" y1="19" y2="22" />
|
||||
</svg>
|
||||
تنظیمات مدلهای داخلی
|
||||
</h3>
|
||||
<p class="text-xs text-[var(--text-muted)] mb-4">
|
||||
مدلهای داخلی مرکز تماس — تبدیل گفتار به نوشتار، تبدیل نوشتار به گفتار و مدل گفتگو —
|
||||
هر کارت بهصورت مستقل پیکربندی میشود. در فاز MVP، این تنظیمات در حافظه نگهداری میشوند و به
|
||||
سرور ارسال نمیشوند.
|
||||
</p>
|
||||
|
||||
<div class="ai-models-grid grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<app-ai-model-config-card
|
||||
title="تنظیمات مدل تبدیل گفتار به نوشتار"
|
||||
task="stt"
|
||||
[config]="sttModelConfig()"
|
||||
(configChange)="sttModelConfig.set($event)"
|
||||
[connected]="sttModelConnected()"
|
||||
(save)="saveModelConfig('stt')"
|
||||
(testConnection)="testModelConnection('stt')"
|
||||
></app-ai-model-config-card>
|
||||
|
||||
<app-ai-model-config-card
|
||||
title="تنظیمات مدل تبدیل نوشتار به گفتار"
|
||||
task="tts"
|
||||
[config]="ttsModelConfig()"
|
||||
(configChange)="ttsModelConfig.set($event)"
|
||||
[connected]="ttsModelConnected()"
|
||||
(save)="saveModelConfig('tts')"
|
||||
(testConnection)="testModelConnection('tts')"
|
||||
></app-ai-model-config-card>
|
||||
|
||||
<app-ai-model-config-card
|
||||
title="تنظیمات مدل گفتگوی داخلی"
|
||||
task="dialogue"
|
||||
[config]="dialogueModelConfig()"
|
||||
(configChange)="dialogueModelConfig.set($event)"
|
||||
[connected]="dialogueModelConnected()"
|
||||
(save)="saveModelConfig('dialogue')"
|
||||
(testConnection)="testModelConnection('dialogue')"
|
||||
></app-ai-model-config-card>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user