New web UI with iPhone web app
Redesigned status, log, tag generator and settings pages: spool rings in filament colour, live job card (progress and time left read from CC2 Control's /api/printer while a job runs), log page with filters, iOS-style settings with a write/dry-run switch. On phones: bottom tab bar, printer switcher, slot details in a bottom sheet. Dark mode follows the system. Web app manifest and home screen icons for "Add to Home Screen". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014GcEk5tkfFSYD6NTF66NkC
This commit is contained in:
1 parent
67c3b54903
commit
ae44441cfb
16 files changed
+982
-285
No files matched your search
+17
@@ -14,6 +14,7 @@ import paramiko
|
||||
import segno
|
||||
from fastapi import FastAPI, HTTPException, Request
|
||||
from fastapi.responses import HTMLResponse, JSONResponse, Response
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
from . import materials, tagcodec
|
||||
@@ -53,6 +54,7 @@ def create_app(data_dir: Path | None = None, *, bridge: Bridge | None = None, st
|
||||
app = FastAPI(title="CC2 Spoolman Bridge", lifespan=lifespan, docs_url=None, redoc_url=None, openapi_url=None)
|
||||
app.state.bridge = bridge
|
||||
templates = Jinja2Templates(directory=str(HERE / "templates"))
|
||||
app.mount("/static", StaticFiles(directory=str(HERE / "static")), name="static")
|
||||
|
||||
user, password = env.get("BRIDGE_USER", ""), env.get("BRIDGE_PASSWORD", "")
|
||||
|
||||
@@ -87,6 +89,21 @@ def create_app(data_dir: Path | None = None, *, bridge: Bridge | None = None, st
|
||||
def index(request: Request):
|
||||
return page(request, "status.html")
|
||||
|
||||
@app.get("/log", response_class=HTMLResponse)
|
||||
def log_page(request: Request):
|
||||
return page(request, "log.html")
|
||||
|
||||
@app.get("/manifest.webmanifest")
|
||||
def manifest():
|
||||
return JSONResponse({
|
||||
"name": "CC2 Bridge", "short_name": "CC2 Bridge", "lang": "de",
|
||||
"start_url": "/", "scope": "/", "display": "standalone",
|
||||
"background_color": "#EDEFF2", "theme_color": "#14181F",
|
||||
"icons": [{"src": "/static/icon-192.png", "sizes": "192x192", "type": "image/png"},
|
||||
{"src": "/static/icon-512.png", "sizes": "512x512", "type": "image/png"},
|
||||
{"src": "/static/icon.svg", "sizes": "any", "type": "image/svg+xml"}],
|
||||
}, media_type="application/manifest+json")
|
||||
|
||||
@app.get("/tags", response_class=HTMLResponse)
|
||||
def tags(request: Request):
|
||||
return page(request, "tags.html")
|
||||
|
||||
Reference in new issue
Block a user