diff --git a/Dockerfile b/Dockerfile index d4500a2..8c8f554 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,19 +22,20 @@ RUN pip install --no-cache-dir bambu-lab-cloud-api --no-deps && \ (d / 'INSTALLER').write_text('pip\n'); \ (d / 'RECORD').write_text('')" -# Install project and remaining dependencies (pip sees opencv-python already satisfied) +# Install standalone dependencies first — cached unless pyproject.toml changes COPY pyproject.toml . RUN pip install --no-cache-dir ".[standalone,mcp]" -# Copy application code +# Copy full source and install the local package (no-deps: already installed above) COPY . . +RUN pip install --no-cache-dir --no-deps . # Create data directory for SQLite RUN mkdir -p /app/data -# Collect static files +# Collect static files from the locally installed package ENV DJANGO_SETTINGS_MODULE=standalone.settings -RUN python standalone/manage.py collectstatic --noinput 2>/dev/null || true +RUN python standalone/manage.py collectstatic --noinput # Supervisor config to run both web and collector COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf diff --git a/bambu_run/views.py b/bambu_run/views.py index 414d5ba..fa37a22 100644 --- a/bambu_run/views.py +++ b/bambu_run/views.py @@ -175,10 +175,22 @@ class PrinterDashboardView(LoginRequiredMixin, TemplateView): # Group trays by physical AMS unit for the panel-style dashboard layout — # one tinted panel per unit, full-width for multi-slot units (AMS/AMS 2 Pro), # compact for single-slot units (AMS HT) so several can flow side-by-side. + # Filaments with ams_unit_id=None (pre-multi-AMS rows) fall into a single + # unlabelled group so they still render rather than being silently dropped. units_meta = { u.get('unit_id'): u for u in (latest_metric.ams_units or []) } ams_groups = [] + ungrouped = [f for f in filaments_list if f.get('ams_unit_id') is None] + if ungrouped: + ams_groups.append({ + 'unit_id': None, + 'ams_type': '', + 'label': 'AMS', + 'humidity': None, + 'temp': None, + 'filaments': ungrouped, + }) for uid, label in sorted(seen_units.items()): unit_meta = units_meta.get(str(uid), {}) ams_groups.append({