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