Add maintenance documentation links with model-specific wiki URLs (#59)

Features:
  - Add wiki_url field to MaintenanceType for custom type documentation links
  - Add printer_model to MaintenanceStatus for model-specific URL mapping
  - Display external link icon next to maintenance item names
  - Map system maintenance types to Bambu Lab wiki pages by printer model:
    - Lubricate Linear Rails, Clean Nozzle/Hotend, Check Belt Tension
    - Clean Carbon Rods (X1/P1 only), Clean Build Plate, Check PTFE Tube
    - HEPA/Carbon Filter, Left Nozzle Rail (H2 series)
  - Add Documentation Link input to custom type create/edit forms

  Bug fix:
  - Fix 500 error when assigning maintenance type to printer (lazy loading)

  Database:
  - Add migration for wiki_url column on maintenance_types table
This commit is contained in:
maziggy
2026-01-07 07:53:42 +01:00
parent fe1d10b705
commit 4f2a45c190
8 changed files with 218 additions and 62 deletions
+6
View File
@@ -387,6 +387,12 @@ async def run_migrations(conn):
except Exception:
pass
# Migration: Add wiki_url column to maintenance_types for documentation links
try:
await conn.execute(text("ALTER TABLE maintenance_types ADD COLUMN wiki_url VARCHAR(500)"))
except Exception:
pass
async def seed_notification_templates():
"""Seed default notification templates if they don't exist."""