From 8a0228b20eda33d531256640085c9b0c3a4fa4fc Mon Sep 17 00:00:00 2001 From: Jason Wang <56037774+JasonW404@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:04:41 +0800 Subject: [PATCH] feat: Enhanced file and annotation synchronization across DataMate and LabelStudio. fix: change LabelStudio mapping to +1 of DataMate. * feat: Refactor configuration and sync logic for improved dataset handling and logging * feat: Enhance annotation synchronization and dataset file management - Added new fields `tags_updated_at` to `DatasetFiles` model for tracking the last update time of tags. - Implemented new asynchronous methods in the Label Studio client for fetching, creating, updating, and deleting task annotations. - Introduced bidirectional synchronization for annotations between DataMate and Label Studio, allowing for flexible data management. - Updated sync service to handle annotation conflicts based on timestamps, ensuring data integrity during synchronization. - Enhanced dataset file response model to include tags and their update timestamps. - Modified database initialization script to create a new column for `tags_updated_at` in the dataset files table. - Updated requirements to ensure compatibility with the latest dependencies. * fix: Update port mapping for label studio and adjust base URL in DataAnnotation component --- deployment/docker/label-studio/docker-compose.yml | 2 +- frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/deployment/docker/label-studio/docker-compose.yml b/deployment/docker/label-studio/docker-compose.yml index e6c739c..4026b6a 100644 --- a/deployment/docker/label-studio/docker-compose.yml +++ b/deployment/docker/label-studio/docker-compose.yml @@ -9,7 +9,7 @@ services: expose: - "8000" ports: - - "8000:8000" + - "30001:8000" depends_on: - pg-db environment: diff --git a/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx b/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx index 3118d74..1564a64 100644 --- a/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx +++ b/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx @@ -14,7 +14,6 @@ import { deleteAnnotationTaskByIdUsingDelete, queryAnnotationTasksUsingGet, syncAnnotationTaskUsingPost, - getConfigUsingGet, } from "../annotation.api"; import { mapAnnotationTask } from "../annotation.const"; import CreateAnnotationTask from "../Create/components/CreateAnnptationTaskDialog"; @@ -47,7 +46,7 @@ export default function DataAnnotation() { let mounted = true; (async () => { try { - const baseUrl = `http://${window.location.hostname}:8000`; + const baseUrl = `http://${window.location.hostname}:${window.location.port + 1}`; if (mounted) setLabelStudioBase(baseUrl); } catch (e) { if (mounted) setLabelStudioBase(null);