database removed outside

This commit is contained in:
2026-06-08 14:48:14 +08:00
parent bf8e72f5b6
commit 75dd78aa33
68 changed files with 679 additions and 1815 deletions
+3 -7
View File
@@ -26,6 +26,7 @@ from pdk_access import (
)
from router_dependency import RouterStackUnavailable
from routed_layout_preview import create_routed_layout_svg
from storage_paths import DATABASE_ROOT, EXPORT_ROOT
from technology_manifest import TechnologyManifestError, read_technology_manifest
# --- Path Configurations ---
@@ -38,11 +39,6 @@ REPO_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', '..'))
# Component/category icons are served from backend/icons for the library panel.
ICONS_DIR = os.path.join(BASE_DIR, 'icons')
# Saved project YAML, generated previews, and temporary exports live under the
# database folder so each user can have isolated project storage.
DATABASE_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', 'database'))
EXPORT_ROOT = os.path.abspath(os.path.join(DATABASE_ROOT, '_exports'))
# Flask serves the HTML/CSS/JS frontend and exposes JSON APIs for persistence,
# PDK lookup, preview generation, and GDS export.
@@ -586,7 +582,7 @@ def user_logs():
@app.route('/api/projects', methods=['GET'])
@login_required_json
def list_projects():
"""List projects stored under database/<username>/layout."""
"""List projects stored under the external runtime database root."""
root = user_layout_root()
os.makedirs(root, exist_ok=True)
@@ -676,7 +672,7 @@ def get_project(project_name):
@app.route('/api/projects/<project_name>', methods=['DELETE'])
@login_required_json
def delete_project(project_name):
"""Delete a user's project folder under database/<username>/layout."""
"""Delete a user's project folder under the external runtime database root."""
root = project_root(project_name)
layout_root = os.path.abspath(user_layout_root())
target = os.path.abspath(root)