From d20b1c3b285891b1458638aef51a27c74b13d8f0 Mon Sep 17 00:00:00 2001 From: PM-pinou <2504420230@qq.com> Date: Tue, 21 Jul 2026 14:15:56 +0800 Subject: [PATCH] v1.1.3: default server 0.0.0.0:80 + row-level clustering + filter UI + dataset selector --- analysis/views.py | 21 +--------- config/config.yaml | 4 +- config/loader.py | 4 +- templates/tianxuan/manual.html | 71 +++++++++++++++++++++++----------- 4 files changed, 55 insertions(+), 45 deletions(-) diff --git a/analysis/views.py b/analysis/views.py index 25c906a..393755d 100644 --- a/analysis/views.py +++ b/analysis/views.py @@ -899,7 +899,7 @@ def manual_run_analysis(request): algorithm = body.get('algorithm', 'hdbscan') min_cluster_size = int(body.get('min_cluster_size', 5)) head = body.get('head') - cluster_mode = body.get('cluster_mode', 'entity') + cluster_mode = body.get('cluster_mode', 'raw') def _analysis_fn(run, ctx): from analysis.session_store import SessionStore @@ -909,7 +909,7 @@ def manual_run_analysis(request): min_cluster_size = ctx['min_cluster_size'] head = ctx.get('head') pk = ctx['pk'] - cluster_mode = ctx.get('cluster_mode', 'entity') + cluster_mode = ctx.get('cluster_mode', 'raw') store = SessionStore() try: @@ -931,23 +931,6 @@ def manual_run_analysis(request): ds_id = upload_ds_id if store.get_dataset(upload_ds_id) else f'upload_{pk}' - # ── Cluster mode: entity aggregation vs raw ── - if cluster_mode == 'entity': - # Build entity profiles first, then cluster on entity dataset - from analysis.tool_registry import _handle_build_entity_profiles - import asyncio - entity_result = asyncio.new_event_loop().run_until_complete( - _handle_build_entity_profiles(dataset_id=ds_id, auto_detect=True) - ) - if 'error' in entity_result: - run.error_message = f'实体聚合失败: {entity_result["error"]}' - run.status = 'failed' - run.save(update_fields=['status', 'error_message']) - return - ds_id = entity_result['dataset_id'] - run.entity_count = entity_result.get('n_entities') - run.save(update_fields=['entity_count']) - # Use the unified clustering pipeline (clustering → extraction → PCA) from analysis.views import _run_clustering_pipeline _run_clustering_pipeline( diff --git a/config/config.yaml b/config/config.yaml index 64c08d3..88eab85 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,6 +1,6 @@ server: - host: 127.0.0.1 - port: 8000 + host: 0.0.0.0 + port: 80 debug: false data: schema_strict: false diff --git a/config/loader.py b/config/loader.py index e7e17d8..36a4fee 100644 --- a/config/loader.py +++ b/config/loader.py @@ -10,8 +10,8 @@ class Config(BaseModel): """Typed configuration for TianXuan.""" class Server(BaseModel): - host: str = '127.0.0.1' - port: int = 8000 + host: str = '0.0.0.0' + port: int = 80 debug: bool = False class Data(BaseModel): diff --git a/templates/tianxuan/manual.html b/templates/tianxuan/manual.html index bb33199..7b797b6 100644 --- a/templates/tianxuan/manual.html +++ b/templates/tianxuan/manual.html @@ -111,19 +111,11 @@ - -