690522:0839 227 #02
CI / CD Pipeline / build (push) Successful in 5m27s
CI / CD Pipeline / deploy (push) Successful in 5m18s

This commit is contained in:
2026-05-22 08:39:26 +07:00
parent f47363c24a
commit 2e50bcaa58
8 changed files with 40 additions and 21 deletions
+7 -7
View File
@@ -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.
@@ -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<string, string> = {
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];
}),
+4 -1
View File
@@ -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"
+5 -3
View File
@@ -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
```
---
+6 -3
View File
@@ -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
```
+6 -3
View File
@@ -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`
@@ -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
</span>
)}
</DialogTitle>
{/* sr-only: ซ่อนจาก UI แต่ screen reader อ่านได้ — จำเป็นสำหรับ Radix DialogContent */}
<DialogDescription className="sr-only">
{attachment?.originalFilename ?? t('filePreview.fallbackTitle')}
</DialogDescription>
</DialogHeader>
{/* Body — Preview Area */}
+4 -2
View File
@@ -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();