diff --git a/backend/.env.example b/backend/.env.example index 2b350967..f3e3ac43 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -36,9 +36,9 @@ CLAMAV_PORT=3310 # ======================================== # Isolated AI Host (Desk-5439) -AI_HOST_URL=http://192.168.10.100:11434 -AI_QDRANT_URL=http://192.168.10.100:6333 -AI_N8N_WEBHOOK_URL=http://192.168.10.100:5678/webhook/lcbp3-ai +AI_HOST_URL=http://192.168.10.8:11434 +AI_QDRANT_URL=http://192.168.10.8:6333 +AI_N8N_WEBHOOK_URL=http://192.168.10.8:5678/webhook/lcbp3-ai AI_N8N_SERVICE_TOKEN=change-me-service-token AI_TIMEOUT_MS=30000 AI_MAX_RETRIES=3 @@ -54,18 +54,18 @@ OLLAMA_MODEL_MAIN=gemma4:e4b OLLAMA_MODEL_EMBED=nomic-embed-text OLLAMA_EMBED_MODEL=nomic-embed-text OLLAMA_RAG_MODEL=gemma4:e4b -OLLAMA_URL=http://192.168.10.100:11434 +OLLAMA_URL=http://192.168.10.8:11434 # Qdrant (ADR-023A) -QDRANT_HOST=http://192.168.10.100:6333 +QDRANT_HOST=http://192.168.10.8:6333 QDRANT_COLLECTION=lcbp3_documents # OCR sidecar (PaddleOCR on Desk-5439) OCR_CHAR_THRESHOLD=100 -OCR_API_URL=http://192.168.10.100:8765 +OCR_API_URL=http://192.168.10.8:8765 # Thai preprocessing microservice (PyThaiNLP — Admin Desktop) -THAI_PREPROCESS_URL=http://192.168.10.100:8765 +THAI_PREPROCESS_URL=http://192.168.10.8:8765 # ADR-023 forbids cloud AI fallback for project documents. diff --git a/backend/tests/integration/cross-spec/qdrant-isolation.spec.ts b/backend/tests/integration/cross-spec/qdrant-isolation.spec.ts index b0741c99..5b6e32d8 100644 --- a/backend/tests/integration/cross-spec/qdrant-isolation.spec.ts +++ b/backend/tests/integration/cross-spec/qdrant-isolation.spec.ts @@ -1,5 +1,6 @@ // File: backend/tests/integration/cross-spec/qdrant-isolation.spec.ts // Change Log: +// - 2026-05-22: อัปเดต IP Address ของ Qdrant จาก 192.168.10.100 เป็น 192.168.10.8 ตามความต้องการของผู้ใช้ // - 2026-05-21: แก้ไข Type Casting ของ AiQdrantService ด้วย unknown // - 2026-05-16: Cross-spec integration test for QdrantService projectPublicId isolation // - 2026-05-16: Fixed mocking strategy to use factory pattern with proper method exposure @@ -49,8 +50,8 @@ describe('Cross-Spec: QdrantService Isolation', () => { useValue: { get: jest.fn((key: string) => { const config: Record = { - AI_QDRANT_URL: 'http://192.168.10.100:6333', - QDRANT_URL: 'http://192.168.10.100:6333', + AI_QDRANT_URL: 'http://192.168.10.8:6333', + QDRANT_URL: 'http://192.168.10.8:6333', }; return config[key]; }), diff --git a/docs/cross-spec/gpu-scheduling.md b/docs/cross-spec/gpu-scheduling.md index 80f27757..41f642fe 100644 --- a/docs/cross-spec/gpu-scheduling.md +++ b/docs/cross-spec/gpu-scheduling.md @@ -1,3 +1,6 @@ +// File: docs/cross-spec/gpu-scheduling.md +// Change Log +// - 2026-05-22: แก้ไข IP Address ของเซิร์ฟเวอร์ AI จาก 192.168.10.100 เป็น 192.168.10.8 เพื่อให้ตรงกับสภาพแวดล้อมจริง # Cross-Spec: GPU Resource Coordination **Date**: 2026-05-16 @@ -79,7 +82,7 @@ export class AiRealtimeProcessor { watch -n 1 nvidia-smi # Check Ollama model status -curl http://192.168.10.100:11434/api/ps +curl http://192.168.10.8:11434/api/ps # Monitor queue states redis-cli KEYS "bull:*:meta" diff --git a/docs/deployment-setup-guide.md b/docs/deployment-setup-guide.md index 2df18a39..77d51bea 100644 --- a/docs/deployment-setup-guide.md +++ b/docs/deployment-setup-guide.md @@ -1,4 +1,6 @@ // File: docs/deployment-setup-guide.md +// Change Log +// - 2026-05-22: แก้ไข IP Address ของเซิร์ฟเวอร์ AI จาก 192.168.10.100 เป็น 192.168.10.8 เพื่อให้ตรงกับสภาพแวดล้อมจริง # คู่มือการตั้งค่าและการ Deploy ระบบ (Deployment Setup Guide) > **Project:** NAP-DMS (LCBP3) @@ -129,9 +131,9 @@ CLAMAV_HOST=lcbp3-clamav CLAMAV_PORT=3310 # AI Services Boundary (ADR-023/ADR-023A - Isolation on Admin Desktop) -OLLAMA_URL=http://192.168.10.100:11434 -AI_HOST_URL=http://192.168.10.100:11434 -AI_QDRANT_URL=http://192.168.10.100:6333 +OLLAMA_URL=http://192.168.10.8:11434 +AI_HOST_URL=http://192.168.10.8:11434 +AI_QDRANT_URL=http://192.168.10.8:6333 ``` --- diff --git a/docs/development-setup-guide.md b/docs/development-setup-guide.md index 7a167058..ad67ce13 100644 --- a/docs/development-setup-guide.md +++ b/docs/development-setup-guide.md @@ -1,3 +1,6 @@ +// File: docs/development-setup-guide.md +// Change Log +// - 2026-05-22: แก้ไข IP Address ของเซิร์ฟเวอร์ AI จาก 192.168.10.100 เป็น 192.168.10.8 เพื่อให้ตรงกับสภาพแวดล้อมจริง # คู่มือการตั้งค่าและเริ่มต้น Development (Development Setup Guide) > **LCBP3-DMS — Document Management System** @@ -190,9 +193,9 @@ CLAMAV_HOST=localhost CLAMAV_PORT=3310 # AI Services (ถ้ามี AI Host) -AI_HOST_URL=http://192.168.10.100:11434 -AI_QDRANT_URL=http://192.168.10.100:6333 -OLLAMA_URL=http://192.168.10.100:11434 +AI_HOST_URL=http://192.168.10.8:11434 +AI_QDRANT_URL=http://192.168.10.8:6333 +OLLAMA_URL=http://192.168.10.8:11434 OLLAMA_MODEL_MAIN=gemma4:e4b OLLAMA_MODEL_EMBED=nomic-embed-text ``` diff --git a/docs/local-dev-setup.md b/docs/local-dev-setup.md index a7b5163e..bc999db6 100644 --- a/docs/local-dev-setup.md +++ b/docs/local-dev-setup.md @@ -1,3 +1,6 @@ +// File: docs/local-dev-setup.md +// Change Log +// - 2026-05-22: แก้ไข IP Address ของเซิร์ฟเวอร์ AI จาก 192.168.10.100 เป็น 192.168.10.8 เพื่อให้ตรงกับสภาพแวดล้อมจริง # Local Dev Setup Guide > วิธีตั้งค่าและรัน Development Environment สำหรับ LCBP3 NAP-DMS @@ -66,9 +69,9 @@ REDIS_PASSWORD=Center2025 JWT_SECRET=<สร้างด้วย openssl rand -base64 32> # AI services (ถ้าไม่ใช้ AI ให้ปล่อยค่าเดิมได้) -OLLAMA_URL=http://192.168.10.100:11434 -AI_HOST_URL=http://192.168.10.100:11434 -AI_QDRANT_URL=http://192.168.10.100:6333 +OLLAMA_URL=http://192.168.10.8:11434 +AI_HOST_URL=http://192.168.10.8:11434 +AI_QDRANT_URL=http://192.168.10.8:6333 ``` ### Frontend — `frontend/.env.local` diff --git a/frontend/components/common/file-preview-modal.tsx b/frontend/components/common/file-preview-modal.tsx index 200e283f..ed011cbd 100644 --- a/frontend/components/common/file-preview-modal.tsx +++ b/frontend/components/common/file-preview-modal.tsx @@ -8,6 +8,7 @@ import { useEffect, useState } from 'react'; import { Dialog, DialogContent, + DialogDescription, DialogHeader, DialogTitle, DialogFooter, @@ -101,6 +102,10 @@ export function FilePreviewModal({ attachment, onClose, onUnavailable }: FilePre )} + {/* sr-only: ซ่อนจาก UI แต่ screen reader อ่านได้ — จำเป็นสำหรับ Radix DialogContent */} + + {attachment?.originalFilename ?? t('filePreview.fallbackTitle')} + {/* Body — Preview Area */} diff --git a/frontend/hooks/__tests__/use-ai-chat.test.ts b/frontend/hooks/__tests__/use-ai-chat.test.ts index 99f18906..ebcee37f 100644 --- a/frontend/hooks/__tests__/use-ai-chat.test.ts +++ b/frontend/hooks/__tests__/use-ai-chat.test.ts @@ -1,6 +1,7 @@ // File: frontend/hooks/__tests__/use-ai-chat.test.ts // Change Log: // - 2026-05-19: สร้าง Unit Test สำหรับ useAiChat Hook +// - 2026-05-22: แก้ act() warning ใน test ล้างประวัติ — ใช้ async act() แทน sync import { describe, it, expect, vi, beforeEach } from 'vitest'; import { renderHook, waitFor, act } from '@testing-library/react'; @@ -65,8 +66,9 @@ describe('useAiChat hook', () => { it('ควรสามารถล้างประวัติการสนทนาได้', async () => { const { wrapper } = createTestQueryClient(); const { result } = renderHook(() => useAiChat(mockContext), { wrapper }); - act(() => { - result.current.sendMessage('สวัสดี'); + // ใช้ async act() เพื่อให้ React flush state updates จาก sendMessage (Promise) ได้ครบ + await act(async () => { + void result.current.sendMessage('สวัสดี'); }); act(() => { result.current.clearHistory();