diff --git a/pipekit/web/app.py b/pipekit/web/app.py index c38b4b3..674c125 100644 --- a/pipekit/web/app.py +++ b/pipekit/web/app.py @@ -295,6 +295,29 @@ def wizard_step2(request: Request, ) +@_router.get("/wizard/schemas") +def wizard_schemas(request: Request, + source_connection_id: int = Query(...)): + """JSON list of schema names. Drivers that need scoping (e.g. MSSQL by + database) read those qualifiers from the querystring.""" + conn = repo.get_connection(source_connection_id) + if conn is None: + raise HTTPException(404, f"connection id={source_connection_id} not found") + drv = _driver_for_conn(conn) + if drv is None: + raise HTTPException(500, "driver row missing for connection") + qp = dict(request.query_params) + qvals = {f.name: qp[f.name] for f in drv.browse_fields() + if f.name != "schema" and qp.get(f.name)} + try: + names = drv.list_schemas(conn, **qvals) + except (jrunner.JrunnerError, ValueError) as e: + return {"error": str(e), "schemas": []} + except Exception as e: # noqa: BLE001 + return {"error": f"{type(e).__name__}: {e}", "schemas": []} + return {"schemas": names} + + @_router.get("/wizard/columns", response_class=HTMLResponse) def wizard_step3(request: Request, source_connection_id: int = Query(...), diff --git a/pipekit/web/static/style.css b/pipekit/web/static/style.css index 24e85b7..013ef8f 100644 --- a/pipekit/web/static/style.css +++ b/pipekit/web/static/style.css @@ -206,6 +206,9 @@ form.inline { display: inline; } grid-template-columns: 2fr 1fr; gap: 1rem; } +/* Grid items default to min-width:auto which is content-sized; let them + shrink so wide tables/inputs inside don't blow out the layout. */ +.two-col > * { min-width: 0; } @media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } } @@ -261,11 +264,16 @@ label.field .help { grid-column: 2; color: var(--text-muted); font-size: 12px; } .steps .step .num { font-weight: 700; margin-right: 0.4rem; } /* Radio/checkbox-in-row tables */ +table.picker { table-layout: fixed; } table.picker td.pick { width: 2.5rem; text-align: center; } table.picker input[type="radio"], table.picker input[type="checkbox"] { margin: 0; } table.picker tbody tr { cursor: pointer; } table.picker tbody tr:hover td { background: #1c2128; } +/* Drop the global 14rem min-width for in-row text inputs so the picker + table can shrink to its container instead of pushing past it. */ +table.picker input[type="text"] { min-width: 0; } +table.picker td { overflow: hidden; text-overflow: ellipsis; } /* Flash messages */ .flash { diff --git a/pipekit/web/templates/wizard_step2.html b/pipekit/web/templates/wizard_step2.html index bd0236b..9deeae5 100644 --- a/pipekit/web/templates/wizard_step2.html +++ b/pipekit/web/templates/wizard_step2.html @@ -22,10 +22,12 @@ {% if f.help %}{{ f.help }}{% endif %} {% endfor %} +