Commit Graph

254 Commits

Author SHA1 Message Date
969b4d85ef fix: suppress 404 errors for optional MBE models endpoint and defer user loading
- loadMbeModels no longer logs console.error for 404 (endpoint may not exist)
- loadUsers removed from onMounted - only called after admin login
- Prevents 401 errors on page load before user has authenticated
- Users tab now only loads data after successful login
2026-10-27 02:32:54 +08:00
1caca73614 feat: integrate settings validation API before saving upload path
- saveUploadPath now validates path via POST /api/v2/settings/validate
- Shows clear error message if path doesn't exist or isn't writable
- Only saves if validation passes (valid: true)
- 5 validation checks: format, existence, type, read/write permissions
2026-10-27 02:28:49 +08:00
3b638f0416 feat: integrate MarkBase Admin API with Bearer token authentication
- Added useAdminAuth composable for login/logout/token management
- Admin Users tab now requires login before showing users
- loadUsers/loadShares now use direct fetch with Bearer token
- Added login form with username/password fields
- Token stored in localStorage with expiry check
- Default credentials: demo/demo123
2026-10-27 02:17:41 +08:00
4129c174ed feat: integrate MarkBase Settings API (GET/POST /api/v2/settings)
- Replaced deprecated /api/v2/config with new /api/v2/settings
- loadSettings() now uses GET /api/v2/settings (structured JSON)
- saveUploadPath() now uses POST /api/v2/settings
- Removed PostgreSQL migration error handling (no longer needed)
- Settings page now works correctly with SQLite-only MarkBase
2026-10-27 02:06:57 +08:00
59bcd9a9b5 docs: add MarkBase API requirements for Studio integration
- Created MARKBASE_API_REQUIREMENTS.md with detailed API specs
- Requests GET/POST /api/v2/settings endpoints from MarkBase team
- Documents current issues with /api/v2/config returning 500
- Defines required fields, error handling, and priority levels
2026-10-27 01:45:44 +08:00
cb2b6a0292 fix: show clear error message when MarkBase needs restart (PostgreSQL→SQLite migration)
- Detects 'missing field postgresql' error from MarkBase config endpoint
- Shows user-friendly message: 'MarkBase needs restart (PostgreSQL→SQLite migration)'
- Helps users understand the error is due to outdated MarkBase instance
2026-10-27 01:41:07 +08:00
052178b084 fix: improve Settings page error message for MarkBase config failures
- loadSettings now shows detailed error from MarkBase response body
- MarkBase /api/v2/config returns 500 when config file is incomplete
- Error message now includes actual error details instead of just HTTP status
2026-10-27 01:27:34 +08:00
388c548e4a feat: multi-language support for agent search and admin pipeline config
- search_agents now accepts output_language parameter (en/zh-TW/ja)
- Admin Settings: added Pipeline Configuration section (enabled, max_concurrent_stages, default_timeout_secs)
- Admin Settings: search config now includes vlm_output_language dropdown
- Added translations for pipeline config in en/zh-TW/ja locales
- Agent search uses searchConfig.vlm_output_language for output language
2026-10-27 01:18:19 +08:00
716d3954e7 fix: proxy forwards mbe health to Core API instead of direct llama-server access
- Previously proxy accessed llama-server /health endpoint directly
- Now forwards /api/v1/mbe/health to Core API (3002) which has full health check
- Returns complete health info: status, model, uptime
- Fixes frontend not showing 'online' status in Admin Settings
2026-10-24 12:25:01 +08:00
b1978fabc5 fix: add /health proxy rule to Vite config
- Vite now forwards /health to Rust proxy (port 8888)
- Required for Admin Panel proxy health check to work in dev mode
- External Caddy reverse proxy may also need /health forwarding rule
2026-10-23 21:36:57 +08:00
fa7a9e1084 fix: Admin Panel health checks work via reverse proxy
- loadServiceUrls: use window.location.origin for remote access, localhost for local dev
- testCoreApi: use /api/v1/health for remote, /health for localhost
- testProxy: health check path works for both
- testMbe: already uses getApiBase() which handles both cases

This fixes the issue where Admin Panel showed offline when accessed via
https://nextorage.momentry.ddns.net because localhost health checks
point to user's machine, not the server.
2026-10-23 21:35:29 +08:00
88867e80e5 fix: handle 404 for scenes endpoint gracefully
- Scenes endpoint may not be implemented in Core API yet
- useVLMScenes returns empty array instead of error on 404
2026-10-23 20:22:48 +08:00
e2612dde72 feat: add VLM composables for Vue 3 integration
- useVLMScenes(fileUuid): load scenes for a specific file with thumbnails
- useVLMSearch(): search VLM scenes and traces with bilingual support
- useSceneThumbnail(fileUuid, sceneIndex): load scene thumbnail URLs
- TypeScript interfaces: VLMTag, VLMScene, VLMTrace, FileScene
- Uses direct HTTP calls via getApiBase() (no Tauri IPC needed)
- Follows Vue 3 composable best practices (ref, loading, error states)
2026-10-23 20:21:00 +08:00
6db184c7d0 feat: export marked results with VLM data and tags
- toggleMark now captures vlm_description, vlm_description_localized, vlm_tags, vlm_objects, thumbnail_url
- exportMarked generates structured JSON with vlm section containing en/localized descriptions and tags
- Export filename changed to vlm-marked-export-{timestamp}.json
- Includes source_type, scene_index, trace_id for complete result metadata
2026-10-23 18:15:38 +08:00
fa8e4a9191 fix: simplify bilingual VLM search - use single API call
- Core API now returns both vlm_description (EN) and vlm_description_localized (JA)
- Removed duplicate API calls (was fetching EN + JA separately)
- Single API call with output_language param, uses both fields from response
- Load More also updated to use results array and correct field names
- Format: 【JA】localized text...【English】english text...
2026-10-23 04:59:55 +08:00
76d9afd43b fix: use vlm_description_localized field name from Core API
- Changed vlm_description_lang to vlm_description_localized
- Core API outputs vlm_description (EN) + vlm_description_localized (JA)
- Frontend shows localized first: 【JA】...【English】...
2026-10-23 04:56:56 +08:00
1ffceaba26 fix: search visual cards show localized language first (JA before EN)
- Bilingual format: 【JA】... then 【English】...
- Summary uses localized language (vlm_description_lang) as primary
- Load More function now also supports bilingual format
- Fallback: only vlm_description shows single language without labels
2026-10-23 04:41:15 +08:00
342d4e33b8 fix: Admin panel always uses localhost URLs for service health checks
- Removed isLocalhost checks from loadServiceUrls()
- All services now default to http://localhost:XXXX
- Health check URLs always use direct paths (/health)
- Fixes Core API and Proxy showing offline from external URL
2026-10-23 02:22:28 +08:00
6e0e306082 fix: optimize MBE start flow - skip redundant frontend polling
- Backend already polls 60s for MBE port readiness
- Frontend no longer polls 30s after backend returns
- Total wait time: ~60s instead of ~90s
- Start timeout set to 60s for MBE
2026-10-23 01:31:50 +08:00
c21c186e0c fix: increase start_service timeout for MBE to 60s
- MBE needs up to 60s to load model
- Default timeout (30s) was too short causing timeout errors
2026-10-23 01:22:44 +08:00
50bd33106f fix: MBE health check proxy and admin page
- Added /api/v1/mbe/health proxy endpoint
- Frontend uses proxy for MBE health check (works on localhost and external)
- Accepts 'healthy' status from MBE response
- Shows model info (MBE e4b) in Admin UI
2026-10-23 00:33:31 +08:00
951a2964f3 feat: add MBE health check proxy endpoint
- Added /api/v1/mbe/health proxy in Studio proxy (port 8888)
- Frontend now uses proxy endpoint instead of direct mbeUrl
- Works for both localhost and external access (once proxy is deployed)
- MBE health response: {status: 'healthy', model: 'e4b', layers: 42}
2026-10-22 23:52:23 +08:00
a429aca344 fix: accept MBE 'healthy' status and show model info
- Updated testMbe() to accept status='healthy' from MarkBaseServer
- Added model and layers info to mbeInfo display
- MBE now shows 'MBE (e4b)' instead of generic 'MarkBaseEngine'
2026-10-22 21:55:52 +08:00
2cff332d55 feat: fix MBE health check and add model selection dropdown
- Fixed testMbe() to always use /health instead of /v1/health
- Added model selection dropdown for MarkBaseEngine
- Modified startService('mbe') to pass model and port parameters
- Added loadMbeModels() to fetch available models on mount
- Added getApiBase import
2026-10-22 21:40:47 +08:00
38260a4c61 fix: full file playback resets all state to play to end of file
- Clear all marks (not just face marks)
- Reset playMode to 'continuous' to disable trace/segment limits
- Reset currentTraceIdx and currentSegmentIdx to 0
- Reset seekFrame to 0
- This ensures full file plays from start to end without restrictions
2026-10-21 01:47:20 +08:00
3b2c7c65ae feat: clickable file name in video player for full file playback
- File name in header is now clickable
- Click reloads video with full file range (startFrame=0, endFrame=999999)
- Added play icon and hover effect for visual feedback
2026-10-21 01:32:23 +08:00
fc32fb0f86 fix: full file playback and file name display
- Use endFrame=999999 for full file playback (backend clips correctly)
- Add z-index:10 to card-file-info to prevent being obscured
- Full file now plays complete duration
2026-10-20 22:26:38 +08:00
971cfe50f5 feat: add clickable file name bar with full-file playback
- Add card-file-info bar at top of search result cards
- Click file name to play full file (startFrame: 0, endFrame: 0)
- Show video/document icon based on file extension
- Display file UUID badge
- Remove duplicate card-file section from bottom of card
2026-10-20 22:01:53 +08:00
c425c29d01 feat: persist search session across page navigation
- Save messages to localStorage when leaving search page
- Restore messages when returning to search page
- Clear session on newChat()
- Session includes: messages, conversationId, fileUuidCache, mode
2026-10-20 18:06:52 +08:00
55c39e7732 feat: keep only last 2 hours of search history
- Filter history to show only items from last 2 hours
- Pinned items are always kept regardless of age
- Auto-cleanup old unpinned items from database
- Increased fetch limit to 50 to ensure enough items for filtering
2026-10-20 17:57:27 +08:00
a75250ed17 fix: recover corrupted search_history SQLite database
- Database was corrupted (WAL file had uncommitted data)
- Recovered 101 search history records from WAL
- Cleaned up test data with empty ID
- Proxy now returns 30 records correctly
2026-10-20 17:49:55 +08:00
ca569f3e5c fix: re-scan now shows status update immediately
Root cause: finally block called loadFiles() which cleared the cache
and reloaded from server, overwriting the manual 'scanning' status.
Server videos.status may not be synced yet by PostgreSQL trigger.

Fix: Remove loadFiles() from finally block. Keep manual status update.
Polling mechanism will sync status from server automatically.
2026-10-18 23:43:45 +08:00
7f6db1a387 debug: add console.log to re-scan flow
- Added logging to ctxReprocess, doReprocess
- Log API call and response for debugging
- Check if reprocessing flag is blocking the action
2026-10-18 23:21:28 +08:00
5e0eac6700 fix: allow re-scan for paused files
- Added Rescan button for paused files in context menu
- Re-scan now removes file from paused set
- Paused files can be re-scanned directly without resuming first
2026-10-18 23:13:44 +08:00
ef45cd53df feat: add paused status count to library status bar
- Added pausedCount computed property
- Added ⏸ Paused N to status bar between Scanning and Completed
- Paused count displayed in warning color (yellow) to distinguish from Scanning
2026-10-18 22:59:13 +08:00
46c0a6ff64 fix: show Resume button instead of Deep Scan for paused files
- Deep Scan button hidden when status is 'paused'
- Resume button shows when status is 'paused'
- Pause button shows when status is 'scanning'
- Simplified conditions: no longer need isFilePaused check in template
2026-10-18 22:50:47 +08:00
ed15f4c3e7 refactor: use PostgreSQL trigger for status sync instead of manual cache update
Core Team implemented PostgreSQL trigger (sync_video_status) that automatically
syncs videos.status when monitor_jobs.status changes. Removed frontend workaround
that manually updated filesCache/fileStatusCache.

Now ctxPause/batchPause call loadFiles() + loadPausedFiles() after success
to get the properly synced status from backend.
2026-10-18 22:14:19 +08:00
a64e200ca5 fix: pause/resume now manually updates file status in cache
Root cause: backend pause updates monitor_jobs table, but frontend
displays status from videos table (via get_files API). These are separate.

Fix:
- ctxPause: manually sets file.status = 'paused' in filesCache + fileStatusCache
- batchPause: same manual cache update for each file
- ctxResume/batchResume: calls loadFiles() to refresh from backend
- Added console.log debug for troubleshooting
- Fixed i18n: removed duplicate emoji from translation strings
2026-10-18 21:38:47 +08:00
67e806037f fix: pause/resume now reloads files to update status badge
- ctxPause and ctxResume now call loadFiles() + loadPausedFiles()
- batchPause and batchResume also reload after completion
- Use new Set() for proper Vue reactivity
- Fixes status badge not updating after pause
2026-10-18 21:13:39 +08:00
4e90f832d9 feat: add pause/resume to library context menu and batch operations
- Add pause/resume buttons to file context menu (right-click)
- Add batch pause/resume buttons to section titles
- Support concurrent pause/resume with pLimit(3)
- Add paused status badge (⏸) with warning color
- Integrate with Core API /api/v1/jobs/:uuid/pause|resume
- Track paused files via Redis jobs:paused set
- Add i18n translations (zh-TW, en)
2026-10-18 21:09:05 +08:00
f43786f6af docs: 新增 Pipeline 四階段進度更新說明 (Core Team)
新增文件:
- docs/PIPELINE_PROGRESS_UPDATE_FOR_CORE.md

目的:
說明 Momentry Studio 前端對 Pipeline 進度顯示的實現和需求,供 Core Team 參考實現後端 API。

文件內容:

1. 四階段架構說明
   - 階段 1: 處理器 (30%) - ASR、ASRX、FACE、Face Tracing、OCR、CUT
   - 階段 2: 知識圖譜 (35%) - TKG Nodes、TKG Edges
   - 階段 3: 片段提取 (6%) - VLM Summary、Scene VLM、Moment Chunks
   - 階段 4: 資料整合 (29%) - Rule1、Rule2、Face Dedup

2. 關鍵更新說明
   - ASRX 處理器: 說話人向量化 (VOD)
   - Face Tracing: 從階段 4 移至階段 1
   - 向量入庫: 文字、說話人、人臉

3. 進度計算方式
   - 總體進度 = 加權平均
   - 計算範例

4. 需要的 API 端點
   - GET /api/v1/pipeline/phases (主要)
   - GET /api/v1/file/{uuid}/progress (快速輪詢)
   - GET /api/v1/file/{uuid}/scene-vlm-stats (已實現)

5. API 回應格式
   - 完整的 JSON 結構
   - 狀態值定義
   - 進度範例

6. 前端實現說明
   - 顯示位置
   - 顯示內容
   - 更新機制

7. 處理器完整列表
   - 名稱、功能、輸出

8. 建議實現順序
   - Phase 1-4 實現步驟

9. 驗收標準
   - API 驗收
   - 進度更新驗收
   - 前端顯示驗收

用途:
- Core Team 實現後端 API 的參考文件
- 前後端協作規範
- 測試驗收標準
2026-10-15 14:08:50 +08:00
9b3f88c98c docs: 更正處理器說明 - ASRX 和 Face Tracing
更新內容:

1. ASRX 處理器 (說話人向量化)
   - 修正名稱: VSRX → ASRX
   - 功能說明: 使用 VOD 將說話人語音特徵轉換為向量
   - 建立說話人身分

2. Face Tracing 移至階段 1
   - 從階段 4 (資料整合) 移至階段 1 (處理器)
   - 更新階段 4 進度說明
   - 更新範例場景

處理器完整列表:
- ASR: 語音識別
- ASRX: 說話人向量化 (VOD)
- FACE: 人臉檢測
- Face Tracing: 人臉追蹤
- OCR: 文字識別
- CUT: 鏡頭切換

階段 4 更新:
- 移除 Face Tracing (已移至階段 1)
- 保留: Rule1/Rule2 入庫、Face Dedup
- 進度含義更新
2026-10-15 13:10:38 +08:00
dafbfb7a0b docs: 添加 VSRX 處理器說明
更新內容:
- 處理器列表新增 VSRX (說話人辨認)
- VSRX 功能: 識別視訊中的說話人,建立說話人身分

處理器完整列表:
- ASR: 語音識別
- VSRX: 說話人辨認
- FACE: 人臉檢測
- OCR: 文字識別
- CUT: 鏡頭切換

說明:
VSRX 負責說話人辨認功能
- 識別視訊中的不同說話人
- 建立說話人身分
- 為後續說話人向量入庫提供基礎
2026-10-15 13:04:26 +08:00
1487793a9a docs: 更新為繁體中文並補充向量入庫說明
更新內容:
1. 繁體中文表達
   - 所有簡體字轉換為繁體
   - 用語符合台灣習慣

2. 移除已取消的處理器
   - 刪除 POSE (姿態估計)
   - 刪除 APPEARANCE (外觀檢測)
   - 這兩個處理器已實際取消

3. 補充向量入庫說明
   - 文字向量入庫
     * 句子嵌入向量
     * 語意搜尋
     * 相似文字匹配

   - 說話人語音向量入庫 (VOD 實現)
     * 說話人嵌入向量
     * 說話人識別
     * 跨視訊說話人追蹤

   - 人臉向量入庫
     * 人臉嵌入向量
     * 人臉相似度搜尋
     * 人臉身分識別

4. 更新階段 4 說明
   - Rule1: PostgreSQL 入庫
   - Rule2: 向量入庫 (Qdrant)
     * 文字向量
     * 說話人向量
     * 人臉向量

處理器列表:
- ASR: 語音識別
- FACE: 人臉檢測
- OCR: 文字識別
- CUT: 鏡頭切換

已移除:
- POSE: 姿態估計 (已取消)
- APPEARANCE: 外觀檢測 (已取消)
2026-10-15 12:48:59 +08:00
ae8861cf9d docs: 添加 Pipeline 四阶段中文说明文档
新增文档:
1. PIPELINE_STAGES_EXPLANATION.md - 详细说明
   - 四阶段总览
   - 各阶段详细说明
   - 进度计算方式
   - 依赖关系
   - 用户操作指南
   - 常见问题

2. PIPELINE_STAGES_QUICK_REF.md - 快速参考
   - 简洁表格总览
   - 关键信息快速查看
   - 进度计算公式
   - 使用提示

四阶段说明:
1. 处理器 (Processors) - 30%
   - 原始媒体分析
   - ASR、人脸检测、OCR等

2. 知识图谱 (Knowledge Graph) - 35%
   - 构建人物关系网络
   - TKG Nodes + Edges

3. 片段提取 (Moment Extraction) - 6%
   - AI 内容理解
   - 场景分析、片段分割

4. 数据整合 (Integration) - 29%
   - 数据入库存储
   - 人脸追踪、去重

用途:
- 用户理解处理流程
- 开发者参考架构
- 技术文档支持

语言: 中文
2026-10-15 12:37:19 +08:00
f298626487 feat: 实现四阶段进度显示
问题:
- 当前进度显示使用旧的处理器列表
- 显示了所有独立的处理步骤,而不是分阶段

解决方案:
- 将处理步骤聚合到四个主要阶段
- 实现阶段级进度计算
- 更新阶段名称显示

四阶段结构:
1. Processors (30%)
   - 包含所有处理器 (ASR, FACE, OCR, etc.)

2. Knowledge Graph (35%)
   - tkg_nodes
   - tkg_edges

3. Moment Extraction (6%)
   - vlm_summary
   - scene_vlm
   - moment_chunks

4. Integration (29%)
   - rule1_ingestion
   - rule2_ingestion
   - face_tracing
   - face_dedup

实现细节:
- loadPipelineStats() 中添加阶段聚合逻辑
- 根据步骤权重计算阶段进度
- 根据步骤状态确定阶段状态
- formatStageName() 更新阶段名称映射

进度计算:
- 阶段进度 = 加权平均步骤进度
- 阶段状态 = 优先级: failed > completed > running > pending
- 总体进度 = 加权阶段进度之和

显示效果:
- ✗ Processors: 0%
- ✓ Knowledge Graph: 100%
- ✗ Moment Extraction: 33%
- ✗ Integration: 50%

优势:
- 更清晰的阶段划分
- 更好的进度概览
- 更符合实际处理流程
2026-10-14 20:23:42 +08:00
86832229a9 feat: 添加 Pipeline Progress API 支持
新增功能:
1. Pipeline Phases 配置
   - loadPipelinePhases() 函数
   - 调用 GET /api/v1/pipeline/phases
   - 缓存配置(静态,不常变化)

2. File Progress API
   - loadFileProgress() 函数
   - 调用 GET /api/v1/file/{uuid}/progress
   - 返回详细的阶段和处理器进度

3. 类型定义
   - PipelinePhasesConfig
   - FileProgressDetail
   - PhaseProgressDetail
   - ProcessorProgressDetail

4. loadPipelineStats() 增强
   - 优先使用新的 progress API
   - 自动降级到旧 API
   - 支持阶段进度计算

API Endpoints:
GET /api/v1/pipeline/phases
GET /api/v1/file/{uuid}/progress

返回格式:
{
  "file_uuid": "...",
  "overall_progress": 0.75,
  "current_phase": "tkg_nodes",
  "phases": {
    "processors": {
      "status": "completed",
      "progress": 1.0,
      "processors": {...}
    }
  }
}

用途:
- LibraryView 显示文件处理进度
- 实时更新 Pipeline 状态
- 支持阶段级进度显示

状态: ✅ 编译通过
2026-10-14 20:15:24 +08:00
3e7eba0741 feat: 添加 Scene VLM Stats 快速 endpoint 支持
新增功能:
1. loadSceneVlmStats() 函数
   - 调用快速 endpoint: /api/v1/file/{uuid}/scene-vlm-stats
   - 返回: {total_scenes, status, vlm_done, vlm_total}
   - 响应时间: < 10ms (vs 旧 API 100ms+)

2. loadFileStats() 增强
   - 如果 get_file_stats 未返回 scene_vlm 数据
   - 自动调用 loadSceneVlmStats() 获取

3. 测试脚本
   - scripts/test_scene_vlm_api.sh
   - 测试新 endpoint 性能
   - 对比新旧 API

API Endpoint:
GET /api/v1/file/{file_uuid}/scene-vlm-stats

返回示例:
{
  "total_scenes": 1204,
  "status": "ready",
  "vlm_done": 1204
}

优势:
- 快速响应 (< 10ms)
- 轻量级数据
- 无需加载完整文件信息
- 适合频繁轮询

使用场景:
- LibraryView 显示 Scene VLM 状态
- Pipeline Progress 更新
- 文件状态监控
2026-10-14 10:11:10 +08:00
313d42be2f fix: 设置默认账号为 demo/demo123,修复数据路径
问题修复:
1. ✅ 默认账号设置
   - db.rs: 默认密码改为 demo123
   - .env.template: 默认密码改为 demo123
   - install.sh: 默认密码改为 demo123

2. ✅ 数据路径动态化
   - db.rs: 使用 dirs::home_dir() 自动检测用户主目录
   - 默认路径: {HOME}/momentry_studio/data/users
   - 支持通过 MOMENTRY_DATA_DIR 环境变量自定义

验证脚本:
- scripts/verify_default_setup.sh: 验证默认账号和数据路径

目标:
- 安装后可直接使用 demo/demo123 登录
- 数据路径随用户主目录自动调整
- 适用于任何用户环境

影响:
- demo 用户: 密码固定为 demo123
- 数据路径: 自动检测 {HOME}/momentry_studio/data/users
- 安装即可使用,无需额外配置
2026-10-12 15:35:22 +08:00
12943a3f07 docs: 准备 v0.1.0 发布文档
发布文档:
1. RELEASE_PREPARATION.md - 发布准备清单
   - 发布内容清单
   - 系统要求
   - 构建步骤
   - 发布检查清单
   - 安装包制作

2. INSTALLATION_GUIDE.md - 详细安装指南
   - 系统要求
   - 快速安装步骤
   - 详细安装流程
   - 高级配置
   - 故障排除
   - m4promini 测试步骤

3. QUICK_REFERENCE.md - 快速参考卡片
   - 一键安装命令
   - 系统要求表格
   - 关键路径
   - 常用命令
   - 故障排除

4. README.md - 项目主文档
   - 项目简介
   - 快速开始
   - 功能特性
   - 架构设计
   - API 文档
   - 版本历史

目标:
- 安装到任何需要的系统
- 测试系统: m4promini
- 交给 admin team 做成安装包

文档特点:
- 一键安装脚本
- 详细步骤说明
- 故障排除指南
- 快速参考卡片
2026-10-12 15:14:07 +08:00